Page 1 of 1

compare images

PostPosted: Tue Jan 18, 2011 3:34 pm
by nalinwickramatunga
can someone tell me the codes for compare 2 images. actually i want to compare one finger print with many finger print images and want to find matching one.(i am lil new to c# so comment codes as much as(the special key words))

Re: compare inamges

PostPosted: Wed Jan 19, 2011 9:31 pm
by DaleStan
Image processing is not the way to learn C#. Learn C# on something simple.
Also, I strongly recommend investing in a keyboard that can generate capital letters. While it might be possible to write something in C# without such a keyboard, it's going to be difficult at best.

Once you've done that, please tell us your problem. This (with s/Perl/AForge/ as applicable) explains the difference between a problem and a desire. (The latter is also important for us to know, but it is not something we can fix.)

Re: compare inamges

PostPosted: Thu Jan 20, 2011 4:11 pm
by nalinwickramatunga
DaleStan wrote:Image processing is not the way to learn C#. Learn C# on something simple.
Also, I strongly recommend investing in a keyboard that can generate capital letters. While it might be possible to write something in C# without such a keyboard, it's going to be difficult at best.

Once you've done that, please tell us your problem. This (with s/Perl/AForge/ as applicable) explains the difference between a problem and a desire. (The latter is also important for us to know, but it is not something we can fix.)



Ohh thanks!. I can imagine your brain size through this answer.How about you switch to a forum which discuss language matters!. This is not a language class and if you don't know the answer mind your business and let the others answer. I' am not that new to C# by the way

Re: compare images

PostPosted: Thu Jan 20, 2011 7:36 pm
by DaleStan
In simpler terms, we need to know:
1) What you tried,
2) What you expected, and
3) What you got.

If the only thing you've tried so far is "posting in the AForge forums", then we can deal with that. We already know what you got, but we still need to know what you expected. Once we know what you expected, we might be able to come to some sort of arrangement.

If you have tried other things, and you didn't get what you expected there either, then we need to know all three.

Re: compare images

PostPosted: Fri Jan 21, 2011 2:56 pm
by nalinwickramatunga
DaleStan wrote:In simpler terms, we need to know:
1) What you tried,
2) What you expected, and
3) What you got.

If the only thing you've tried so far is "posting in the AForge forums", then we can deal with that. We already know what you got, but we still need to know what you expected. Once we know what you expected, we might be able to come to some sort of arrangement.

If you have tried other things, and you didn't get what you expected there either, then we need to know all three.




Ok . Now we good
here is my coding.
string img1_ref,img2_ref;
img1 = new Bitmap(fname1);
img2 = new Bitmap(fname2);

progressBar1.Maximum = img1.Width;
if (img1.Width == img2.Width && img1.Height == img2.Height)
{

for (int i = 0; i < img1.Width; i++)
{
for (int j = 0; j < img1.Height; j++)
{

img1_ref = img1.GetPixel(i, j).ToString();

img2_ref = img2.GetPixel(i, j).ToString();

if (img1_ref != img2_ref)
{
count2++;
flag = false;
break;

}
count1++;

}
progressBar1.Value++;
}


if (flag == false)
MessageBox.Show("Sorry, Images are not same , " + count2+ " wrong pixels found");
else
MessageBox.Show(" Images are same , " + count1 + " same pixels found and " + count2 + " wrong pixels found");
}

and my problem is ,in here i'm try to compare two finger prints...In practically there some issues such as finger print image differ by the way person place the finger print(different angles ). So i need some thing else that can practically use. Some thing that can identify and compare key points in two finger prints.

Re: compare images

PostPosted: Fri Jan 21, 2011 5:26 pm
by DaleStan
Andrew will complain that you're using GetPixel; it's slower than molasses in January. So don't do that; lock the bits instead.

I'd start by researching feature detection. SURF and SIFT are two such algorithms.
AForge's edge detectors and corner detectors may be helpful, but I suspect that you'll need a full feature detector, which AForge does not currently have.

Re: compare images

PostPosted: Fri Jan 21, 2011 6:00 pm
by andrew.kirillov
DaleStan wrote:Andrew will complain that you're using GetPixel; it's slower than molasses in January.

Yep, I could say something about GetPixel(). But honestly I will not spend any time with the code at all, when I see how two pixels' colors are compared by converting their values to string and then comparing those strings :shock: This already tells a lot and I think it would be waist of time saying anything (the person is "not that new to C# by the way", so does not require comments about GetPixel(), ToString(), etc.)

This reminds me about one code, which was cleaned up during review by one of the fellows I knew. Cannot say the exact programming language at this point, but the idea of the code was:
Code: Select all
bool aBoolVar = ...; // some bool variable we need to check for true/false

if ( aBoolVar.ToString().Length == 5 )
{
     // false
}
else
{
    // true
}


Plus, I really cannot get what is the relation of this topic to IPLab application ... Seem like people ignore reading boards' descriptions.

Re: compare images

PostPosted: Mon Sep 05, 2011 11:30 pm
by screenbrain
andrew.kirillov wrote:
DaleStan wrote:Andrew will complain that you're using GetPixel; it's slower than molasses in January.

Yep, I could say something about GetPixel(). But honestly I will not spend any time with the code at all, when I see how two pixels' colors are compared by converting their values to string and then comparing those strings :shock: This already tells a lot and I think it would be waist of time saying anything (the person is "not that new to C# by the way", so does not require comments about GetPixel(), ToString(), etc.)

This reminds me about one code, which was cleaned up during review by one of the fellows I knew. Cannot say the exact programming language at this point, but the idea of the code was:
Code: Select all
bool aBoolVar = ...; // some bool variable we need to check for true/false

if ( aBoolVar.ToString().Length == 5 )
{
     // false
}
else
{
    // true
}


Plus, I really cannot get what is the relation of this topic to IPLab application ... Seem like people ignore reading boards' descriptions.


Beating myself up trying to figure out which language this is written in. It looks like the same language I am seeing with the information governance software and systems at work, but I just can't get a grip. I guess protecting sensitive business information requires going a little above and beyond. Have you guys heard of any IT staffing agencies or anything talking about information governance? Also, do we know if they use this coding in their database or recommend knowledge of the topic to job seekers?