Display the coordinates of a point in OpenCV C + + urgently

asked 2014-02-16 11:59:33 -0500

zowpro gravatar image

updated 2014-02-16 13:43:24 -0500

berak gravatar image

Hi, I am trying to complete a project in C + + using the OpenCV library and I have a problem with the display of coordinates of points that are stored in a table "pt" knowing that the table is not empty, here or a piece of code is the error:

CvPoint *pt[result->total];

        for(int i=0;i<result->total;i++){
            pt[i] = (CvPoint*)cvGetSeqElem(result, i);
            cvDrawCircle( img, *pt[i] , 4, cvScalarAll(200) );
           CvPoint x;
                    x=cvPoint(i,i);
        printf("%d \n",pt[i]);
        }

## Thanks :)

edit retag flag offensive close merge delete

Comments

2

Since pt[i] is a pointer, it should be printf("%d \n",pt[i]->x); or printf("%d \n",pt[i]->y); if you wish to print the coordinates.

tuannhtn gravatar imagetuannhtn ( 2014-02-16 13:56:35 -0500 )edit

Thanks :)

zowpro gravatar imagezowpro ( 2014-03-08 10:02:51 -0500 )edit