Ask Your Question

Revision history [back]

Processing and comparison of images

Hello! I need to process the second image as the first. Then compare these images along the contours. I only did the processing for the first image (code below). How to process images and to compare them I don't know. Please help!

image description image description

char* filename = argc == 2 ? argv[1] : "Image.jpg";
image = cvLoadImage(filename, 1);
printf("[i] image: %s\n", filename);
assert(image != 0);

gray = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 1);
dst = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 1);

cvNamedWindow("original", CV_WINDOW_AUTOSIZE);
cvNamedWindow("gray", CV_WINDOW_AUTOSIZE);
cvNamedWindow("cvCanny", CV_WINDOW_AUTOSIZE);

cvCvtColor(image, gray, CV_RGB2GRAY);
cvCanny(gray, dst, 10, 100, 3);

cvShowImage("original", image);
cvShowImage("gray", gray);
cvShowImage("cvCanny", dst);

cvWaitKey(0);

cvReleaseImage(&image);
cvReleaseImage(&gray);
cvReleaseImage(&dst);