Hello,
Season’s Greetings
First, I realize that I don’t understand this subject as well and therefore I apologize for any obvious faux pas. I am quite new to 3D scanning using structured light and request for assistance in learning this subject.
I have previously been able to use the GrayCodePattern class with a stereo camera and a projector to generate a point cloud. However, I am struggling with doing the same using phase shifted sinusoidal patterns. I know I am tripping since the SinusoidalPattern class does not implement a decode() to create a disparity map and the root cause of the problem is that I don’t understand the theory as well as I should.
I am playing with the data at opencv_extra/testdata/cv/structured_light/data at 4.10.0 · opencv/opencv_extra · GitHub (specifically the files - capture_sin_0.jpg, capture_sin_1.jpg and capture_sin_1.jpg)
I am using Python and am able to create the computePhaseMap and unwrapPhaseMap functions to create the respective phase maps.
When I was using the GrayCodePattern class and stereo 3d scanning, I had used the decode() function to create a disparity map and then generate a point cloud from this. The StructuredLightPattern does not have a decode() function.
I have referred through the following papers :
Cong, Pengyu, et al. “Accurate dynamic 3d sensing with fourier-assisted phase shifting.” IEEE Journal of Selected Topics in Signal Processing 9.3 (2014): 396-408.
APA
Gaur, Pranav Kant, Dinesh Madhukar Sarode, and Surojit Kumar Bose. “Development and accuracy evaluation of Coded Phase-shift 3D scanner.” arXiv preprint arXiv:2110.10520 (2021).
APA
But I know I don’t understand the theory and maths as well as I should and request if someone could help simplify this for me and / or point me to the right resources.
I attempted to use the following formula to get me a disparity map that seems good to me (not sure), however when I attempt to use this to create a
number_patterns = 16
disparity = (unwrapped_phase_map * number_patterns) / (2 * np.pi)
This gives me a disparity map that to me seems reasonable though the resultant point cloud has some issues
a) it has the background (area where the fringe pattern isn’t there) also shows up.
b) the region where the pattern is is showing in a different plane and an angle not sure if that’s to be expected. Am attaching an image of what I am see.
Would sincerely appreciate your help.
Thank you for your time.
Regards,
Jeetu