1 year ago
#362343
Emlinux
How to apply Y16 codecs to YUY2 data format?
I am getting yuy2 from my camera interfaced board and I need to process it to get raw16
. for that I am developing an application in opencv-pyhton after applying Y16
codec but its giving me uint8
data when I checked with 'frame.dtype'
. Isn't it should be uint16
?
import cv2
import numpy as np
# open video0
cap = cv2.VideoCapture(0, cv2.CAP_MSMF)
cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter.fourcc('Y','1','6',' '))
cap.set(cv2.CAP_PROP_CONVERT_RGB, 0)
cap.set(cv2.CAP_PROP_FORMAT, -1)
enter code here
if cap.isOpened():
#for i in range(10):
# Capture frame-by-frame
ret, frame = cap.read()
else:
#if not ret:
#break
ret = False
while ret:
print('frame.shape = {} frame.dtype = {}'.format(frame.shape,
frame.dtype))
cap.release()
opencv
camera
yuv
raw-data
0 Answers
Your Answer