You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello sir,
I'm getting difficulties in data pre-processing as the dataset is in png format and we are working on video. Please help me load data, pre-processing it, and preview it as a video or gif.
Thanks
The text was updated successfully, but these errors were encountered:
I will give you help on how you should go about reading the videos.
The following example shows the mechanism by which a single video is read and the results are stored in an array.
You should extend the work of the script so that you can read all the videos included in the dataset, in addition to the mechanism that you can skip a specified number of frames in order to read all videos of the same length (with the same number of frames), and you can do this by reading more about VideoCapture Good luck
import cv2
video_file_path = ''
image_height = 60
image_width = 60
video_reader = cv2.VideoCapture(video_file_path)
success, frame = video_reader.read()
previous = frame.copy()
frames_queue = []
while video_reader.isOpened():
ok, frame = video_reader.read()
if not ok:
break
diff = cv2.absdiff(frame, previous)
f = cv2.resize(diff, (image_height, image_width))
f = cv2.cvtColor(f, cv2.COLOR_BGR2GRAY)
previous = frame.copy()
normalized_frame = f / 255
frames_queue.append(normalized_frame)
video_reader.release()
Hello sir,
I'm getting difficulties in data pre-processing as the dataset is in png format and we are working on video. Please help me load data, pre-processing it, and preview it as a video or gif.
Thanks
The text was updated successfully, but these errors were encountered: