I have attached the code below. In this code, I want to write a section to get the binary LSB values from the RGB value of frames. Frames - The video is fragmented into respective video frames
import numpy as np
import cv2 as cv
vidcap = cv.VideoCapture("video.mp4")
if not vidcap.isOpened():
print("Cannot open camera")
exit()
while True:
# Capture frame-by-frame
ret, frame = vidcap.read()
# -------------------------------------------------------------> step 2 - split
# if frame is read correctly ret is True
if not ret:
print("Can't receive frame (stream end?). Exiting ...")
break
# Our operations on the frame come here
gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
print(gray)
# Display the resulting frame
cv.imshow('frame', gray)
if cv.waitKey(1) == ord('q'):
break
# When everything done, release the capture
vidcap.release()
cv.destroyAllWindows()