← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #250653]: Sikuli and Vector Images --- does not matter - only pixels are relevant

 

Question #250653 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/250653

RaiMan requested more information:
--1. the feature is not yet planned

--2. is it possible, to get samples, that I can use in a browser, to
force different rescaling and check, how the search will work, with
resized versions of some base image?

--3. a basic implementation with minimal effort to implement:
factor = <some evaluation/calculation resulting in a value 0 < 1.0 < max>
img = Pattern(some_base_image).resize(factor)
find(img)

The "problem": since the probe is only found, if width and height of the
image in the current visible resolution is the same as the probe, we
have to check some range of width around the calculated width base on
the given resize factor.

example:
probe width = 105 pixels
resize factor: 1.237
calculated new width: 129.885

so we might try the following strategy:
check with resized image having width:
130
129
131
128
132
127
133
126
...
until found.

with some setting, the range around the calculated value should be
restricted.

To avoid lengthy processing with this feature, it should be possible, to once at the beginning of the workflow to find out with some reference image, what the optimal resizing factor is, so that in the above example only a few width values around 130 and 129 must be checked.
The calculations can further be supported, since with 1.1.0+ it is possible to get the dimensions of a loaded image for calculations.

This would make another option possible:
newWidth = <some evaluation/calculation resulting in the int pixel width of the image in the current environment>
img = Pattern(some_base_image).width(newWidth)
find(img)

So the workflow is responsible to set the new width, to that the probe should be resized.
So only one search is needed.

I could make this feature available in the current Beta within a week or
so, since internally, the needed base functions are already available.

If you are interested, then we should communicate privately from now on:
use my mail at https://launchpad.net/~raimund-hocke

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.