I am working on C++ openCv, were I want to detect the contours and defects and hull of human hand. I get something wrong when I convert from CvSeq to CvPoint, it always prints out the address's not the value of the sequence itself, and it doesn't accept *(Defects[2].x). So, I want to print the values to know if am right or wrong and how to access them later ? please, thanks in advance.
0
votes
The Code:For example: CvSeq* CloneContour7=defects; CvPoint* Defects = new CvPoint[CloneContour7-> total]; cout << "The Defects"; for( int i=1; i<=CloneContour7-> total; i++ ) { CvPoint* p= CV_GET_SEQ_ELEM( CvPoint, CloneContour7, i ); Defects[i] = p; } cout << '\n'; cout << CloneContour7-> total; cout << Defects[2].x; cout << '\n'; cout << Defects[2].x; cout << '\n'; Also to int: CvSeq* CloneContour8=hull; int* H = new int[CloneContour8-> total]; for( int i=1; i<=CloneContour8-> total; i++ ) { int* x= CV_GET_SEQ_ELEM( int, CloneContour8, i ); H[i] = *x; }
- shereen