1
$\begingroup$

I am trying to set up my stereo vision system on a car. However, I meet several problems and do not know how to solve them.

  1. How to select the baseline? I want the distance measurement to be far at 30 or 50 meters and near at around 5-10m. Is it possible to choose a baseline that meets my requirement?

  2. I have tried stereo calibration of two cameras and also learned how to compute depth value from disparity map. However I don't know how to compute depth value if the focal lengths of the two cameras are different. It seems all the theorems I can find on the Web only concern cameras of the same focal length.

$\endgroup$
1
$\begingroup$

Why would you use two cameras of different focal lengths? that is just asking for trouble and will add so many issues and much unneeded complexity to the calculation of the depth map. Selecting a baseline set up a relationship between the size of the detected object in pixels and the distance of that object, you want to ensure when you detect the image that there is at least a couple of pixels of separation between the pairs (I shoot for greater than 10) as a rule of thumb I use 1:50 - 1:150 ratio for the ratio between the camera separation to the detection distance for basketball sized objects, but this will vary wildly depending on the cameras and the resolution.

$\endgroup$
1
$\begingroup$

1.

The baseline you want is going to depend on the resolution you want to process the images at. The minimum range is determined by two things. First, both cameras have to able to see the object of interest. Second, there is typically a minimum range due to the processing. Most stereo algorithms have a maximum disparity that they will search up to. Since disparity is proportional to inverse distance, a larger maximum disparity gives you a closer minimum range. Since the maximum disparity is a pixel amount, you can decrease your minimum range by reducing resolution at the cost of accuracy and resolution. It will also depend on the field of view of your cameras. You can calculate the minimum range by calculating the ray through f_1(x,y) and the ray through f_2(x+d,y) where f_1 projects a ray through point (x,y) in camera 1 and f_2(u,v) projects a ray through point (u,v) in camera 2 and d is the maximum disparity. You can usually choose the maximum disparity to search, but it often results in a narrower field of view and usually the computation increases linearly with maximum disparity.

Maximum range is ill-defined. A range of infinity corresponds to a disparity of 0. The disparity is proportional to 1/distance so farther distance provides less range accuracy. You can never be out of range though. If you pick a minimal range accuracy, then you could calculate a maximum range. Typically, a stereo algorithm will achieve disparity accuracy of around 0.25 pixels.

2.

For stereo, usually the images are dewarped to correct for lens distortion. In addition, one camera is warped to be aligned with the other camera such that the axis of the cameras are pointing in the same direction and the camera position differs only in x. During this process, any differences between the focal lengths of the cameras are also corrected such that the dewarped images have the same effective focal length.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.