groupgets / LeptonModule

Code for getting started with the FLIR Lepton breakout board
https://groupgets.com/manufacturers/flir/products/flir-lepton
BSD 2-Clause "Simplified" License
317 stars 197 forks source link

How to get temperature value #96

Open HedgeHao opened 1 year ago

HedgeHao commented 1 year ago

I have a FLIR purethermal 3 module. I can get the video frame using OpenCV VideoCap in c++. How can I convert this OpenCV Mat data to actual temperature value?

#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/videoio/videoio.hpp>
#include <opencv2/highgui/highgui.hpp>

using namespace std;
using namespace cv;

int main()
{
    VideoCapture cap(0);
    if (!cap.isOpened())
    {
        cout << "Cannot open camera\n";
        return 1;
    }

    Mat frame;
    while (true)
    {
        bool ret = cap.read(frame);
        if (!ret)
        {
            cout << "Can't receive frame (stream end?). Exiting ...\n";
            break;
        }

        imshow("live", frame);
        if (waitKey(1) == 'q')
        {
            break;
        }
    }
    return 0;
}