Comparing 2 Images using Confidence

Discussions about machine vision support in GdPicture.
Post Reply
super22
Posts: 3
Joined: Sun Sep 27, 2009 1:53 am

Comparing 2 Images using Confidence

Post by super22 » Sun Sep 27, 2009 2:15 am

Hi There,

I am wanting to compare different quality/compression levels of images however the ADRGetLastConfidence always returns the same value: 40. regardless of whether I compare the original image to a high quality format or a low quality format. You can visually see the difference in images attached.

I have based the code on this example - viewtopic.php?t=1450#4728

Code: Select all

        Dim oGdPictureImaging As New GdPicture.GdPictureImaging
        Dim Confidence As Double

        oGdPictureImaging.SetLicenseNumber("XXXX") 'Replace with your own license key
        Dim ImageID1 As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("orig.jpg")
        Dim ImageID2 As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("low.jpg") 'comment to test high quality image
        'Dim ImageID2 As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("high.jpg") 'uncomment to test high quality image

        Dim TemplateID As Integer = oGdPictureImaging.ADRCreateTemplateFromGdPictureImage(ImageID1)
        oGdPictureImaging.ReleaseGdPictureImage(ImageID1)
        oGdPictureImaging.ADRGetCloserTemplateForGdPictureImage(ImageID2)
        oGdPictureImaging.ReleaseGdPictureImage(ImageID2)
        Confidence = oGdPictureImaging.ADRGetLastConfidence()
        oGdPictureImaging.ADRDeleteTemplate(TemplateID)

        MsgBox("The two image are the same at: " & Str(Confidence) & "%")
1) Why is the confidence level so low?

2) Why is the confidence level not changing when I compare different compressed files?

Hope you can help!
Attachments
low.jpg
low.jpg (2.83 KiB) Viewed 9144 times
high.jpg
high.jpg (7.26 KiB) Viewed 9144 times
orig.jpg
orig.jpg (51.15 KiB) Viewed 9144 times

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Comparing 2 Images using Confidence

Post by Loïc » Sun Sep 27, 2009 12:27 pm

Hi Super22,

Your image is a quite special... However, I implemented a patch to the ADR engine to process it correctly.

Please, wait for the next release (next Monday) to get the problem fixed.

With best regards,

Loïc

super22
Posts: 3
Joined: Sun Sep 27, 2009 1:53 am

Re: Comparing 2 Images using Confidence

Post by super22 » Sun Sep 27, 2009 1:15 pm

Thanks Loïc for your quick response, I look forward to the next release!

I'm interested in what makes the image special. Are you able to share any more information?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Comparing 2 Images using Confidence

Post by Loïc » Sun Sep 27, 2009 9:35 pm

You are welcome !

Your image is very bright, so thresholding (for content analys) were resulting in a fully blank image...

But now it is ok :mrgreen:

Loïc

super22
Posts: 3
Joined: Sun Sep 27, 2009 1:53 am

Re: Comparing 2 Images using Confidence

Post by super22 » Mon Oct 05, 2009 4:24 am

I just tested the Latest version (October 2, 2009) and the issue is resolved.

Thanks Loïc!

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Comparing 2 Images using Confidence

Post by Loïc » Mon Oct 05, 2009 11:32 am

Thank you for the feedback !

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest