Ask Your Question

zowpro's profile - activity

2015-06-06 00:36:14 -0600 received badge  Student (source)
2014-03-15 04:05:03 -0600 commented question The function which returns the angle of curvature of the object Opencv C++

The object or the image has the same size and for the detection, i used findcontours() and ApproxpolyDP to find the contours points and i got the gravity center

2014-03-13 11:36:15 -0600 asked a question The function which returns the angle of curvature of the object Opencv C++

Hello, i'm searching a function in Opencv which returns the angle of a specific object on image from its contour points or points of its related envelope. Exemple: !image description

2014-03-12 10:42:57 -0600 commented question the application has requested the runtime to terminate it in an unusual way qt c++

Thanks guys, i resolved my problem

2014-03-11 10:16:20 -0600 asked a question Assigning coordinates of a point to another OpenCV C + +

Hi,I did the translation of contour points (about 300-1000 points) i.e. each point I changed its X and Y coordinates to move the center of vector XOY to the center of gravity with this formula:

vector<vector<Point> > contours_poly( contours.size() ); 
vector<vector<Point> > contours( contours.size() ); 
for(unsigned int i=0;i<contours.size();i++)
{
approxPolyDP( Mat(contours[i]), contours_poly[i], 2, true );
convexHull( Mat(contours[i]), hull[i], false );
}



/// centre de gravité

vector<Moments> mu(contours.size() );
for( int i = 0; i < contours.size(); i++ ){

  mu[i] = moments( contours[i], false );
}

vector<Point2f> mc( contours.size() );
for( int i = 0; i < contours.size(); i++ ){
mc[i] = Point2f( mu[i].m10/mu[i].m00 , mu[i].m01/mu[i].m00 );

}
 /// Translation*          the program bug here !!
for(i=0; i < contours.size(); i++)
{ contours_poly[1][i].x -= mc[1].x;
 contours_poly[1][i].y -= mc[1].y;
} 

/// draw the new contour
for(unsigned int i=0;i<contours.size();i++)
{

drawContours( drawing, contours_poly, i, colors, 1, 8, vector<Vec4i>(), 0, Point() );
}

But I do not know if the bug is generated by the modification of a large number of points or the formula is false because here is the result: the application has requested the Runtime to terminate it in an unusual way.

Thanks

2014-03-10 16:07:25 -0600 answered a question the application has requested the runtime to terminate it in an unusual way qt c++

I did the translation of contour points (about 300-1000 poitns) ie each point I changed its X and Y coordinates to move the vector XOY center of gravity with this formula: for(i=1;i<contours.size();i++) { contours_poly[0][i].x=contours_poly[0][i]..x-mc[1].x; contours_poly[0][i].y=contours_poly[0][i]..y-mc[1].y; contours_poly[1][i].x=contours_poly[1][i]x-mc[1].x; contours_poly[1][i].y=contours_poly[1][i].y-mc[1].y; } // mc[1].x and mc[1].y are the coordinate of center of gravity

But I do not know if the bug is generated by the modification of a large number of points or what is the formula that is false. thank you

2014-03-08 10:08:11 -0600 received badge  Editor (source)
2014-03-08 10:07:48 -0600 asked a question the application has requested the runtime to terminate it in an unusual way qt c++

Hello,

What does it mean that you display this message "the application has requested the runtime to terminate it in an unusual way" after inserting a correct program in Qt creator C + +. image description Thanks

EDIT 1:

I did the translation of contour points (about 300-1000 poitns) ie each point I changed its X and Y coordinates to move the vector XOY center of gravity with this formula:

for(i=1;i<contours.size();i++){ 
   contours_poly[0][i].x = contours_poly[0][i]..x-mc[1].x; 
   contours_poly[0][i].y = contours_poly[0][i]..y-mc[1].y; 
   contours_poly[1][i].x = contours_poly[1][i]x-mc[1].x; 
   contours_poly[1][i].y = contours_poly[1][i].y-mc[1].y; 
} // mc[1].x and mc[1].y are the coordinate of center of gravity

But I do not know if the bug is generated by the modification of a large number of points or what is the formula that is false. thank you

2014-03-06 04:39:36 -0600 commented question Extract the coordinates of a point OpenCV C + +

Thanks a lot :D

2014-03-06 03:25:53 -0600 commented question Extract the coordinates of a point OpenCV C + +

I can't extract the coordinates of a specific point(the X and the Y) of my vector "contours_poly"

2014-03-06 02:45:54 -0600 asked a question Extract the coordinates of a point OpenCV C + +

Hello,

I want to extract a specific point in vector

vector <vector <Point>> contours_poly (contours.size ());

but I could not extract its coordinates (X and Y) because I used matrices. Here is my code:

 vector<vector<Point> > contours;
 vector<vector<Point> > contours_poly( contours.size() );
 for(size_t i = 0; i < contours.size(); i++ )
 {
      approxPolyDP( Mat(contours[i]), contours_poly[i], 2, true ); 
 }

Merci.

2014-02-22 09:29:59 -0600 commented answer Extracting an image portion opencv C + +

Ok, I mean surface area of the contour

2014-02-22 05:43:14 -0600 answered a question Extracting an image portion opencv C + +

Thanks but i want calculate the surface inside the contour. I used findcontour and convexhull with a matrices.

2014-02-18 06:10:59 -0600 asked a question Extracting an image portion opencv C + +

Hello, I am trying to create a project that extract parts of an image, knowing that I have determined the contour points and I determined points related envelope and now I want to calculate the surface of the parties are between the edge points and the points of the envelope.

Here is an example:image description

I found on the net a function that retrieves rectangles cvSetImageROI but the problem parts that I want to extract have different shapes. In short, help me!

2014-02-16 11:59:33 -0600 asked a question Display the coordinates of a point in OpenCV C + + urgently

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 :)