c++opencvimage-processingcomputer-visiongray-code

Opencv Decode Gray code pattern tutorial 3D scanner Problems


I used a ready-made tutorial code from the opencv library in C ++, the link is as follows:

https://docs.opencv.org/3.4/dc/da9/tutorial_decode_graycode_pattern.html

This is the title of this code (Decode Gray code pattern tutorial) The job of this code is to take photos as a pattern and then read the calibration values ​​from the yaml file and display the photos in the form of points cloud in the 3D scan output. I used his default photos. Also from his yaml files, all of which are at the following address.

https://github.com/opencv/opencv_extra/tree/4.x/testdata/cv/structured_light/data

The code is compiled correctly, but the problem is that in the example above it is not written what arguments to give to achieve the desired result. Displays its code output as follows:

enter image description here

But the code I get is as follows:

enter image description here

The values ​​that I give the program as an argument are as follows: ./main images.yml calibrationParameters.yml 3 3 0 0

Please help me to execute the code correctly and bring it to the highest display quality. Can you suggest where exactly I look at the code?


Solution

  • The correct parameters passed to the program should be

    ./main images.yml calibrationParameters.yml 1280 800
    

    The parameters 1280 and 800 represent projector's width and height

    I found this information in the author's github repo, you can find it here

    I compile the code in the tutorial and use the parameter above, works great (OpenCV version: 4.5.5)