FLIR / BosonUSB

Tool to capture Boson USB video in Linux
MIT License
64 stars 26 forks source link

BosonUSB in python #13

Closed ejhaya8 closed 5 years ago

ejhaya8 commented 5 years ago

Could you please provide a python example to read images in AGC 8bit mode? I would like to get 8bit images for object detection written in python.

ghost commented 5 years ago

OpenCV in Python has that capability. Take a look to this repo, was for lepton but easy to use for Boson. https://github.com/groupgets/purethermal1-uvc-capture/blob/master/python/opencv-capture.py

This is one more generic.ç https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_video_display/py_video_display.html

ejhaya8 commented 5 years ago

Thank you for the info. With gstreamer, I could specify the format for OpenCV as below, and sucsessfully captured post-AGC 8-bit image.

pipeline = "v4l2src device=/dev/video1 ! video/x-raw,width=640,height=512,format=(string)I420,pixel-aspect-ratio=1/1, interlace-mode=(string)progressive, framerate=30/1 ! videoconvert ! appsink" cap = cv2.VideoCapture(pipeline, cv2.CAP_GSTREAMER)