Re: [Sikuli-driver] [Question #698028]: capture image without saving to disk

2021-07-17 Thread Jaroslav Novotny
Question #698028 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698028

Status: Answered => Solved

Jaroslav Novotny confirmed that the question is solved:
Thanks RaiMan, that solved my question.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #698028]: capture image without saving to disk

2021-07-17 Thread Jaroslav Novotny
New question #698028 on SikuliX:
https://answers.launchpad.net/sikuli/+question/698028

Hello,

in the java version it's possible to get the intermediate result of cmdCapture 
as a ScreenImage object.

Is there something similar in the python version?
I could only find to save image to disk, then to use this image. Does this 
internally cache the image, or it does disk IO operation every time?

Thanks!

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #693505]: java multithreading is not parallel

2020-10-27 Thread Jaroslav Novotny
Question #693505 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/693505

Jaroslav Novotny posted a new comment:
I did some more testing and found this performance scaling pretty much
in line with both test above:

https://i.imgur.com/D3qGUju.png

It's array of 8 patterns each same size trying to find them in different
region sizes, I did each test for each region size 100x and averaged it,
wasn't sure if the stair-case effect is real or not.

The clear winner seems to be region.findAnyList() that scales nicely,
but UI elements are often scattered around the screen so it would be
used with a big region to batch-find the state of all of them. On the
other hand the single and multi-threaded ways allow to use different
region with different pattern so for each item from the pattern array
only a small portion of screen can be used as region because UI elements
are often fixed where they are. But there is something bottlenecking
both in regions < 500px^2.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #693497]: IntelliJ IDEA artifact.jar and ImagePath

2020-10-25 Thread Jaroslav Novotny
Question #693497 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/693497

Status: Answered => Solved

Jaroslav Novotny confirmed that the question is solved:
Yes, all works without the trailing slash! Thanks!

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #693505]: java multithreading is not parallel

2020-10-21 Thread Jaroslav Novotny
Question #693505 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/693505

Status: Answered => Solved

Jaroslav Novotny confirmed that the question is solved:
I distilled my code to the smallest working example: 
https://notepad.pw/code/g105vjx1b
And got output that I'd expect:

Test 1 took: 432 ms
Test 2 took: 118 ms
Test 3 took: 168 ms

I'll keep investigating but looks like problem is somewhere else, most
likely between keyboard and chair, so I'll close this as solved.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #693497]: IntelliJ IDEA artifact.jar and ImagePath

2020-10-21 Thread Jaroslav Novotny
Question #693497 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/693497

Status: Answered => Open

Jaroslav Novotny is still having a problem:
I made a new project just to investigate, got some new info. I was
hoping it was conflict in the "main" name, but looks like something
else.

This is the code:

import org.sikuli.script.*;
public class SikuliTest {
public static void main(String[] args) {
boolean path_add_success = ImagePath.add("SikuliTest/patterns/");
System.out.printf("SikuliTest/patterns/ added?: %s" + "\n", 
path_add_success);
for (ImagePath.PathEntry path : ImagePath.getPaths()) {
System.out.printf("ImagePath: %s\n", path);
}
Pattern pattern = new Pattern("pattern.png");
}
}

When running from IntelliJ all is fine. When from this .jar (unzipped
structure: https://i.imgur.com/kILFr1e.png) I get output:

e:\.\Sikuli_Test_jar>java -jar Sikuli_Test.jar
SikuliTest/patterns/ added?: true
ImagePath: null
ImagePath: null
[error] Image: load: failed: jar:file: 
/E:/.../out/artifacts/Sikuli_Test_jar/Sikuli_Test.jar!/patterns//pattern.png

Weirdly the "/" gets doubled.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #693497]: IntelliJ IDEA artifact.jar and ImagePath

2020-10-21 Thread Jaroslav Novotny
Question #693497 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/693497

Jaroslav Novotny posted a new comment:
I can provide this test project and .jar if needed.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #693505]: java multithreading is not parallel

2020-10-17 Thread Jaroslav Novotny
New question #693505 on Sikuli:
https://answers.launchpad.net/sikuli/+question/693505

I have this runnable class:

public class PatternFinder implements Runnable {
private final Pattern pattern;
private final Region region;

public PatternFinder(Pattern pattern, Region region){
this.pattern = pattern;
this.region = region;
}
@Override
public void run(){
region.has(pattern,0);
}

Then I make bunch of threads, I give each different PatternFinder that each has 
different region and different pattern, I start() them all and then join() them 
to the main thread. But I get the same performance like if I wouldn't use any 
threading at all and run all the some_region.has(some_pattern, 0); sequentially 
in the main thread.

I am using JDK 8u251, win10, sikulixapi-2.0.4

Thanks

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #693497]: IntelliJ IDEA artifact.jar and ImagePath

2020-10-17 Thread Jaroslav Novotny
New question #693497 on Sikuli:
https://answers.launchpad.net/sikuli/+question/693497

Hello, I am having trouble locating pattern images bundled inside .jar in 
IntelliJ IDEA IDE.

My project is setup like this:

https://i.imgur.com/rTxqZec.png

And the code is:

ImagePath.add("Main/patterns/")
for (ImagePath.PathEntry path : ImagePath.getPaths()) {
print(String.format("ImagePath: %s", path) + "\n");
}

Which works nicely when I run the project. I get:

null
/C:\(...)\patterns/

And everything works. But when I try to pack it inside .jar and I build an 
artifact and run it, I just get:

null
null

Weirdly the ImagePath.add("Main/patterns/") returns true. But finding patterns 
does not work.

This is the .jar structure when I unzip it:

https://i.imgur.com/QY8CCDG.png

Thanks for any help.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #691935]: Are mouse and keyboard actions thread safe? --- generally no!

2020-07-18 Thread Jaroslav Novotny
Question #691935 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/691935

Status: Answered => Solved

Jaroslav Novotny confirmed that the question is solved:
Thanks for the quick response and clarification.

My use case is to perform mouse clicks and type in input fields of multiple 
GUIs, that each has animations. These animations range from 1sec to about 5sec, 
and it usually goes like:
- click some pattern
- wait for another pattern to show up (1-5s)
- click another pattern or type into a field

So I want to execute code for each GUI in different thread, so when one
is waiting for element to show up, another thread can perform actions on
the other GUI.

I'll wrap the sikuli calls into a virtualUser class that will have
synchronized methods, so only one thread at a time can use the keyboard
and mouse. That should do the trick.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #691935]: Are mouse and keyboard actions thread safe?

2020-07-17 Thread Jaroslav Novotny
New question #691935 on Sikuli:
https://answers.launchpad.net/sikuli/+question/691935

Hi,
I want to use sikuli mouse and keyboard actions from many concurrent threads in 
java (using sikulixapi-2.0.4).

This: https://raiman.github.io/SikuliX1/javadocs/org/sikuli/script/Mouse.html 
leads me to believe at least mouse actions should be thread safe, but couldn't 
find anything on type() keyboard actions.

There is this old answer: https://answers.launchpad.net/sikuli/+question/225919 
stating:
"(...)concurrent usage of mouse and keyboard: this is definitely not 
coordinated by Sikuli among threads."
But the answer is rather old.

Should I wrap those keyboard and mouse actions in a thread safe class or am I 
ok?

Thanks for answering

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #691666]: Find every match of multiple patterns

2020-07-04 Thread Jaroslav Novotny
Question #691666 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/691666

Status: Answered => Open

Jaroslav Novotny is still having a problem:
Sadly that's no the case.

findAnyList performs find operation for each item of the list, which
results in only the best match being found for each list item, but not
all of them (not all of visible occurrences of that pattern). Same like
region.find(pattern) finds only the best match.

Ideally I'd need something like a region.getAllList(list_of_patterns)
function.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #691666]: Find every match of multiple patterns

2020-07-03 Thread Jaroslav Novotny
New question #691666 on Sikuli:
https://answers.launchpad.net/sikuli/+question/691666

Hi, I can find the best matches from list of patterns using:
matches = region.findAnyList(list_of_patterns)

I can also find all matches of a single pattern in region using:
matches = region.getAll(pattern)

How do I find all matches of each item in list_of_patterns in one go? It's 
performance sensitive, I want to take single screen snippet and perform the 
searches in parallel.

Do I have to somehow code this more low-level-ish using Finder class on taken 
image from screen.capture(region)? This results in the image being saved to 
disc and then read back, which isn't the fastest. Is that what happens with 
region.find(pattern) internally too, does it go through temp storage?

Thanks a ton!

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp