Click here to Skip to main content
12,751,232 members (34,222 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# Emgu-CV
this is my first question on CodeProject. actually, i dont post any question on any website but this time, i get STUCK !!

the IDEA...
i am working on a project based on image processing.
simply, i want to compare my new image with other images in my database to find the most similar images.

i am using (SURF) in (EMGU) warping library of OpenCV using this code:

// convert images to Gray images for the SURF

Image imgg1 = Image.FromFile("input_1.png");
Image<Gray, Byte> g_image_1 = new Image<Gray, byte>((Bitmap)imgg1);
Image imgg2 = Image.FromFile("input_0.png");
Image<Gray, Byte> g_image_2 = new Image<Gray, byte>((Bitmap)imgg2);

// prepare detection parameter 

MCvSURFParams image_param = new MCvSURFParams(300, false);
SURFDetector detect1 = new SURFDetector(image_param);

ImageFeature<float>[] image_feacher_1 = detect1.DetectFeatures(g_image_1, null);
ImageFeature<float>[] image_feacher_2 = detect1.DetectFeatures(g_image_2, null);

Features2DTracker<float> traker = new Features2DTracker<float>(image_feacher_1);
Features2DTracker<float>.MatchedImageFeature[] matching = traker.MatchFeature(image_feacher_2, 2);

matching = Features2DTracker<float>.VoteForUniqueness(matching ,0.8);

matching = Features2DTracker<float>.VoteForSizeAndOrientation(matching , 1.5, 20);

Image<Gray, Byte> res = g_image_1.ConcateVertical(g_image_2);

// drow matching lines
foreach (Features2DTracker<float>.MatchedImageFeature matchedFeature in matching )
                PointF p = matchedFeature.ObservedFeature.KeyPoint.Point;

                p.Y += g_image_1.Height;

                res.Draw(new mLineSegment2DF(matchedFeature.SimilarFeatures[0].Feature.KeyPoint.Point, p), new Gray(0), 1);

// showing the result image
ImageViewer Imagee = new ImageViewer(res);

after this...
the result for images will be as matched points from both of the images...
and from 4570 point from image 1 and 4700 from image 2....
it matched 400 point and that.

i am looking around to find the percentage of similarity between these images
but i can find it... i found something similar to my question...[^]

but it is in C++ and the code hard to convert !!!

any help please !!!!!?!?!?
Posted 16-Sep-12 12:20pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170215.1 | Last Updated 16 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100