move functions from proof of concept into apply image
This commit is contained in:
parent
0af8b43606
commit
57b9c1ebbc
|
@ -38,6 +38,18 @@ def create_blank(width, height):
|
|||
def to_points (d) :
|
||||
return [[d['0']['x'], d['0']['y']], [d['1']['x'], d['1']['y']], [d['3']['x'], d['3']['y']]]
|
||||
|
||||
def get_mask (img) :
|
||||
lower = np.array([0,0,0,0])
|
||||
upper= np.array([0,0,0,0])
|
||||
mask = cv2.inRange(img, lower, upper)
|
||||
return cv2.bitwise_not(mask)
|
||||
|
||||
def combine_images (bg, fg, mask) :
|
||||
fk = cv2.bitwise_or(fg, fg, mask=mask)
|
||||
mask = cv2.bitwise_not(mask)
|
||||
bk = cv2.bitwise_or(bg, bg, mask=mask)
|
||||
return cv2.bitwise_or(fk, bk)
|
||||
|
||||
if len(sys.argv) < 2 :
|
||||
print('Please provide an output destination file')
|
||||
exit(1)
|
||||
|
|
Loading…
Reference in New Issue