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);
2 | No.2 Revision |
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);