A contour is a lot of points. For example, in C ++ (everything looks similar in java and python) Contours are stored in vectors:
vector<vector<cv::Point>>
So, for example, if you find the contours this way:
vector<vector<cv::Point>> contours1; cv::findContours( input_img, contours1, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE );
you can get inside each point of the contour. This is an example code that displays the points of a particular contour.
cv::Mat draw = cv::Mat::zeros( 500,500, CV_8UC3 ); int contour_id = 1; for(int i = 0; i< contour[contour_id].size(); i++) { cout << contour[contour_id][i] << endl;
// Now draw each point in the form of a circle with a radius = 1
cv::circle(draw,contour[contour_id][i],1,cv::Scalar(0,0,255)); }
considers
source share