Ask Your Question
0

Processing and comparison of images

asked 2016-04-07 06:19:11 -0600

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);
edit retag flag offensive close merge delete

Comments

1

please use c++ (cv::Mat), not the legacy c-api.

berak gravatar imageberak ( 2016-04-07 06:25:09 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-04-07 06:53:41 -0600

kbarni gravatar image

I don't really understand the question, but it seems that you want to eliminate the fine vertical white lines to be able to compare the contours.

You might try a 3x3 median filter to eliminate them (medianblur(gray,filtered,3)) It will delete at least the vertical lines.

Another solution would be to filter out some strong components from the fourier fransform of the image.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-04-07 06:19:11 -0600

Seen: 131 times

Last updated: Apr 07 '16