Hacker News
I Built a Stereo Vision Board for Hardware Hackers
solarSail34
|next
[-]
BobbyTables2
|next
|previous
[-]
How long does it take? Wouldn’t there be a large range of offsets? Or does limiting the minimum distance help mitigate such?
I suppose there could be corner cases in which an object with regular pattern could be misinterpreted as being far away ?
throwaway219450
|root
|parent
[-]
Because stereo disparity (parallax) scales inversely with distance, conveniently you don’t need to search huge ranges. A point at infinity should have zero disparity in a calibrated stereo system. So normally you pick a depth range and search the corresponding pixels. Also if the cameras are calibrated, you only need to search horizontally so it works out to say 64 operations per pixel, which can be vectorized if the CPU supports it. Other approaches use more stable comparisons like census (is each pixel in the match window brighter than the central one) and hamming distance which is also very efficient.
And yes, stereo is sensitive to repeating texture but absence of texture like a blank wall is usually worse.
hex4def6
|root
|parent
|next
[-]
I think he's just running it on the raw unrectified images.
For anyone wanting to play with this, OpenCV has a number of tutorials on this using stuff like stereoBM (which also uses SAD if I'm remembering my algos).
The first step is calibration -- intrinsics (basically figuring out the equations that can cancel out the lens distortion) and extrinsics (how far apart are the two cameras in XYZ, tilt, etc).
globalnode
|root
|parent
[-]
throwaway219450
|root
|parent
|next
[-]
But with a high res sensor, even flex in the PCB will invalidate the calibration. Only takes a few microns for a pixel to be in the wrong place.
choppaface
|root
|parent
|previous
[-]
but if you want to calibrate, try printing out a board https://calib.io/pages/camera-calibration-pattern-generator