Reading video with opencv python Raspberry pi

1,372 views
Skip to first unread message

Soufiane Tal

unread,
Oct 18, 2016, 12:47:19 AM10/18/16
to Flir Lepton
Hello everyone, I have my flir lepton connected to GPIO pins in Raspberry pi. I can't read a video. I can take a picture with the written code by pylepton.
Does anyone know how I can read the video?
Here is my code:

import numpy as np
import cv2
from pylepton import Lepton

cap = cv2.VideoCapture(0)
while (True):
    ret, frame = cap.read()

    cv2.imshow('frame', frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
cap.release()
cv2.destroyAllWindows()


Thank you,
Soufiane


Ben Kluwe

unread,
Oct 19, 2016, 3:50:35 AM10/19/16
to Flir Lepton
Hi, have a look here: https://github.com/groupgets/pylepton/blob/master/readme.md and here: https://github.com/groupgets/pylepton/blob/master/pylepton_capture

essentially, you need to be getting the image from Lepton(device).capture() instead of a VideoCapture interface (which is provided by OpenCV).

Ben

Odette Scholtz

unread,
Feb 20, 2017, 7:54:39 AM2/20/17
to Flir Lepton
Hey I am also using set code, but I cant take a picture. The main Lepton code seems to get stuck in a while loop and if I remove the loop I just end up getting black images. Please let me know if you changed the code in any way to make it work.

Regards
Odette 

Soufiane Talmoust

unread,
Feb 20, 2017, 8:05:58 AM2/20/17
to Odette Scholtz, Flir Lepton
What I did is I got a purethermal breakout board that is connected by USB, therefore I interact with my lepton as a webcam which makes my life super easy.

This message and attachments are subject to a disclaimer. Please refer to http://www.it.up.ac.za/documentation/governance/disclaimer/ for full details.

--
You received this message because you are subscribed to a topic in the Google Groups "Flir Lepton" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/flir-lepton/RLTthVcAZog/unsubscribe.
To unsubscribe from this group and all its topics, send an email to flir-lepton+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/flir-lepton.
To view this discussion on the web visit https://groups.google.com/d/msgid/flir-lepton/ba4030f5-057d-4cf9-96c5-5ce4eb1107fb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Marty Sullivan

unread,
Feb 20, 2017, 4:11:56 PM2/20/17
to Flir Lepton
You can also use the v4l2lepton program in the LeptonModule GitHub and this will make the Lepton appear as a standard webcam using the gpio breakout board.
Reply all
Reply to author
Forward
0 new messages