Giter VIP home page Giter VIP logo

track-n-lock's Introduction

Track-N-Lock (Heat detection & tracking)

In this project, I developed and implemented an algorithm to detect and track the highest heat source within a camera's field of vision - in this case a FLIR Lepton 2.0

I developed this project due to the lack of information and methods to track high temperature objects using this particular camera. Although FLIR Lepton 2.1 comes with a factory method to identify high temperatures, FLIR Lepton 2.0 does not, and therefore decided to write this program to address the issue.

NOTE: In implementing this project I made use of two other repositories, namely one from Pure Engineering who developed the sample code for the FLIR Lepton and richardghirst who developed the ServoBlaster library. Their repositories can be found at the following links:

https://github.com/richardghirst

https://github.com/groupgets/LeptonModule

The code from Pure Engineering was used primarily as a starting point to write the program to detect high temperatures. In particular, the file LeptonThread.cpp has been heavily modified and I have extensively commented the code to understand the changes made.

The ServoBlaster library has been used in order to control a pan-tilt bracket that aids in pointing the camera towards the correct direction to the highest temperature in its field of vision.

#---------------------------------- HOOKUP GUIDE ----------------------------------

In order to hook up the FLIR Lepton to the Raspberry Pi B+, refer to the sparkfun website:

https://learn.sparkfun.com/tutorials/flir-lepton-hookup-guide

NOTE: Be aware that the CS pin location from the raspberry pi used in the sparkfun guide differs from the CS pin in the RPI B+ because it counts with an expanded set of GPIO pins. Google the appropriate image to find the correct CS pin.

#Raspberry Pi & FLIR Lepton--------------------------------------------------------

The hookup guide from Sparkfun should be anough to help you hookup the FLIR camera to the RPi. After hooking up the camera, the only thing that needs to be hooked up from here on are the two servos that will be used as part of the tracking system to point to the highest temperature source within the camera's field of vision. Refer to the the images inside the appropriate folder for guidance.

#ServoBlaster Library---------------------------------------------------------------

In this project I used servo numbers 5 and 6 from the ServoBlaster library, which correspond to GPIO pins 23 and 24 from the RPi B+ respectively. These pins need to be attached to the servo's PWM signal pins.

You can navigate to the "ServoBlaster" GitHub if you want to learn more about the ServoBlaster library, but the servo numbers and their corresponding GPIO pins are as follows:

Servo Number -> GPIO Number

0-->4

1-->17

2-->18

3-->21/27

4-->22

5-->23

6-->24

7-->25

Finally, navigate inside the PiBits>ServoBlaster>User folder. In this folder you will find the Servod.c program. Execute it using: sudo ./servod

This will enable the ServoBlaster library, which will be later used by leptonThread.cpp

#Heat Detection Program---------------------------------------------------------------

Having hooked up all the components together and executed the ServoBlaster library, the only thing left to do is execute the camera's heat detection program.

Navigate inside the raspberrypi_thermalCam and type: qmake && make

This will create an executable file, which you can then run.

#Heat Detection Algorithm--------------------------------------------------------------

As mentioned before, this project implements an algorithm to estimate the source of the highest temperature object (in fahrenheit) within the camera's field of vision. This algorithm was developed using a linear regression formula using the raw output of the camera as a baseline. Although the temperature was accurate for the room where I developed this algorithm, it might not be for the place where you are located. If you know how to run a regression, you can modify the formula accordingly within the source code.

You must also take into account that there are other factors that affect temperature such as the environmental and internal temperature of the camera, reflection, and disance, so even after running a regression with the raw outputs of the camera, the output might not be accurate when taken to other places. You need to think of the other factors affecting temperature and add those sensors to your implementation if you want more accurate results.

track-n-lock's People

Contributors

jorgeg922 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.