Bitmap feature identification

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
havitia
Posts: 3
Joined: Tue Jul 23, 2013 9:27 pm

Bitmap feature identification

Post by havitia » Tue Jul 23, 2013 9:36 pm

I'm having difficulty identifying a bitmap feature, for example

bool rc = imaging.TryFindSingle(Searchbmp, Featurebmp, out match)

The searchbmp is a bitmap containing a set of buttons, and the Featurebmp is a smaller bitmap containing only one of those buttons.

I've tried other method including Contains() and FindSingle() and no luck.

What am I missing? or could someone provide an example of comparing two bitmaps.

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

Re: Bitmap feature identification

Post by Support Team » Wed Jul 24, 2013 12:20 pm

Hello,

Have you tried to adjust the similarity in your method?
You could do that as shown below:
Imaging.FindOptions myFindOptions = new Imaging.FindOptions(0.95);
bool rc = Imaging.Contains(image, feature, myFindOptions);
Regards,
Markus (T)

havitia
Posts: 3
Joined: Tue Jul 23, 2013 9:27 pm

Re: Bitmap feature identification

Post by havitia » Wed Jul 24, 2013 7:41 pm

Thanks, the search completes and identifies the feature. I still have one problem. When the feature is not present the search takes 20-30sec.

When I set:

Imaging.FindOptions myFindOptions = new Imaging.FindOptions(0.95);
myFindOptions.Timeout = new Duration(500);
bool rc = Imaging.Contains(image, feature, myFindOptions);

The timeout has no effect. Is there another way to trigger a timing threshold for this operation?

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

Re: Bitmap feature identification

Post by Support Team » Thu Jul 25, 2013 4:38 pm

Hello,

Is your image to search for a repository element?
If yes, you could simply modify the 'Search Timeout' in the properties of your element in the repository.

The FindOptions.Timeout property only applies to image searches done on elements, not on bitmaps directly (it does not make sense to search a bitmap, only an updated screenshot from an element). So the first method argument always needs to be an element or adapter if you want the timeout to be used.

Regards,
Markus (T)

havitia
Posts: 3
Joined: Tue Jul 23, 2013 9:27 pm

Re: Bitmap feature identification

Post by havitia » Fri Jul 26, 2013 4:43 pm

Thanks, that makes sense and after searching the forum I determined that was the case.

Either way after tweaking Findoptions and Preprocessing I was able to configure almost exactly what I needed and don't need the timeout.