← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #251718]: Recognitation with transparency or masks!

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Sorry, but the current implementation does not allow, to ignore a transparent part of an image nor to do any kind of masking.
The used image is always taken as 100% opaque with every pixel contained in the image rectangle.
(this is due to the used OpenCV function matchTemplate)
(background: the images internally are RGB 3-byte arrays, an image with transparency is an RGBA 4-byte array. Internally an RGBA is accepted, but the transparency channel is simply ignored and hence brings back the original opaque pixel)

So in your case, you cannot use the complete image, but only part of it (e.g. head and part of the upper body).
The goal is, to create images, that contain less than 20% even background (with not even background, the percentage is lower) (based on experience).
When having a risk for false positives, the only solution is, to use findAll() and check the resulting matches with a second image (here e.g. the upper part of the legs).

--- private comment ;-)
Was soll der quatsch mit dem ... oh mein englisch! - nur wer übt kommt weiter (mein neuer Standardspruch übernommen von unseren WM-Jungs).
Was meinst du wie mein Englisch vor ein paar Jahren noch ausgesehen hat ;-)

BTW: Ich habe die Frage bereits auf Englisch verstanden - also trau
dich.

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