Issue setting up mapping3D modules from opencv_contrib and testing it with sample code.
I came across the mapping3D module in the opencv_contrib and am very interested in testing its functionality. I am having issues setting it up. I have stated below the steps I used. I hope someone can resolve my issue.
I setup OpenCV version 2.4.13 from sourceforge and followed the steps mentioned in the links: 1. http://docs.opencv.org/2.4/doc/tutori... 2. http://docs.opencv.org/2.4/doc/tutori...
The two points mentioned above works and I tested it with the source code given in the Test it! section of link 1.
For the part a of the project, I am trying to capture an image of a face or of a a land and convert it into a searchable landscape. This searchable landscape would be a 3D search space consisting of the coordinates (x, y, z). To accomplish this part, I am using OpenCV's module mapping3D which can be found on this link: 1. https://github.com/Tetragramm/opencv_....
To setup this module, I followed the steps mentioned in the link: 1. https://github.com/Tetragramm/opencv_...
I used the steps below the If you prefer using the gui version of cmake (cmake-gui), then, you can add opencv_contrib modules within opencv core by doing the following: ....
It generates an OpenCV sln file and that VS2012 solution contains all of the modules present in the opencv_contrib. When you execute step number 5. complete this OPENCV_EXTRA_MODULES_PATH by the proper pathname to the <opencv_contrib>/modules....., you might want to let OPENCV_EXTRA_MODULES_PATH have the value (path_to_your_OpenCVcontrib)/opencv_contrib/modules/mapping3d. Then I opened the OpenCV solution and build the mapping3D module and it worked.
Then I wanted to test with the sample code given by the developer of this module and have an issue with it. Sample Code Link:https://github.com/Tetragramm/op...
I created a new VS2012 project and gave it the proper include directories and the linked it with the proper .lib files. But I have a error with the following line: Ptr<orb> pORB = ORB::create( 10000, 1.2, 1 );
I am not sure where the error is but I am totally confused now. Did I miss something in the setup steps?
If you need opencv_contrib you must clone opencv master 3.3-dev (or opencv at same date than original branch) :
and it is recommended to use them alongside the master branch or latest releases of OpenCV.
How do open a ply file which is being generated by the sample code? I am not sure which is the best application as I tried to use some tools like 3D viewer, but dont see anything. I installed the opencv using the exe for windows on sourceforge.
The contents of the ply file are like this. Not sure how to visualize it. ply format ascii 1.0 element vertex 1481 property float x property float y property float z end_header -6.16337e+011 -1.77463 -8.35503e+037 -2.35858e+011 1.42609 -0.000403444 -1.05862e-014 -1.81335 -3.56734e+028 0.394543 -1.87087 -1.2296e-020 3.62737e-016 -1.7585 -9.40945e-023 6.02611e+011 1.64101 -4.90946e+027 3.27006e-024 -1.91999 -3.39924e-022 -1.55096e-025 -1.74423 1.92807e+036 1.49853e+038 -1.75277 1.01956e+036 1.14181e-008 -1.9334 9.14855e-012 ...(more)
I also see the sample code reads an Poses.xml file. I do not understand what does this file describes. link text
I would be very thankful if you could please explain me the functionality very briefly so I could dive in deeper in the correct way
@Tetragramm
@Tetragramm I got this module working and it generates the ouptut ply file. I changed the line: Ptr<orb> pORB = ORB::create( 10000, 1.2, 1 ); to Ptr<orb> pORB = ORB::create("ORB"). Was this the correct approach?
But I have some questions.
What does the coordinates in the output .ply file represent? What does the Poses file depict.
I am trying to get a 3D representation(x, y, z) of an 2-D landscape image. These 3D points when plotted using a 3D viewer would allow one to visualize the image in 3D.
I think this is what this module achieves but may you please confirm if what I am thinking is correct.
I would be really thankful if you could let me know about this and really appreciate the help provided by OpenCV.
Thanks, Androma
So I think that interface changed in 3.3, so the example is out of date. That change to ORB should be fine.
The poses.xml file is the location and orientation of the camera at each frame. It also contains the camera matrix and distortion matrix, which remain constant, so there's only one of those.
The values in the .ply file are the 3d coordinates of the points that were tracked through all the frames. It is basically a sparse representation of the 3d scene. They ply file does not contain any information on textures or image data, so it wouldn't look like a 3d model, just a skeleton. Like THIS.
For instance, if I only input one image of a mountain, will Iget an outline representation of this mountain? I tried it with only one image but it doesnt seem to work. Moreover, I am using the opencv 2.4.13 and it was cumbersome to set it up. I got this module working somehow, is it necessary to use the latest version?
I have a ply file generated like the following for the sample image but can't find a good tool to view it. Which one did you use?
Ply file: ply format ascii 1.0 element vertex 1481 property float x property float y property float z end_header 0 0 0 -6.16337e+011 -1.77463 -8.35503e+037 -2.35858e+011 1.42609 -0.000403444 -1.05862e-014 -1.81335 -3.56734e+028 0.394543 -1.87087 -1.2296e-020 3.62737e-016 -1.7585 -9.40945e-023 6.02611e ...(more)
.... Does that mean the Poses.xml has to be left alone and not modified? I just want to confirm that the sparse representation of the 3d scene is generated from the input 2-D images? I just want the representation of the image in the form of points and this is exactly what i see in the imgur link you showed me. Does it work for one image? I see that you have used Viz to visualize the results. How to use it? May you please let me know to use it in this module. So can I just test the application with one image or do I need several angles of the same image? I am really confused as I am very new to this. I would be grateful to you if you could help clear my confusion and I really want to learn and become an expert in it ...(more)