floodfill_repro.py

Michael Goldman, 2014-04-30 06:07 pm

Download (284 Bytes)

 
1
import sys
2
import cv2
3
import numpy as np
4
5
if len(sys.argv) != 3:
6
    print "Usage: python floodfill_repro.py <width> <height>"
7
    sys.exit()
8
9
width = int(sys.argv[1])
10
height = int(sys.argv[2])
11
12
img = np.zeros((height, width), np.uint8)
13
flooded = cv2.floodFill(img, None, (1,1), 255)