Search code examples
opencvimage-processing

What is the purpose of winSize and zeroZone in cv::cornerSubPix?


I am not able to understand the parameters : winsize and zeroZone of cv2.cornerSubPix method. What is search window?


Solution

  • This algorithm is used to refine corner coordinates to subpixel accuracy.

    Search window is the area around your initial coordinate that is taken into consideration.

    You can define the size of that window by setting winSize. And you can exclude pixels from calculation by setting the deadZone for some special cases. Then a central part of the searchWindow will be ignored.

    Set 5 to extend the window 5 in every direction around the corner coordinate. So 5 will result in a 11x11 window.