ySalaun / LineSfM

131 stars 46 forks source link

CALIBRATION error #6

Closed HollisJoe closed 6 years ago

HollisJoe commented 6 years ago

Hi, I use the TEST_IMAGE and use openMVG detections, but the CALIBRATION output this: 4 0000 /home/holy/source/com-InteriorModeling/LineSFMTestData/origin/0000.png 0001 /home/holy/source/com-InteriorModeling/LineSFMTestData/origin/0001.png 0002 /home/holy/source/com-InteriorModeling/LineSFMTestData/origin/0002.png 0003 /home/holy/source/com-InteriorModeling/LineSFMTestData/origin/0003.png reading intrinsic parameters reading global poses computing relative poses LOAD DETECTIONS AND MATCHES COMPUTE POSES PROCESSED IN 3.84876 images 0 and 1 Error in rotation : 120 Error in translation : nan images 1 and 2 Error in rotation : 120 Error in translation : nan images 2 and 3 Error in rotation : 120 Error in translation : nan AVERAGE RESULTS: Rotation: 120 Translation: nan

What this Error?

HollisJoe commented 6 years ago

The OpenMVG I use this: OPENMVG_SFM_BIN = "/home/holy/source/com-InteriorModeling/openMVG-1.3/build-src-Desktop-Default/Linux-x86_64-Release"

Indicate the openMVG camera sensor width directory

CAMERA_SENSOR_WIDTH_DIRECTORY = "/home/holy/source/com-InteriorModeling/openMVG-1.3/src/software/SfM" + "/../../openMVG/exif/sensor_width_database"

import os import subprocess import sys

if len(sys.argv) < 3: print ("Usage %s image_dir output_dir" % sys.argv[0]) sys.exit(1)

input_dir = sys.argv[1] output_dir = sys.argv[2] matches_dir = os.path.join(output_dir, "matches") reconstruction_dir = os.path.join(output_dir, "reconstruction_sequential") camera_file_params = os.path.join(CAMERA_SENSOR_WIDTH_DIRECTORY, "sensor_width_camera_database.txt")

print ("Using input dir : ", input_dir) print (" output_dir : ", output_dir)

Create the ouput/matches folder if not present

if not os.path.exists(output_dir): os.mkdir(output_dir) if not os.path.exists(matches_dir): os.mkdir(matches_dir)

print ("1. Intrinsics analysis") pIntrisics = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_SfMInit_ImageListing"), "-i", input_dir, "-o", matches_dir, "-d", camera_file_params, "-k", "2760;0;1536;0;2760;1024;0;0;1"] ) pIntrisics.wait()

print ("2. Compute features") pFeatures = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeFeatures"), "-i", matches_dir+"/sfm_data.json", "-o", matches_dir, "-m", "AKAZE_FLOAT"] ) pFeatures.wait()

print ("3. Compute matches") pMatches = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeMatches"), "-i", matches_dir+"/sfm_data.json", "-o", matches_dir] ) pMatches.wait()

ySalaun commented 6 years ago

Hi,

Just to be sure:

I don't really think of other issues but reply me if you still have an issue (be quick though, I am on holidays in 8 hours for a week)

Best,

Yohann

HollisJoe commented 6 years ago

Thanks! que 1. I run line_matching,get the results: default que 2. I give the matches.putative.txt and put it in the good folder: default default

ySalaun commented 6 years ago

I'm not sure to undertand. Did it work ? You're still having an issue ?

HollisJoe commented 6 years ago

Thanks! It still having an issue! default

ySalaun commented 6 years ago

It seems that you've put all the files (pictures, K.txt, camera ground truth ...) in a folder and the results in a subfolder called outPut. I am not sure that my code can handle these two different folders and I think you need to put all the files in the folder origin. Also note that the calibration might have worked well and the code just did not find the ground truth calibration files and this is why the error is nan and 120.

Best,

Yohann

HollisJoe commented 6 years ago

Thanks! Ii's Worked!