Image Recognition

Ask general questions here.
Praveen597
Posts: 27
Joined: Sat Aug 27, 2011 9:41 am

Image Recognition

Post by Praveen597 » Fri Jan 06, 2012 8:01 am

Hi all,
I am finding difficult to use Ranorex to recognize the color combination.

I have two similar images in which only the color differs from each other.
For eg, one is a colored pic where as other one is black and white pic, now when comparing these two images the ranorex is showing boolean value true even though the colors are different.

Here is my code:

//Capture Image(Colored Image)
Bitmap rightImage= repo.WebDocument.RightSideContainerLayoutRegion.CaptureCompressedImage();

//Here, the right side container layout is changed to another other image( with black and white)

if(Validate.CompareImage(repo.WebDocument.RightSideContainerLayoutRegionInfo,rightImage,new Imaging.FindOptions(0.10), "", false))
{
Report.Success("Image changed successfully");
Report.Screenshot();
}
else
{
Report.Failure("Image not changed");
}


Can some one help me...??

Thanks,
Praveen

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Image Recognition

Post by Support Team » Mon Jan 09, 2012 5:23 pm

Please, have a look at the documentation of the FindOptions class:
http://www.ranorex.com/Documentation/Ra ... ptions.htm

Your code is comparing the two images using a similarity value of only 10%. Consequently, the CompareImage method will return true even if the two images have only 10% similarity or more.

Regards,
Alex
Ranorex Team

Praveen597
Posts: 27
Joined: Sat Aug 27, 2011 9:41 am

Re: Image Recognition

Post by Praveen597 » Tue Jan 10, 2012 6:52 am

I have changed the color of the entire image. Right ? Then, how can the image equal to 10% similarity..?

Praveen597
Posts: 27
Joined: Sat Aug 27, 2011 9:41 am

Re: Image Recognition

Post by Praveen597 » Tue Jan 10, 2012 7:27 am

Even I have tried with 100% similarity but haven't found any progress.

Please help me out.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Image Recognition

Post by Support Team » Tue Jan 10, 2012 2:23 pm

Hi,

Please determine the similarity factor of your images with:
double similarity = Imaging.Compare(Bitmap yourBitMap1, Bitmap yourBitmap2)
, is it 100%?
If it is 100% it seems that you are taking the wrong images, to proof this please save the two used images to the hdd like:
Bitmap test = Imaging.CaptureImage(formCalculator);
test.Save("C:/test.bmp");
Are they equal?

Regards,
Markus
Ranorex Support Team