I want to reconstruct missing values in a floating point matrix in OpenCV. The Mat contains floating values with minimum value 0. I tried this :
Convert floating point Mat to CV_8U . The CV_8U image when displayed (points with 0 in floating Mat appear as black):
Generate a mask by checking 4-neighborhood for atleast one non zero pixel with current pixel being zero. Mask depicts pixels to be reconstructed(255-missing pixels and 0-otherwise) The mask is :
- Used inpaint function with image obtained in step 1 and mask from step 2. The inpainted result :
Now I have pixel values at missing locations(above image) but this inpaint cannot be directly applied to floating point Mat. It accepts only 8-bit 1-channel or 3-channel image. How can I reconstruct/obtain missing values in the floating point Mat ?