Search code examples
opencvcamera-calibrationstereo-3d

rectification of the camera is not used for a line of code


I have a doubt about the common code rectification.

sf = 600 / MAX ( imageSize0.width , imageSize0.height )

why 600 ? why not leave it with h = height and w=width

 if (!isVerticalStereo) {
    sf = 600./MAX(imageSize0.width, imageSize0.height);
    w = cvRound(imageSize0.width*sf);
    h = cvRound(imageSize0.height*sf);
    canvas.create(h, w*2, CV_8UC3);
}
else {
    sf= 300./MAX(imageSize0.width, imageSize0.height);
    w = cvRound(imageSize0.width*sf);
    h = cvRound(imageSize0.height*sf);
    canvas.create(h*2, w, CV_8UC3);

Solution

  • The purpose of this code as I understanded is to make sure that the the longest side of the image will not exceed 600 in some case and 300 in other case. It also keeps the ration as it is. I personally use this pattern when I want to make sure the process time will not exceed a certain amount. However, I am not sure if it a best practise in computer vision.