I am trying to change a pixel in a specific video frame using OpenCV in Python. My current code is:
import cv2
cap = cv2.VideoCapture("plane.avi")
cap.set(1, 2) #2- the second frame of my video
res, frame = cap.read()
cv2.imshow("video", frame)
while True:
ch = 0xFF & cv2.waitKey(1)
if ch == 27:
break
I got the frame that I want but I don't know how to get and change it's pixels. Please suggest a method.
frame[1,1,0] = 255
frame[1,1,1] = 255
frame[1,1,2] = 255
I make the pixel white, yeah? – Snob