Closed
Description
To speed up the matchTemplates function I decided to first run some image preprocessing and extract rectangles representing my regions of interest. With some templates being smaller than others I often get rectangles that only fit the smaller templates. When a template bigger than the currrent searchbox is tried, the error
- cv2.error: (-215:Assertion failed) _img.size().height <= _templ.size().height && ;_img.size().width <= _templ.size().width in function 'cv::matchTemplate'
occurs on
- init line 143 corrMap = computeScoreMap(template, image, method, mask=mask)
I bandaided the issue by wrapping that line in a try except block, but some logic to check sizes earlier in the function would probably save time.
Metadata
Metadata
Assignees
Labels
No labels