Pylepton will be extended in the future to return a real frame ID here once support for frame telemetry is added. Figure 3 and Figure 4 illustrates the integration between the Raspberry Pi 2 and the thermal camera (FLIR Lepton). The capture() function includes a tuple that includes a pixel sum to be used for identifying unique frames (frames can update at ~27 Hz, but only unique ones are returned at ~9 Hz). Subsequently fitting this data into 8 bits is not strictly necessary to save the image with OpenCV but just shown here for demonstration purposes. You probably want to contrast extend this as demonstrated above, since the signal bandwidth is typically narrow over that range. Note that the image data returned from capture() is 14-bit and non-normalized (it's raw sensor data). To roll your own capture program, grabbing frames is rather straightforward: import numpy as np import cv2 from pylepton import Lepton with Lepton() as l: a,_ = l.capture()cv2.normalize(a, a, 0, 65535, cv2.NORM_MINMAX) # extend contrastnp.right_shift(a, 8, a) # fit data into 8 bitscv2.imwrite( "output.jpg", np.uint8(a)) # write it! I installed a VNC server on my smartphone, so, by carrying a Pi connected to a power bank with a VNC-enabled smartphone we can get a pocket thermal camera that saves images. The script works the same on the Raspberry Pi Zero W and Pi 3 B+. Source code for pylepton and pylepton_capture is available on GitHub and on pypi. Connecting to the Raspberry Pi We can control the thermal camera in two ways.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |