Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ok, you simply need to swap the x and y while accessing your image. Points are x(cols) and y(row), but in the Mat container you have (Row, col).

cv::Point3_ <uchar>* p = frame.ptr<cv::Point3_ <uchar> >(contours[cnum][cpos].y, contours[cnum][cpos].x);

ok, you simply need to swap the x and y while accessing your image. Points are x(cols) have x(col) and y(row), but in the Mat container you have (Row, col).(Rows, cols).

cv::Point3_ <uchar>* p = frame.ptr<cv::Point3_ <uchar> >(contours[cnum][cpos].y, contours[cnum][cpos].x);