Reputation: 93
If one camera support 16bit gray image, how to get 16bit image via opencv videocapture class?
Can we do this with by cam.set CV2 CAP_PROP_FORMAT properties? If yes, how to set this properties?
env: windows 10
opencv3.1 python binding
python 3.6.3
webcam: purethermal with raw 16bit data feeding
Upvotes: 0
Views: 3828
Reputation: 41
This code example works for me :
import cv2
device_index = 0
cap = cv2.VideoCapture(device_index+cv2.CAP_DSHOW)
cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter.fourcc('Y','1','6',' '))
cap.set(cv2.CAP_PROP_CONVERT_RGB, False)
code, frame = cap.read()
from :
Upvotes: 4