teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

一部修正

2020/10/17 03:25

投稿

nto
nto

スコア1438

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
- for y in range(0, height):
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