openMVG / openMVG

open Multiple View Geometry library. Basis for 3D computer vision and Structure from Motion.
Mozilla Public License 2.0
5.67k stars 1.67k forks source link

Problem with intrinsic parameters and metadata and not finding any residuals #2107

Open Luluie1 opened 2 years ago

Luluie1 commented 2 years ago

Hi all, I have tried to use the library. With the test castle images it works as it should. But when I take images with my phone (which results in fewer metadata in the images), I get the problem:

INFO: [loggerprogress.hpp:79] [- Regions Loading -] 50%
INFO: [loggerprogress.hpp:79] [- Regions Loading -] 100%
ERROR: [indMatch_utils.cpp:79] Cannot open the matche file: /home/pia/Documents/Photogrammetry/FrogNoVidResult/matches/matches.putative.bin.
ERROR: [main_GeometricFilter.cpp:256] Failed to load the initial matches file.
6. Do Sequential/Incremental reconstruction
INFO: [main_SfM.cpp:135] 
-----------------------------------------------------------
 Structure from Motion:
-----------------------------------------------------------
INFO: [loggerprogress.hpp:79] [- Features Loading -] 50%
INFO: [loggerprogress.hpp:79] [- Features Loading -] 100%
ERROR: [main_SfM.cpp:416] Cannot load the match file.
7. Colorize Structure
ERROR: [main_ComputeSfM_DataColor.cpp:69] The input SfM_Data file "/home/pia/Documents/Photogrammetry/FrogNoVidResult/reconstruction_sequential/sfm_data.bin" cannot be read.

When I just give the program a focal length by inserting: (i have tried focal lengths from 0.5 to 80000)

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, "-f", "1.5"] )#"-f", "2304" pIntrisics.wait() Then I get no error, but no residuals and therefore no points in the pointcloud ply file.

Therefore. I have tried the brute force way and copied the metadata from one of the castle images to all of mine and changed the focal length and aperature value to the values of my phone camera. Then I got a pretty bad result of just a few points. I can increase them by tuning the focal length with -f a bit, but the best I got was with 1.5. But the result is almost 2D and maybe the desk is visible (in 2d) on which I have placed the object.

This is my object: (I took many different photos from many angles of this object and did not move the object, but the camera) IMG_2329

This is my result:

Screenshot from 2022-09-08 18-23-49

Maybe I have done something completely wrong, so if someone knows what the problem could be, I'd appreciate it very much. Thanks for at least reading :)

pmoulon commented 2 years ago

Hello, if you camera is not registered in the camera database you need to provide a focal guess, the 1.5 should be a focal multiplier (and not the 1.5 by itself)

See here https://github.com/openMVG/openMVG/issues/1981#issue-1071136988 Basic idea focal_multiplier * max(image Weight, image Height)

Luluie1 commented 2 years ago

Thank you for your answer. I have tried that already, but it did not help. This way it did not get any points that can be matched. But I guess I have had another formula. I will try again tomorrow. How about a sampled video of the figure on a turntable where the background does not change? Is this deteriorating the result?

pmoulon commented 2 years ago

Else it could be due to the fact that your object does not have a lot of texture. You could try to put a journal paper below the object or below the object on the turntable and see if it helps.

pmoulon commented 2 years ago

Else feel free to share your dataset and we can see what we can tweak

pmoulon commented 1 year ago

Any feedback?

Luluie1 commented 1 year ago

Hi! Sorry I forgot that you answered and I continued with Voxel Carving instead, but I also have problems there, so I could still need this approach. Here is a link to my images in dropbox: https://www.dropbox.com/sh/b3pt836q2ndtmlq/AADvmjSkhN3qj8keW452L6Zaa?dl=0