![]() ![]() I was trying to come up with a closed form equation to calculate required baseline given some Z resolution at some Z distance but don't have the concentration right now. It will spend a lot of work testing for block matches closeby, and very little time testing far matches. The block matcher's work is measured in disparity, not distance. That is a factor of 400 in the Z resolution, for a factor of 20 in your Z range (10 to 0.5 meters).ĭisparity around the near end of your range will get quite large, and insanely finely resolved. So you're getting an ~83.8 mm step near 10 meters distance, and a ~0.21mm step near 0.5m. baseline = 80e-3 # 80 mmĭisps = np.arange(0, 150, 1/16) # evaluating disparity of 0 to 150 pixels The map may contain negative values, which signify "can't find a block match". ![]() If you start with a depth range and a minimum resolution, you can calculate backwards to arrive at a required baseline.Īlso be sure you're passing the two pictures in the right order, or else you'll get "noise".Īlways visualize the disparity map values. This will also tell you the (maximum) disparity for the nearest edge of your working range. Then you can consider if that resolution is sufficient within the working range you consider. When you plot the distance for every possible disparity value from 0 to whatever maximum ( np.arange), you get the "steps" in your depth map. For StereoSGBM, you have mindisp and numdisp, right? then maxdisp = mindisp + numdisp. It's either mentioned somewhere in the docs or you'll have to discover this factor from example code or the source of the actual algorithm. If the algorithm gives you a disparity value of 16, that means 1.0 pixels of disparity. Subpixel accuracy comes from block matching, where the block matching is an implicit lowpass (smoothing) that buys you the subpixel accuracy.įor StereoSGBM, you can assume 1/16 subpixel resolution (i.e. It becomes large for near points.įor your estimation, you only need to know if your disparity is estimated in whole pixels or with any subpixel precision. For points at infinity, it's supposed to be 0. For determining a good baseline given performance requirements, see below.ĭisparity, unit "pixels", maybe a real number, is a per-pixel value that's coming out of block matching or other calculations. Grab a ruler and eyeball it or browse the specs of your stereo rig. I’m asking this because I can’t find related materials ☹īaseline: the physical distance between those "eyes". Is the disparity in equation 1 determined by the numDisparity that goes into the parameters of the stereoSGBM function? To generate a depth map from images taken by two cameras, I’m using the python opencv stereoSGBM algorithm. How should I determine the baseline and disparity to make a stereo depth camera that operates in the range of 0.5m~10m?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |