Image Recognition : General Questions

Image Recognition

Ask general questions here.

Image Recognition

Postby Praveen597 » Fri Jan 06, 2012 9: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
Praveen597
 
Posts: 24
Joined: Sat Aug 27, 2011 10:41 am

Re: Image Recognition

Postby Support Team » Mon Jan 09, 2012 6: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Image Recognition

Postby Praveen597 » Tue Jan 10, 2012 7:52 am

I have changed the color of the entire image. Right ? Then, how can the image equal to 10% similarity..?
Praveen597
 
Posts: 24
Joined: Sat Aug 27, 2011 10:41 am

Re: Image Recognition

Postby Praveen597 » Tue Jan 10, 2012 8:27 am

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

Please help me out.
Praveen597
 
Posts: 24
Joined: Sat Aug 27, 2011 10:41 am

Re: Image Recognition

Postby Support Team » Tue Jan 10, 2012 3: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to General Questions

Who is online

Users browsing this forum: No registered users and 0 guests

cron