回答編集履歴
1
一部修正
answer
CHANGED
@@ -28,13 +28,11 @@
|
|
28
28
|
for f1, f2 in zip(src, mask):
|
29
29
|
height, width, color = f1.shape
|
30
30
|
dst = np.zeros((height, width, 3), dtype='uint8')
|
31
|
-
|
31
|
+
|
32
|
-
for x in range(0, width):
|
33
|
-
if (mask[y][x] > 240).all():
|
34
|
-
dst[y][x] = src[y][x]
|
35
|
-
else:
|
36
|
-
dst[y][x] = 0
|
37
32
|
|
33
|
+
# 行いたい画像の処理
|
34
|
+
|
35
|
+
|
38
36
|
cv2.imwrite("{:03d}.jpg".format(cnt), dst)
|
39
37
|
cnt += 1
|
40
38
|
|