You can go through the following class to identify CvSeq points. This method is used to identify points in CvSeq.
for(int i = 0; i < rslt.total(); i++){ CvPoint v=new CvPoint(cvGetSeqElem(rslt, i)); cvDrawCircle(image, v, 5, CvScalar.BLUE, -1, 8, 0); System.out.println(" X value = "+vx()+" ; Y value ="+vy()); }
In the rslt method above is CvSeq, which contains the Contour details and in the cvDrawCircle () method, it will draw a circle at each point with a blue color. and the next line will print the x, y coordinates of each point.
import com.googlecode.javacpp.Loader; import com.googlecode.javacv.CanvasFrame; import static com.googlecode.javacpp.Loader.*; import static com.googlecode.javacv.cpp.opencv_core.*; import static com.googlecode.javacv.cpp.opencv_highgui.*; import static com.googlecode.javacv.cpp.opencv_imgproc.*; public class Test { public static void main(String[] args) { CvMemStorage storage=CvMemStorage.create(); CvSeq squares = new CvContour(); squares = cvCreateSeq(0, sizeof(CvContour.class), sizeof(CvSeq.class), storage); String path="C:/Users/Smash/Desktop/A.PNG"; IplImage src = cvLoadImage(path);
This is the output image.

These are the associated x, y coordinates
X value = 72 ; Y value =61 X value = 72 ; Y value =177 X value = 211 ; Y value =178 X value = 211 ; Y value =380 X value = 315 ; Y value =380 X value = 316 ; Y value =177 X value = 465 ; Y value =177 X value = 465 ; Y value =61
source share