尝试使用opencv / c ++访问检测到的对象值时出现未处理的异常错误

时间:2013-12-05 14:10:43

标签: c++ opencv

我希望能够访问检测到的对象中的所有值。这是我到目前为止所做的事情..

int width;
int height;
cv::Mat dis = Mat(width, height, CV_8UC1,Dis);
cv::Mat cannyEdge(dis.rows, dis.cols, CV_32FC1);
GaussianBlur( dis, dis, Size(3, 3), 2, 2 );
Canny( dis, cannyEdge , 100 , 100 * 3, 3);
imshow("canny_edge",cannyEdge);
}
findContours(cannyEdge, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);

Mat raw_dist( dis.size(), CV_32FC1 );

    for( int j = 0; j < dis.rows; j++ ){
         for( int i = 0; i < dis.cols; i++ ){ 
             raw_dist.at<float>(j,i) = pointPolygonTest( contours[0], Point2f(i,j), true );
         }
    }

我在此行中收到未处理的异常错误:

 raw_dist.at<float>(j,i) = pointPolygonTest( contours[0], Point2f(i,j), true );

有谁知道这是什么问题?

0 个答案:

没有答案