MISS3D / s2p

This repository is not maintained, please use https://github.com/centreborelli/s2p instead.
GNU Affero General Public License v3.0
144 stars 77 forks source link

incorrect disparity range manipulation #188

Open gfacciol opened 5 years ago

gfacciol commented 5 years ago

This line (and surrounding code) is in charge of extending the disparity range for the stereo matching: https://github.com/MISS3D/s2p/blob/942de31bd4234f344bb9fe068cffac14652471a6/s2plib/rectification.py#L194

But these manipulations are incorrect. If disp_min=0 to begin with, then no multiplication will ever increase the disparity range. The correct way to increase the disparity range is with:

dmin-= (dmax-dmin)* cfg['disp_range_extra_margin'])
dmax+= (dmax-dmin)* cfg['disp_range_extra_margin'])