dongchangxi 11 months ago
parent
commit
dd313228bd
  1. 8
      yj_local_build/main_step1.py

8
yj_local_build/main_step1.py

@ -74,14 +74,14 @@ def filter_dark_texture_image(pid):
def detect_markers(psid, pid): def detect_markers(psid, pid):
def fix_region(): def fix_region():
#判断是否存在rcbox #判断是否存在rcbox
region_filename = os.path.join(config["workdir"], pid, "a.rcbox") region_filename = os.path.join(config["workdir"], pid, f"{pid}.rcbox")
while True: while True:
if os.path.exists(region_filename): if os.path.exists(region_filename):
print("region_filename",region_filename) print("region_filename",region_filename)
with open(region_filename, 'r') as f: with open(region_filename, 'r') as f:
lines = f.readlines() lines = f.readlines()
lines = [line.replace('"NONE" globalCoordinateSystemWkt="NONE" globalCoordinateSystemName="NONE"', '"+proj=geocent +ellps=WGS84 +no_defs" globalCoordinateSystemName="local:1 - Euclidean"') for line in lines] lines = [line.replace('"NONE" globalCoordinateSystemWkt="NONE" globalCoordinateSystemName="NONE"', '"+proj=geocent +ellps=WGS84 +no_defs" globalCoordinateSystemName="local:1 - Euclidean"') for line in lines]
shutil.copyfile(os.path.join(config['workdir'], 'xmps','stand.rcbox'), os.path.join(config['workdir'], pid,f"{pid}.rcbox")) # shutil.copyfile(os.path.join(config['workdir'], 'xmps','stand.rcbox'), os.path.join(config['workdir'], pid,f"{pid}.rcbox"))
break break
else: else:
time.sleep(10) time.sleep(10)
@ -91,7 +91,7 @@ def detect_markers(psid, pid):
#获取当前的工作目录 {config["r"]["setTextureFalse"]} -setReconstructionRegion "{rcboxfile}"\ #获取当前的工作目录 {config["r"]["setTextureFalse"]} -setReconstructionRegion "{rcboxfile}"\
dirCurr = os.getcwd() dirCurr = os.getcwd()
shutil.copyfile(os.path.join(config['workdir'], 'xmps','stand.rcbox'), os.path.join(config['workdir'], pid,f"{pid}.rcbox")) #shutil.copyfile(os.path.join(config['workdir'], 'xmps','stand.rcbox'), os.path.join(config['workdir'], pid,f"{pid}.rcbox"))
rcboxfile = os.path.join(config["workdir"], pid, f"{pid}.rcbox") rcboxfile = os.path.join(config["workdir"], pid, f"{pid}.rcbox")
cmd = f'{config["rcbin"]} {config["r2"]["init"]} -setInstanceName {pid} \ cmd = f'{config["rcbin"]} {config["r2"]["init"]} -setInstanceName {pid} \
-save "{os.path.join(config["workdir"], pid, f"{pid}.rcproj")}" \ -save "{os.path.join(config["workdir"], pid, f"{pid}.rcproj")}" \
@ -102,7 +102,7 @@ def detect_markers(psid, pid):
-defineDistance 36h11:001 36h11:002 1 -defineDistance 36h11:002 36h11:004 1 -defineDistance 36h11:004 36h11:003 1 -defineDistance 36h11:003 36h11:001 1 -align -align -update {config["r2"]["setRegion"]} \ -defineDistance 36h11:001 36h11:002 1 -defineDistance 36h11:002 36h11:004 1 -defineDistance 36h11:004 36h11:003 1 -defineDistance 36h11:003 36h11:001 1 -align -align -update {config["r2"]["setRegion"]} \
-align -align -update \ -align -align -update \
-exportControlPointsMeasurements "{os.path.join(config["workdir"], pid, f"{pid}.controlPoints.csv")}" "{dirCurr}\exportControlPoints.config.xml"\ -exportControlPointsMeasurements "{os.path.join(config["workdir"], pid, f"{pid}.controlPoints.csv")}" "{dirCurr}\exportControlPoints.config.xml"\
-exportReconstructionRegion "{os.path.join(config["workdir"], pid, f"a.rcbox")}" \ -exportReconstructionRegion "{os.path.join(config["workdir"], pid, f"{pid}.rcbox")}" \
-selectImage "{os.path.join(config["workdir"],pid,"photo1")}\*" -enableTexturingAndColoring false \ -selectImage "{os.path.join(config["workdir"],pid,"photo1")}\*" -enableTexturingAndColoring false \
{textpicCmd} -save "{os.path.join(config["workdir"], pid, f"{pid}.rcproj")}" -quit' {textpicCmd} -save "{os.path.join(config["workdir"], pid, f"{pid}.rcproj")}" -quit'

Loading…
Cancel
Save