groupgets / purethermal1-uvc-capture

USB Video Class capture examples for PureThermal 1 / PureThermal 2 FLIR Lepton Dev Kit
124 stars 81 forks source link

Lepton Camera Video #51

Open Smartgalpj opened 3 years ago

Smartgalpj commented 3 years ago

Hi,

I am using python code to record the video from Lepton Camera. In Lepton User App, video is good, while using python code, video is having flairs. I am sending you the code. Video output of this code is also attached in here. Please help me. It is very urgent.

Script below:

from import_clr import * from moviepy.editor import VideoFileClip, concatenate_videoclips clr.AddReference("ManagedIR16Filters") clr.AddReference("TIFFfile") clr.AddReference("LeptonUVC") from flirpy.camera.lepton import Lepton import cv2 from Lepton import CCI from IR16Filters import IR16Capture, NewIR16FrameEvent, NewBytesFrameEvent from System.Drawing import ImageConverter from System import Array, Byte import matplotlib from matplotlib import pyplot as plt from matplotlib import cm import numpy import time from PIL import Image import matplotlib

frame0 = cv2.VideoCapture(0) frame0.set(3, 160) frame0.set(4, 120)

frame1 = cv2.VideoCapture(2)

frame1.set(3, 160)

frame1.set(4, 120)

while 1:

ret0, img0 = frame0.read()
#ret1, img00 = frame1.read()

if ret0:
    cv2.imshow("lepton", cv2.resize(img0, (160, 120)))
#if ret1:
    #cv2.imshow("lepton2", cv2.resize(img00, (160, 120)))
if cv2.waitKey(1) & 0xFF == ord('q'):
    break

frame0.release()

frame1.release()

cv2.destroyAllWindows()

https://user-images.githubusercontent.com/87067078/125272097-c093f700-e30b-11eb-980c-acbf9d57263d.mp4