Live streaming from a thermal camera(mlx90640)

Hello,
I have bought an infrared imaging module(mlx90640), I want to apply a real time image processing using OpenCV . Thus, a lot of web links explained about mlx90460 module but most of them use I2C protocol. My module does not deal with this kind of protocol.


I want to get an input matrix of pixels from my module to my code. I have used the function cv2.VideoCapture(1). But the program could not get a matrix from it.
Can anyone help me, please?

your issue is situated before OpenCV even comes into play.

first you need to figure out how to attach that camera to something like a computer or CPU.

then you need to check using system utilities that a camera peripheral was detected and is operating properly. all of that is the operating system’s job.

I connected the camera to the pc through a usb cable. Then I got a thermal imaging though an application supported by the producer. But I want to loop though the pixels to know the temperature in each one in order to detect a possible fire because I am building a small scale firefighting system. I want to use OpenCV to do this mission.

I think you said you couldn’t get that camera picture in any other program except the manufacturer’s program, right?

OpenCV’s VideoCapture has a large but finite list of backends.

you will probably have to use the manufacturer’s SDK, which gives you their API.

once you have the data, of course you can work on it with OpenCV.

yes a kind of, actually I just want to reach to the pixels matrix through OpenCV. until now I couldn’t to reach for it.

I have used this code to read the serial input from the cam:

import time
import serial

ser = serial.Serial(
        port='/dev/ttyUSB0',
        baudrate = 9600,
        timeout=1
)

while 1:
        x=ser.readline()
        print (x)

Then, the outputs were like that:

b'\xa6\x1a\xc6\xf8L\xad\xe7\x00\x00\xc1\xad\xa5\xc6D\xc6\xcc\xd6\x9ci\x8c\xceXg\x8c\xce\xa4\x86+\x8eX\x1a\x04\xe7\x86\xe3\xa5G\t\x01\xceHb\xe6\xb6\xc4\x8cJXdX\xac\x8c\xden\x18\x8d\x0c!\xc6\xce\xc6\x88\xdc\xde\xc6 \x82\x96\x8cZ\x12\xe3 \xb8Vc\xce\x84\x85\x05\x1a\x86\xc6\xc2\xadC\xcc\xcc\x0c\xad\x04\x00\xad\x8c\xa4\x04\xce\x8e\xb0\x8d\x0c\xa5\xa4\x85\xad$\x85\xcd\xa4\x8d\x01\xb4\x8c\x84\xad\x00\xcc\xc4HHJ`\x9c\x89\xc4\x8e\xc6\xc6D\xa4\x9c\xdc\x94\x94\xc4g\x08!\xad\xac\x1a\n'
b'\xce\xceZZ\x8e\xce\xce \xd6F\t\x89\xad\x85\x8c\x08hZ\xe2\xe6\xb6\xc6\x8cJ\xc6\xc6\x85\xach\x8e\x8cJ\x9c\x8d\xc6\x8c\x95\x8d\xdc\x9e\xc4\x1a\x8c(\xe4\x8c\x8c\x96\xcci\x9c\xc4\xa5($\xc6\x08\n'
b'\xe3\x04J\x18B\x08\xacC\xa4\xd4\x8cd\xce\xa5\x85\xc4b\x9e\x86,\xe0\xccXJX.\xcec\xa5\x86s\x84\x1aJ\r\xc4\x8c\xac\x84%\xceD\x9d\xccJ\x86(\x18\x08JD\xce\xccJZ\xef\x8c\xc4\x86\x08Z\xc6\x8e\x85e\xac \xa0\x852$\xad\xcce\xa5\x88\x9cn\xd4\x86\xc3%\xcc\x85G(t\n'
b'\x84\x18\xb0\x84\x1aB\xe0\xc6\xde\xcexb\x84\xc3\xe7L\xad(\xa4\x8c\x85B\x8c\xc4\x8c\xadJ\xc6\x8c\n'
b'\x08Z\xcc\x86Jx\xc6\x8c\x84\x08\xa4\x18\x00\xc4\x08\xa5\xac\x00\x8d4\xad\x96\x8cf\xde\xac\x8d"B\xe2\xa5\x05\x86\x86\x85<\x08\x8c\xceX\x86J\x8c\xc6\xa4(\xdc\x86\xcc\xc6gX\xc4\x86$\x9e\xc4\t\xe0\xc4\x84\x1a\xec\xc6\x86\xdex\xe3\xd6\x18j\x94\xcc\xc6$f\n'
b'\x08\xcc\xcc\x86c\x8c\x8c\x8eZZ\xc4\xce\x19+C( \xceHX\x8dgG\xac\x96,\x86\xc6\x18XX\xcc\x1a\x1a*\x94\x94\xc7\x8c0\x00\xcc\xa4C\x08\xc4\xce*\x86\xc6\x9cN\xde\n'
b'\x04\x08\xe6\x8c\xa4\x06d\xc3\x8c\xacf\x05\x84\xa4\x8c\x8c\xec\x8eJ\x85b\xc4\xc4\x8c\xa4\x1c\xce\x8e\x1a\x18\xa3\xce\xc4\r\x84\xd6\x1e,X\x08\x84\x84\xccbb\x89\x8e\x86\x8d\x8d\xec\xc6\x84\x84\x8c\x18\xc6\x84\xacm\xce\x8e\x86\x1a\x18(\tP\x8c5\x08\xcc\x84J(\x8e\xcc\x84\xc6eX\x1a\xccM\x08\n'

does that thing really speak serial at merely 9600 baud?

that looks like binary data. do not attempt to read that like it’s text (readline()).

I don’t know how to read it, can you help me please? because the code cannot see this module as a camera