#0405.py

import cv2
#import numpy as np

img = cv2.imread('../data/lena.jpg')    # cv2.IMREAD_COLOR

# for y in range(100, 400):
#   for x in range(200, 300):
#       img[y,x,0] = 255                # B-채널을 255로 변경

img[100:400, 200:300, 0] = 255          # B-채널을 255로 변경
img[100:400, 300:400, 1] = 255          # G-채널을 255로 변경
img[100:400, 400:500, 2] = 255          # R-채널을 255로 변경

cv2.imshow('img', img)
cv.waitKey()
cv2.destroyAllWindows()

ac3d9e3e44bfbb3357008b963fd4674033adeb95
<mask token>

<mask token>
cv2.imshow('img', img)
cv.waitKey()
cv2.destroyAllWindows()

<mask token>
img = cv2.imread('../data/lena.jpg')
img[100:400, 200:300, 0] = 255
img[100:400, 300:400, 1] = 255
img[100:400, 400:500, 2] = 255
cv2.imshow('img', img)
cv.waitKey()
cv2.destroyAllWindows()

import cv2
img = cv2.imread('../data/lena.jpg')
img[100:400, 200:300, 0] = 255
img[100:400, 300:400, 1] = 255
img[100:400, 400:500, 2] = 255
cv2.imshow('img', img)
cv.waitKey()
cv2.destroyAllWindows()

#0405.py

import cv2
#import numpy as np

img = cv2.imread('../data/lena.jpg')    # cv2.IMREAD_COLOR

# for y in range(100, 400):
#   for x in range(200, 300):
#       img[y,x,0] = 255                # B-채널을 255로 변경

img[100:400, 200:300, 0] = 255          # B-채널을 255로 변경
img[100:400, 300:400, 1] = 255          # G-채널을 255로 변경
img[100:400, 400:500, 2] = 255          # R-채널을 255로 변경

cv2.imshow('img', img)
cv.waitKey()
cv2.destroyAllWindows()
