Commit 9252dc6e authored by Will Brennan's avatar Will Brennan

Fixed problem with grid mask generation

parent ce90ade0
...@@ -32,7 +32,11 @@ class SuperContour(object): ...@@ -32,7 +32,11 @@ class SuperContour(object):
for i in range(n_w): for i in range(n_w):
for j in range(n_h): for j in range(n_h):
grid_msk = numpy.zeros(frame.shape, dtype=frame.dtype) grid_msk = numpy.zeros(frame.shape, dtype=frame.dtype)
grid_box = numpy.array([[], [], [], []], dtype=numpy.uint8) grid_box = numpy.array([[(w0+i)*self.width, (h0+j)*self.width],
[(w0+i+1)*self.width, (h0+j)*self.width],
[(w0+i)*self.width, (h0+j+1)*self.width],
[(w0+i+1)*self.width, (h0+j+1)*self.width]],
dtype=numpy.uint8)
cv2.drawContours(grid_msk, [grid_box], -1, 255, -1) cv2.drawContours(grid_msk, [grid_box], -1, 255, -1)
grid_msk = cv2.bitwise_and(grid_msk, msk) grid_msk = cv2.bitwise_and(grid_msk, msk)
result_cont.append(grid_msk) result_cont.append(grid_msk)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment