re-implement equipment with masks
This commit is contained in:
@@ -49,7 +49,7 @@ class WindowCapture:
|
||||
|
||||
|
||||
|
||||
def get_screenshot(self):
|
||||
def get_screenshot(self, drop_alpha_channel = True):
|
||||
# get the window image data
|
||||
wDC = win32gui.GetWindowDC(self.hwnd)
|
||||
dcObj = win32ui.CreateDCFromHandle(wDC)
|
||||
@@ -74,7 +74,8 @@ class WindowCapture:
|
||||
# drop the alpha channel, or cv.matchTemplate() will throw an error like:
|
||||
# error: (-215:Assertion failed) (depth == CV_8U || depth == CV_32F) && type == _templ.type()
|
||||
# && _img.dims() <= 2 in function 'cv::matchTemplate'
|
||||
img = img[...,:3]
|
||||
if drop_alpha_channel:
|
||||
img = img[...,:3]
|
||||
|
||||
# make image C_CONTIGUOUS to avoid errors that look like:
|
||||
# File ... in draw_rectangles
|
||||
|
||||
Reference in New Issue
Block a user