findChessboardCorners gives unexpected results
<p>Here is my code</p>

<pre><code>#include &lt;opencv/cv.h&gt; 
#include &lt;opencv/highgui.h&gt;
#include&lt;opencv2/opencv.hpp&gt;

#include&lt;iostream&gt;
//#include&lt;vector&gt;

using namespace cv;
using namespace std;

int main()
{
    VideoCapture cap = VideoCapture(0);
    int successes = 0;

    int numBoards = 0;
    int numCornersHor = 6;
    int numCornersVer = 4;

    int numSquares = (numCornersHor - 1) * (numCornersVer - 1);
    Size board_sz = Size(numCornersHor, numCornersVer);



    vector&lt;Point2f&gt; corners;


    for (;;)
    {
        Mat img;
        cap &gt;&gt; img;
        Mat gray;
        cvtColor(img, gray, CV_RGB2GRAY);
        if (img.empty()) break; // end of video stream
        imshow("this is you, smile! :)", gray);
        if (waitKey(1) == 27) break; // stop capturing by pressing ESC 


    bool found = findChessboardCorners(gray, board_sz, corners, CALIB_CB_ADAPTIVE_THRESH);
    if (found == 1)
    {
        cout &lt;&lt; corners.size()&lt;&lt;"\n";

        cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1), TermCriteria(CV_TERMCRIT_EPS | CV_TERMCRIT_ITER, 30, 0.1));
        drawChessboardCorners(gray, board_sz, corners, found);
    }

    }

    cap.release();
        waitKey();
        return 0;
    }
</code></pre>

<p>The code is capturing frames from a webcam. If a chessboard is detected, the total number of found corners is printed out (I did it because I was not getting the same output as in the tutorial code and I wanted to find where the bug is).</p>

<p>The output:</p>

<p><a href="https://i.stack.imgur.com/S1ewO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S1ewO.png" alt=""></a></p>