← Back to team overview

sikuli-driver team mailing list archive

[Bug 878864] Re: [request] want Pattern.anySize() and Pattern.anyColor()

 

I know this is a bit late, but here it goes:

There is an algorithm for image stretching that generates a larger image
pattern from a smaller one that could then be used to match from for
anySize(). The pixels in the smaller image are sent to their relative
positions in the larger version of the image.

Imagine each [value] is a pixel:

Image pixels are pulled from (Source):
[red] [red]
[red] [blu]


Larger image pixels are drawn into:
[red] [red] [red]
[red] [red] [red]
[red] [red] [blu]
[red] [red] [blu]

or

[red] [red] [red] [red]
[red] [red] [red] [red]
[red] [red] [blu] [blu]
[red] [red] [blu] [blu]

The most important thing is to consistently round up or down every time
when calculating the pixel to get your colour from.

Algorithm Steps:
1. Generate a new image, the destination, in the size you require 
2. Iterate over destination's pixels, calculating the source pixel to get your colour value from
3. Set the colour value in destination based on the source calculation

This would generate an image that can be used to match whatever size you
need.

If you don't know the size it might be possible to use template matching
to find similar patterns to your search image on the screen then
generate images in the correct size based on the template matches and
try to find using a differently sized version of the pattern to match.
The processing time might be a bit slow. (Very, very slow)

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/878864

Title:
  [request] want Pattern.anySize() and Pattern.anyColor()

Status in Sikuli:
  New

Bug description:
  based on the original description of the planned Sikuli features:

  anySize() was supossed to solve different resolutions problems.

  But it is not yet available in Sikuli script.

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/878864/+subscriptions


References