Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

something weird about `findChessboardCorners()`

these days I was re-writing my opencv code on qt framework. the code runs well on the virtual studio 2013, but when I run it on the qt, something weird happened. the code is as follow

cv::Mat view, viewGray;
for(int i = 0; i < nImages; i++)
{
    vector<cv::Point2f> pointBuf;
    int q = pointBuf.size();
    view = cv::imread(fileList.at(i).toStdString(), 1);
    cv::cvtColor(view, viewGray, cv::COLOR_BGR2GRAY);
    bool found = cv::findChessboardCorners(view, boardSize, pointBuf, \
                                           CV_CALIB_CB_ADAPTIVE_THRESH | \
                                           CV_CALIB_CB_FAST_CHECK | \
                                           CV_CALIB_CB_NORMALIZE_IMAGE);
    int p =  pointBuf.size();

    if(found)
    {
        cv::cornerSubPix(viewGray, pointBuf, cv::Size(11, 11), cv::Size(-1, -1), \
                         cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
        imagePoints.push_back(pointBuf);
    }
}

I set two variables p and q to see the size change of pointBuf. which I get q = 0, q = -10728254, but with the findChessboardCorners() return value is true.

my debegger infomation is as follow,

image description

and the image for calibration is as follow,

image description

something weird about `findChessboardCorners()`

these days I was re-writing my opencv code on qt framework. the code runs well on the virtual studio 2013, but when I run it on the qt, something weird happened. the code is as follow

cv::Mat view, viewGray;
for(int i = 0; i < nImages; i++)
{
    vector<cv::Point2f> pointBuf;
    int q = pointBuf.size();
    view = cv::imread(fileList.at(i).toStdString(), 1);
    cv::cvtColor(view, viewGray, cv::COLOR_BGR2GRAY);
    bool found = cv::findChessboardCorners(view, boardSize, pointBuf, \
                                           CV_CALIB_CB_ADAPTIVE_THRESH | \
                                           CV_CALIB_CB_FAST_CHECK | \
                                           CV_CALIB_CB_NORMALIZE_IMAGE);
    int p =  pointBuf.size();

    if(found)
    {
        cv::cornerSubPix(viewGray, pointBuf, cv::Size(11, 11), cv::Size(-1, -1), \
                         cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
        imagePoints.push_back(pointBuf);
    }
}

I set two variables p and q to see the size change of pointBuf. which I get q = 0, q p = -10728254, but with the findChessboardCorners() return value is true.

my debegger infomation is as follow,

image description

and the image for calibration is as follow,

image description

something weird about `findChessboardCorners()`

these days I was re-writing my opencv code on qt framework. the code runs well on the virtual studio 2013, but when I run it on the qt, something weird happened. the code is as follow

cv::Mat view, viewGray;
for(int i = 0; i < nImages; i++)
{
    vector<cv::Point2f> pointBuf;
    int q = pointBuf.size();
    view = cv::imread(fileList.at(i).toStdString(), 1);
    cv::cvtColor(view, viewGray, cv::COLOR_BGR2GRAY);
    bool found = cv::findChessboardCorners(view, boardSize, pointBuf, \
                                           CV_CALIB_CB_ADAPTIVE_THRESH | \
                                           CV_CALIB_CB_FAST_CHECK | \
                                           CV_CALIB_CB_NORMALIZE_IMAGE);
    int p =  pointBuf.size();

    if(found)
    {
        cv::cornerSubPix(viewGray, pointBuf, cv::Size(11, 11), cv::Size(-1, -1), \
                         cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
        imagePoints.push_back(pointBuf);
    }
}

I set two variables p and q to see the size change of pointBuf. which I get q = 0, p = -10728254, but with the findChessboardCorners() return value is true.

my debegger infomation is as follow,

image description

and the image for calibration is as follow,

image description

update: I set the debugger point at imagePoints.push_back(pointBuf); , as you can see in the following picture.

image description