Skip to content

test example won't work #16

Description

@psihonavt

As notes stated:
Run it on test file: python split.py ../src/puzzle.tif

  1. There is no such file, I was trying with ../src/puzzle.tif:
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

So, problem in this guy cv2.inRange(hsv, rng[0], rng[1]). According to documentation src (hsv in our case) should be the same size as upper/lower boundaries (rng[0], rng[1]). But hsv is multidimensional array while ranges are not.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions