IS the disparity can be decimal?

Hi, i understand disparity map gives you the difference between the position of pixels between left image and right image.

In opencv, to get the real disparity value, it need to convertto depthtype32F by dividing it with 16.0F, which means the disparity value will be consisting decimal points, is it normal to have decimal points?

yes, that algorithm produces fractional values. it gives four bits of subpixel precision. divide the disparity map by 16 to get pixel units.

Ah noted! Thanks!!

Allow me to further the question, If my object is flat surface, doesnt it means the object will have same disparity value all over its surface, but when i mouse over and show the disparity and distance, it might vary ranging 0-2mm

disparity is in pixels. you’ll need to call another function to turn that into metric coordinates in space.

if it varies, perhaps your flat surface wasn’t perfectly aligned to the camera. or a bunch of other reasons.

no point in speculating. you gotta post code and data that can be discussed.