Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you have to create your mask outside the loop.

#Create the basic black image
mask = np.zeros(blur.shape[:2], dtype="uint8")
for (x1,y1,x2,y2)in rect:
  cv2.rectangle(mask,(x1,y1),(x2,y2), (COLOR_WHITE), -1)

(silly noob error, isn't it ?)

you have to create create your mask outside the loop.

#Create the basic black image
mask = np.zeros(blur.shape[:2], dtype="uint8")
for (x1,y1,x2,y2)in rect:
  cv2.rectangle(mask,(x1,y1),(x2,y2), (COLOR_WHITE), -1)

(silly noob error, isn't it ?)