#Example code showing how to itterate through individual pixels using python #looping constructs and making a per-pixel decision with an if statement. # #Jay Summet - Summer 2024 # # OpenCV 4.5.x, Python 3.10 import cv2 #Because the color channels are the last "dimension", 2D slicing will #also automatically copy all 3 color channels. # a = cv2.imread("blueSky.jpg") y,x,c = a.shape print("x:", x, "Y:",y) for y in range(0, y): for x in range(0,x): value = a[y][x][0] if value > 200: a[y][x] = (255,255,255) cv2.imshow("Image", a) cv2.waitKey(0)