def generatePointCloudClicked(): Point_param.pushButton.setEnabled(True) os.chdir(wrk_drr) print "current working directory is", wrk_drr bundlerPath="" path_image= str(Point_param.plainTextEdit.toPlainText()) print "image path is",path_image newPhotoPath=r"point_cloud/temp/" if not(os.path.isdir(path_image)): print("choose correct directory") # win32api.MessageBox(0,"Invalid Path, Please choose Correct Directory","Warning") else: p=os.listdir(newPhotoPath) for i in p: os.remove(newPhotoPath+i) f=os.listdir(path_image) for i in f: a=i.split('.') flag=0 ## try: ## Image.open(os.path.join(path_image,i)) ## except: ## flag=1 ## print "can not open image" if (a[len(a)-1]=="jpg" or a[len(a)-1]=="JPG")and flag==0: shutil.copy(os.path.join(path_image,i),newPhotoPath) print "copying photo" gps.run(projPath,[newPhotoPath ,os.path.join(projPath,"coordinates.txt")])# photo directory along with coordinates is passed to it #checkGeotag() a=[os.path.join(wrk_drr,newPhotoPath)] name.run(a) os.chdir(wrk_drr) a=[bundlerPath , "--photos=" + os.path.join(wrk_drr,newPhotoPath)] ## thread.start_new_thread(RunBundler.run,(a,)) with open(r"osmbundler/curr_proj.txt",'w') as proj : proj.write(projPath) RunBundler.run(a) print "in point cloud before georeference" ##to run PMVS ## bundlerOutputPath=os.path.join(projPath,"PointCloud") ## print "bundlerOutputPath" ## print bundlerOutputPath ## ## if not (os.path.isdir(bundlerOutputPath)): ## print("enter correct path") ## # win32api.MessageBox(0,'Invalid path. Enter the correct path','Warning') ## else: ## a=['--bundlerOutputPath='+bundlerOutputPath] ## RunPMVS.run(a) #### thread.start_new_thread( RunPMVS.run,(a,) ) ## print "step 1 ends" Point_param.pushButton_3.setStyleSheet(_fromUtf8("color: rgb(0, 85,0);\n""font: 10pt \"Times New Roman\";")) Point_param.pushButton.setEnabled(True) return True
def generatePointCloudClicked(): Point_param.pushButton.setEnabled(True) os.chdir(wrk_drr) print "current working directory is", wrk_drr bundlerPath="" path_image= str(Point_param.plainTextEdit.toPlainText()) print "image path is",path_image newPhotoPath=r"point_cloud/temp/" if not(os.path.isdir(path_image)): print("choose correct directory") # win32api.MessageBox(0,"Invalid Path, Please choose Correct Directory","Warning") else: p=os.listdir(newPhotoPath) for i in p: os.remove(newPhotoPath+i) f=os.listdir(path_image) for i in f: a=i.split('.') flag=0 ## try: ## Image.open(os.path.join(path_image,i)) ## except: ## flag=1 ## print "can not open image" if (a[len(a)-1]=="jpg" or a[len(a)-1]=="JPG")and flag==0: shutil.copy(os.path.join(path_image,i),newPhotoPath) print "copying photo" gps.run(projPath,[newPhotoPath ,os.path.join(projPath,"coordinates.txt")])# photo directory along with coordinates is passed to it #checkGeotag() a=[os.path.join(wrk_drr,newPhotoPath)] name.run(a) os.chdir(wrk_drr) a=[bundlerPath , "--photos=" + os.path.join(wrk_drr,newPhotoPath)] ## thread.start_new_thread(RunBundler.run,(a,)) with open(r"osmbundler/curr_proj.txt",'w') as proj : proj.write(projPath) RunBundler.run(a) print "in point cloud before georeference" ##to run PMVS bundlerOutputPath=os.path.join(projPath,"PointCloud") print "bundlerOutputPath" print bundlerOutputPath if not (os.path.isdir(bundlerOutputPath)): print("enter correct path") # win32api.MessageBox(0,'Invalid path. Enter the correct path','Warning') else: a=['--bundlerOutputPath='+bundlerOutputPath] RunPMVS.run(a) ## thread.start_new_thread( RunPMVS.run,(a,) ) print "step 1 ends" Point_param.pushButton_3.setStyleSheet(_fromUtf8("color: rgb(0, 85,0);\n""font: 10pt \"Times New Roman\";")) Point_param.pushButton.setEnabled(True) return True
import name ''' fi = open('dondake.txt', 'w+') don = name.run(101000) fi.writelines(don) fi.close() ''' name.run(100)
import name ''' fi = open('dondake.txt', 'w+') don = name.run(101000) fi.writelines(don) fi.close() ''' name.run(5400)