Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 600

Is there something missing in the chain code?

$
0
0
I am not able to read the image and how can i retrieve the xml file and save it? Can someone help.. #include "opencv2/imgproc.hpp" #include "opencv2/highgui.hpp" #include "opencv2/imgproc/imgproc_c.h" #include using namespace std; using namespace cv; int main() { Mat img = imread("Outline.jpg"); //outline of foot imshow("Test", img); vector> contours; findContours(img, contours, RETR_EXTERNAL, CV_CHAIN_CODE); cout << Mat(contours[0]) << endl; findContours(img, contours, RETR_EXTERNAL, CHAIN_APPROX_SIMPLE); cout << "CHAIN_APPROX_SIMPLE" << endl; cout << Mat(contours[0]) << endl; CvChain* chain = 0; CvMemStorage* storage = 0; storage = cvCreateMemStorage(0); cvFindContours(&IplImage(img), storage, (CvSeq**)(&chain), sizeof(*chain), CV_RETR_TREE, CV_CHAIN_CODE); for (; chain != NULL; chain = (CvChain*)chain->h_next) { CvSeqReader reader; int i, total = chain->total; cvStartReadSeq((CvSeq*)chain, &reader, 0); cout<<"--------------------chain\n"; for (i = 0; i

Viewing all articles
Browse latest Browse all 600

Trending Articles