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
Image Recognition
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Image Recognition
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
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
-
- Posts: 27
- Joined: Sat Aug 27, 2011 9:41 am
Re: Image Recognition
I have changed the color of the entire image. Right ? Then, how can the image equal to 10% similarity..?
-
- Posts: 27
- Joined: Sat Aug 27, 2011 9:41 am
Re: Image Recognition
Even I have tried with 100% similarity but haven't found any progress.
Please help me out.
Please help me out.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Image Recognition
Hi,
Please determine the similarity factor of your images with:
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:
Regards,
Markus
Ranorex Support Team
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