Processing file ../src/puzzle_small.tif
OpenCV Error: Sizes of input arguments do not match (The lower bounary is neither an array of the same size and same type as src, nor a scalar) in inRange, file /build/buildd/opencv-2.4.2+dfsg/modules/core/src/arithm.cpp, line 2527
Traceback (most recent call last):
File "split.py", line 162, in <module>
sheet.export_results_as_html()
File "split.py", line 103, in export_results_as_html
img_with_overlay = self.overlay_contours()
File "split.py", line 92, in overlay_contours
contours = map(lambda x: x.contour, self.get_shreds())
File "split.py", line 135, in get_shreds
return self.sheet.get_shreds(self.feature_extractors, self.sheet_name)
File "/home/akoval/projects/unshred/unshred/sheet.py", line 93, in get_shreds
contours, _ = cv2.findContours(self._foreground_mask,
File "/home/akoval/projects/unshred/unshred/sheet.py", line 242, in _foreground_mask
self._fg_mask = self._find_foreground_mask()
File "/home/akoval/projects/unshred/unshred/sheet.py", line 211, in _find_foreground_mask
mask = cv2.bitwise_or(mask, cv2.inRange(hsv, rng[0], rng[1]))
cv2.error: /build/buildd/opencv-2.4.2+dfsg/modules/core/src/arithm.cpp:2527: error: (-209) The lower bounary is neither an array of the same size and same type as src, nor a scalar in function inRange
As notes stated:
Run it on test file: python split.py ../src/puzzle.tif../src/puzzle.tif:So, problem in this guy
cv2.inRange(hsv, rng[0], rng[1]). According to documentationsrc(hsvin our case) should be the same size as upper/lower boundaries (rng[0],rng[1]). Buthsvis multidimensional array while ranges are not.