The "CvCaptureCAM_XIMEA::getProperty" method had not the same signature as "CvCapture::getProperty" so it was not called when we use the "VideoCapture::get" method (the "const" specifier was missing).
FlannBasedMatcher::add is overloaded, but the style of parsing the
InputArrayOfArrays does not match the style from
DescriptorMatcher::add. The issue is that InputArrayOfArrays
must be properly marshalled so that the data can be read
correctly. In this case, the method expects the training
descriptors to be either a vector of matrices or a single matrix
(as is shown in DescriptorMatcher::add). These code
replicates that for the case of the FlannBasedMatcher::add.
In fact, a similar commit to this was added by 26d9a7c but was
ultimately not accepted in #4111. This is likely due to the
fact that the input arrays were not parsed properly and the
case of a single matrix was being improperly handled. I believe
this commit to be correct given the logic from
DescriptorMatcher::add.
Without fixes after 68 line (img1_filename = parser.get<std::string>(0);) OpenCV Error:
./stereo_matching im0.png im1.png --max-disparity=16 --blocksize=17
OpenCV Error: Bad argument (undeclared position 0 requested) in getByIndex, file /home/entodi/opencv/modules/core/src/command_line_parser.cpp, line 169
terminate called after throwing an instance of 'cv::Exception'
what(): /home/entodi/opencv/modules/core/src/command_line_parser.cpp:169: error: (-5) undeclared position 0 requested in function getByIndex
When I reconstructed the 3D scene I want to show it as viz::WMesh with an initial value of lighting. For this I disable lighting and shadows:
cv::viz::Viz3d viz_3d_window("3D");
viz_3d_window.setRenderingProperty("mesh", cv::viz::LIGHTING, 0);
Most of the examples show the 3D reconstruction using the point cloud, but using the mesh one part of it creates a shadow on other parts of it if lighting ON.
Using a 3D mesh with disabled lighting gives the most realistic picture of the reconstructed 3D scene.