Hello,
I have followed the suggestion given by @berak of not using the test data in opencv_extra and instead have collected images with sinusoidal patterns. I want to use the FAPS algorithm and therefore have the markers in my pattern - I need to validate if these markers are actually being projected out - can’t see them very easily in my image. I have attached the output I am receiving upto the unwrapping.
I expected a smoother gradient so to me this doesn’t look good, but I don’t know enough to know if this is what I should expect? Is this what one would expect? If not any idea of what’s going wrong. How can I improve upon this?
The snippet of code I used to I am using is :
# create object of SinusoidalPattern class
params = cv2.structured_light_SinusoidalPattern_Params()
params.methodId = cv2.structured_light.FAPS
sinusFaps = cv2.structured_light_SinusoidalPattern.create(params)
# load images with sinusoidal patterns
captures = []
captures.append(cv2.imread(os.path.join(img_dir,"0.png"),cv2.IMREAD_GRAYSCALE))
captures.append(cv2.imread(os.path.join(img_dir,"1.png"),cv2.IMREAD_GRAYSCALE))
captures.append(cv2.imread(os.path.join(img_dir,"2.png"),cv2.IMREAD_GRAYSCALE))
_, shadow_mask = cv2.threshold(captures[0], 50, 255, cv2.THRESH_BINARY)
wrapped_phase_map = np.zeros_like(captures[0],dtype=np.float32)
unwrapped_phase_map = np.zeros_like(captures[0],dtype=np.float32)
sinusFaps.computePhaseMap(captures,wrapped_phase_map, shadow_mask)
sinusFaps.unwrapPhaseMap(wrapped_phase_map,img_size,unwrapped_phase_map,shadow_mask)
I also want to ask if the sinusoidal phase shift algorithms and FAPS are what I would use in production for generating real time point clouds?
My research application is an intraoral dental scanner - therefore it would be a wand that goes in the mouth and the clinician would move it around and ideally as its being moved around point clouds are generated in real time and 3D stitching / reconstruction is happening in real time. I have tried graycode patterns and the result is good but am now attempting to reduce the scan time by reducing the number of patterns. Any thoughts would be appreciated.
I am horribly out of depth here and would seriously appreciate help on both the code above and also if I am using the correct algorithm / approach (phase shifting with FAPS) for this purpose or if there is a better approach