Jump to content

Recommended Posts

Posted

@konya DLL load failure is a surprise for me.
Have you downloaded the new opencv version, not juste the new udf?
Can you verify that you are using opencv 4.10.0 dll and not openvv 4.7.0 dll when opening the udf dll?

  • 1 month later...
Posted

Hello.
Use a translator Communication may not be smooth.

First of all, some computers are experiencing DLL load errors.
opencv_get() <-- Error occurring in this part.

As a result of testing, it seems to be related to the authority.

Do you know any solution to this error?

  • 3 weeks later...
Posted (edited)

Hello @unspeaking
It seems like you are not using the x64 version of AutoIt.

Can you run the following command
"C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe" "C:\Users\t0n\Desktop\script\TestOpencv\node-autoit-opencv-com-2.6.2\samples\02.1-show-image-gui-autosize.au3"
If the file AutoIt3_x64.exe is missing, then your AutoIt installation does not have the x64 version.
Reinstall AutoIt with the x64 version.

If it works, then, the #AutoIt3Wrapper_UseX64=y directive can only be used on the full SciTE editor.
To check that, can you install the full SciTE editor here

When running the script from SciTE, there should be a line Running:(3.3.16.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe

 

Edited by smbape
Posted
7 hours ago, smbape said:

Hello @unspeaking
It seems like you are not using the x64 version of AutoIt.

Can you run the following command
"C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe" "C:\Users\t0n\Desktop\script\TestOpencv\node-autoit-opencv-com-2.6.2\samples\02.1-show-image-gui-autosize.au3"
If the file AutoIt3_x64.exe is missing, then your AutoIt installation does not have the x64 version.
Reinstall AutoIt with the x64 version.

If it works, then, the #AutoIt3Wrapper_UseX64=y directive can only be used on the full SciTE editor.
To check that, can you install the full SciTE editor here

When running the script from SciTE, there should be a line Running:(3.3.16.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe

 

Thank you.It works.

  • 3 months later...
Posted (edited)

Func start()
    AdlibRegister("opencv",300)
    While 1
..

..

..
    WEnd
EndFunc   ;==>start

Func opencv()
    If Not IsObj($cv) Then Return
    Local $aRect[4] = [0,0,1280,600]
    Local $img1 = _OpenCV_GetDesktopScreenMat($aRect)
        $cv.waitKey()
        $cv.destroyAllWindows()
    EndFunc

 

 

 

"C:\Game&Progrom\AutoIt3\Include\opencv\opencv_udf_utils.au3" (813) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$minVal = $cv.extended[0]
$minVal = $cv^ ERROR

 

 

 

Hello.
I'm using the script well
First of all, thank you.

The wider the search range and the more searched images, the slower it is
Is there a good way?
Is there a way to keep capturing it in real time?

And errors occur when using it in timer format.
I'll be waiting for the reply.

 

 

Edited by k_u_x
Posted

Hello @k_u_x, to be honest, when it comes to speed, Autoit is not the best choice.

A while loop without a sleep, like cv.waitKey(10) will put too much pressure on the CPU.

Concerning speeding up the search process, you can resize the image to a smaller size before performing the search.

_OpenCV_GetDesktopScreenMat is more a proof a concept than a full speed function.
It is better to copy the data in an existing data that creating a new one at each loop.

You can also cv.UMat everywhere an Input/Ouput Array is expected. If done correctly, it will use your GPU instead of your CPU.

It is also not sure that the searching process is slow, you need timings to confirm the slower parts.

For inspiration, have a look at

https://github.com/smbape/node-autoit-opencv-com/blob/main/samples/dnn/object_detection/object_detection.au3
https://github.com/smbape/node-autoit-opencv-com/blob/main/samples/tutorial_code/tapi/bgfg_segm.au3

Posted (edited)
On 1/20/2025 at 6:09 AM, smbape said:

Hello @k_u_x, to be honest, when it comes to speed, Autoit is not the best choice.

A while loop without a sleep, like cv.waitKey(10) will put too much pressure on the CPU.

Concerning speeding up the search process, you can resize the image to a smaller size before performing the search.

_OpenCV_GetDesktopScreenMat is more a proof a concept than a full speed function.
It is better to copy the data in an existing data that creating a new one at each loop.

You can also cv.UMat everywhere an Input/Ouput Array is expected. If done correctly, it will use your GPU instead of your CPU.

It is also not sure that the searching process is slow, you need timings to confirm the slower parts.

For inspiration, have a look at

https://github.com/smbape/node-autoit-opencv-com/blob/main/samples/dnn/object_detection/object_detection.au3
https://github.com/smbape/node-autoit

Is this the right way to retrieve multiple images within a single screenshot?

 

+

You said the way to ignore the background is to switch to black pixels. But it doesn't work very well. Am I doing something wrong?

 

1.bmp 123.bmp

Edited by k_u_x
  • 2 weeks later...
Posted
On 1/23/2025 at 1:40 PM, k_u_x said:

Is this the right way to retrieve multiple images within a single screenshot?

 

+

You said the way to ignore the background is to switch to black pixels. But it doesn't work very well. Am I doing something wrong?

 

1.bmp 8.49 kB · 1 download 123.bmp 1.89 MB · 1 download

I do not remember having written that.
The examples I provided was for the usage of UMat.

The image "K" should have a transparent background and your use case has been answered on stackoverflow.

https://stackoverflow.com/questions/71302061/how-do-i-find-an-image-on-screen-ignoring-transparent-pixels/71302306#71302306

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...