openMVG / ImageDataset_SceauxCastle

Image of "Chateau de Sceaux", Sceaux castle. France. Photographer: Copyright 2012 Pierre MOULON
51 stars 33 forks source link

How to use repository #2

Open tanujamohan opened 8 years ago

tanujamohan commented 8 years ago

I have cloned the OpenMVG repository and used Xcode to successfully build it. Now I would like to run this example. How should I go about doing this and what commands do I need to use?

pmoulon commented 8 years ago

@tanujamohan Just follow the doc and use the provided python sample that run all the openMVG SfM tools http://openmvg.readthedocs.io/en/latest/software/SfM/SfM/#openmvg-sfm-pipelines-demo

If you want to run the code samples see here: http://openmvg.readthedocs.io/en/latest/openMVG_Samples/openMVG_Samples/

tanujamohan commented 8 years ago

I was able to get the tutorial_python with the castle images to work. Now I am trying to use the SfM_GlobalPipeline.py with my own images that I took.

This is the command that I am running: python SfM_GlobalPipeline.py [path to my images] [path to output]

I am currently receiving a sfm_data.bin cannot be read and robust.bin cannot be read. How can I fix this? I've tried recompiling and running the command but that does not solve the issue.

pmoulon commented 8 years ago

Can you send the log there? I think your image does not have exif information or the camera sensor size of your camera is not in the database.

tanujamohan commented 8 years ago

Here is my log:

`user-osx:SfM user$ python SfM_GlobalPipeline.py /Users/user/Desktop/openMVG_Build/software/SfM/myCamera /Users/user/Desktop/openMVG_Build/software/SfM/tutorial_out2 useruser

('Using input dir : ', '/Users/user/Desktop/openMVG_Build/software/SfM/myCamera')

(' output_dir : ', '/Users/user/Desktop/openMVG_Build/software/SfM/tutorial_out2')

  1. Intrinsics analysis

    You called :

/Users/user/Desktop/openMVG_Build/Darwin-x86_64-RELEASE/RELEASE/openMVG_main_SfMInit_ImageListing

--imageDirectory /Users/user/Desktop/openMVG_Build/software/SfM/myCamera

--sensorWidthDatabase /Users/user/Desktop/openMVG/src/software/SfM/../../openMVG/exif/sensor_width_database/sensor_width_camera_database.txt

--outputDirectory /Users/user/Desktop/openMVG_Build/software/SfM/tutorial_out2/matches

--focal -1

--intrinsics

--camera_model 3

--group_camera_model 1

0% 10 20 30 40 50 60 70 80 90 100%

|----|----|----|----|----|----|----|----|----|----|


Warning & Error messages:

.DS_Store: Unkown image file format.

SfMInit_ImageListing report:

listed #File(s): 21

usable #File(s) listed in sfm_data: 20

  1. Compute features

    You called :

/Users/user/Desktop/openMVG_Build/Darwin-x86_64-RELEASE/RELEASE/openMVG_main_ComputeFeatures

--input_file /Users/user/Desktop/openMVG_Build/software/SfM/tutorial_out2/matches/sfm_data.json

--outdir /Users/user/Desktop/openMVG_Build/software/SfM/tutorial_out2/matches

--describerMethod SIFT

--upright 0

--describerPreset NORMAL

--force 0

0% 10 20 30 40 50 60 70 80 90 100%

|----|----|----|----|----|----|----|----|----|----|

Task done in (s): 0.001

  1. Compute matches

    You called :

/Users/user/Desktop/openMVG_Build/Darwin-x86_64-RELEASE/RELEASE/openMVG_main_ComputeMatches

--input_file /Users/user/Desktop/openMVG_Build/software/SfM/tutorial_out2/matches/sfm_data.json

--out_dir /Users/user/Desktop/openMVG_Build/software/SfM/tutorial_out2/matches

Optional parameters:

--force 0

--ratio 0.8

--geometric_model e

--video_mode_matching -1

--pair_list

--nearest_matching_method AUTO

--guided_matching 0

0% 10 20 30 40 50 60 70 80 90 100%

|----|----|----|----|----|----|----|----|----|----|


PREVIOUS RESULTS LOADED; #pair: 21

sh: neato: command not found

0% 10 20 30 40 50 60 70 80 90 100%

|----|----|----|----|----|----|----|----|----|----|


Task done in (s): 0.002

Export Adjacency Matrix of the pairwise's geometric matches

sh: neato: command not found

  1. Do Global reconstruction

Global Structure from Motion:


Open Source implementation of the paper:

"Global Fusion of Relative Motions for Robust, Accurate and Scalable Structure from Motion."

Pierre Moulon, Pascal Monasse and Renaud Marlet. ICCV 2013.


0% 10 20 30 40 50 60 70 80 90 100%

|----|----|----|----|----|----|----|----|----|----|


CleanGraph_KeepLargestBiEdge_Nodes():: => connected Component: 0

Cardinal of nodes: 0

Cardinal of edges: 0

Invalid input image graph for global SfM

  1. Colorize Structure

The input SfM_Data file "/Users/user/Desktop/openMVG_Build/software/SfM/tutorial_out2/reconstruction_global/sfm_data.bin" cannot be read.

  1. Structure from Known Poses (robust triangulation)

Compute Structure from the provided poses

The input SfM_Data file "/Users/user/Desktop/openMVG_Build/software/SfM/tutorial_out2/reconstruction_global/sfm_data.bin" cannot be read.

The input SfM_Data file "/Users/user/Desktop/openMVG_Build/software/SfM/tutorial_out2/reconstruction_global/robust.bin" cannot be read.

user-osx:SfM user$ `

pmoulon commented 8 years ago

It seems that your image graph is empty once the pairwise filtering is done. Can you check that you have something defined in the intrinsic in your file: /Users/user/Desktop/openMVG_Build/software/SfM/tutorial_out2/matches/sfm_data.json

Something like:

"intrinsics": [
        {
            "key": 0,
            "value": {
                "polymorphic_id": 2147483649,
                "polymorphic_name": "pinhole_radial_k3",
                "ptr_wrapper": {
                    "id": 2147483780,
                    "data": {

If you have nothing defined it's because the sensor size of your camera is not defined. If your image have all the same size, you can force the focal to be defined to a default value X like 1.2*(max(w,h)) with -f X on SfMInit_ImageListing

tanujamohan commented 8 years ago

It appears that I do not have anything in the intrinsics. I'm using an LG G3 to take my photos, so I went into the sensor_width_camera_database.txt and added "LG G3;4.69". Ran the python script again and still get the same error. Can you explain further how I should define the sensor size of my camera? Thank you for your patience!

tanujamohan commented 8 years ago

Also, what I have tried modifying the Global Pipeline script so that the intrinsic analysis now has (first line is commented out):

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] )

pIntrisics = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_SfMInit_ImageListing"), "-i", input_dir, "-o", matches_dir, "-d", camera_file_params], "-f", "1152" ) pIntrisics.wait()

Running the python code gives me this as output in the command line: user-osx:SfM user$ python SfM_GlobalPipeline.py /Users/user/Desktop/openMVG_Build/software/SfM/myCamera /Users/user/Desktop/openMVG_Build/software/SfM/tutorial_out2

('Using input dir : ', '/Users/user/Desktop/openMVG_Build/software/SfM/myCamera')

(' output_dir : ', '/Users/user/Desktop/openMVG_Build/software/SfM/tutorial_out2')

  1. Intrinsics analysis

Traceback (most recent call last):

File "SfM_GlobalPipeline.py", line 50, in

pIntrisics = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_SfMInit_ImageListing"),  "-i", input_dir, "-o", matches_dir, "-d", camera_file_params], "-f", "1152" )

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 659, in init

raise TypeError("bufsize must be an integer")

TypeError: bufsize must be an integer

pmoulon commented 8 years ago

Command line

You must move the option inside the []

So change pIntrisics = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_SfMInit_ImageListing"), "-i", input_dir, "-o", matches_dir, "-d", camera_file_params], "-f", "1152" ) to

pIntrisics = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_SfMInit_ImageListing"), "-i", input_dir, "-o", matches_dir, "-d", camera_file_params, "-f", "1152"] ) and it will be ok.

Database Can you try to only set "G3;4.69"? Can you send me an image to openmvg-team[AT]googlegroups.com in order to let me look why it does not work?

sidis8066 commented 5 years ago

Hi , @pmoulon I am taking the Human data with Realsense Sensor(D435). How to run the code with this data for 360 degrees of human data.

stq054188 commented 4 years ago

Command line

You must move the option inside the []

So change pIntrisics = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_SfMInit_ImageListing"), "-i", input_dir, "-o", matches_dir, "-d", camera_file_params], "-f", "1152" ) to

pIntrisics = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_SfMInit_ImageListing"), "-i", input_dir, "-o", matches_dir, "-d", camera_file_params, "-f", "1152"] ) and it will be ok.

Database Can you try to only set "G3;4.69"? Can you send me an image to openmvg-team[AT]googlegroups.com in order to let me look why it does not work?

Great,it works for me!

vinod846 commented 4 years ago

I do have similar logs . can you share any suggestion that how do i convert html report to pdf ??