← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #697732]: macOS M1: how to use a custom build of OpenCV

 

Question #697732 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/697732

Jeff Harmon posted a new comment:
Appreciate your time RaiMan!

Everything worked under Rosetta 2, but I am struggling to get an
observer to scan a Region faster enough.  Here is some sample code I
have used to measure:

Settings.ObserveScanRate = 100F;

Region histogramRegion = new Region(2236,113,323,200) //323x200 region
to observe

String histogramRegionAppearCode = histogramRegion.onAppear(blankHistogramDevelopPattern.exact(), 
            new ObserverCallBack() {
                @Override
                public void appeared(ObserveEvent event) {
                    if (logger.isDebugEnabled()) logger.debug("test: found blank histogram");
                    event.repeat();
                }
            }
        );

        logger.debug("Starting histogram observer...");
        histogramRegion.observeInBackground();
        wait(10000);  //milliseconds
        logger.debug("Stopping histogram observer");
        histogramRegion.stopObserver();

        if (histogramRegion.hasEvents()) {
            logger.info("Found " + histogramRegion.getObserver().getCount(histogramRegionAppearCode));
        }


I get a total of 10 events in 10 seconds when the Region has an exact match the entire time the observer is running.  The automation I am trying to create has the histogram region match the blank pattern for only 0.13 seconds.  I was hoping that going native on Java/OpenCV would allow for faster scans.

I have now hacked a port together of all the components.  I have
everything working with native OpenCV, a native port of MacUtil (used
XCode to help me migrate things and had to do some minor refactors), and
Zulu native JDK 11.  Unfortunately, the code above still only gives me a
match about once per second.  Maybe my code to test the time it takes
for an observer to have an appeared event is flawed?

My end goal is to have an observer tell me that the application has had
the histogram region be blank and then not blank within 0.3 seconds.

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