Hi, first of all good work creating this, it's easy to use and does the job.
I started using the lib for my nightly automated regression tests in order to capture video records of the tests that are failing, to help with debug.
Since then I'm seeing some errors with Insufficient memory thrown by opencv.
The thing is that the error comes when I try to do some image recognition using a different library that uses opencv.
Yesterday I deactivated screen recording during the tests and the errors are gone.
Maybe there's a memory leak here that prevents opencv to allocate memory for other tasks.
Here is the error I get:
File "C:\GitLab-Runner\builds\hbav6Snu\0\COP_QA\COP\d2c_regression\libs\image_utils.py", line 66, in locate
return pyautogui.locateOnScreen(ELEMENTS_PATH + element_image, minSearchTime=3, confidence=confidence)
File "c:\work_dir\cop_regression\lib\site-packages\pyscreeze_init_.py", line 360, in locateOnScreen
retVal = locate(image, screenshotIm, **kwargs)
File "c:\work_dir\cop_regression\lib\site-packages\pyscreeze_init_.py", line 340, in locate
points = tuple(locateAll(needleImage, haystackImage, **kwargs))
File "c:\work_dir\cop_regression\lib\site-packages\pyscreeze_init_.py", line 219, in _locateAll_opencv
result = cv2.matchTemplate(haystackImage, needleImage, cv2.TM_CCOEFF_NORMED)
cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\core\src\alloc.cpp:55: error: (-4:Insufficient memory) Failed to allocate 49838424 bytes in function 'cv::OutOfMemoryError'
Also here's the simplified code that I'm using to capture screen records, maybe I'm not using this correctly.
@pytest.fixture(scope="function", autouse=True)
def _capture_screen_record(self):
screen_recorder.disable_log()
params = screen_recorder.RecorderParams()
screen_recorder.init_resources(params)
screen_recorder.start_video_recording("temp_screen_record.mp4", 20, 4000000, True)
yield
screen_recorder.stop_video_recording()
screen_recorder.free_resources()
Any input is appreciated, thanks