我试图在OpenCV 4.2.0 Python 3.5.6中查看OmnivisionOV7251摄像头的输出。相机的输出是10位原始灰度数据,我相信这是正确的16位字对齐
当我使用此OpenCV代码时:
import cv2
cam2 = cv2.VideoCapture(0)
cam2.set(3, 640) # horizontal pixels
cam2.set(4, 480) # vertical pixels
while True:
b, frame = cam2.read()
if b:
cv2.imshow("Video", frame)
k = cv2.waitKey(5)
if k & 0xFF == 27:
cam2.release()
cv2.destroyAllWindows()
break
这是我得到的图像:
大概是OpenCV使用了错误的过程将10位原始数据转换为RGB,认为它是某种YUV或其他东西
有什么方法可以让我:
一种方法是获取原始相机数据,然后使用numpy进行校正:
相关问题 更多 >
编程相关推荐