Using an Arduino IR camera to plot a heatmap
5 次查看(过去 30 天)
显示 更早的评论
I have an arduino code that takes values from an IR camera a couple of times a second and converts it into a matrix with temperature values.
Ex-
[ 22.2 22.2 22.1 22.0 21.2 21.0
22.2 22.0 21.9 21.8 21.9 21.8
22.1 22.1 21.9 21.8 21.9 21.8
22.0 22.1 21.8 21.7 21.8 21.8
22.0 22.2 21.9 21.8 21.9 21.8 ]
I need to take these values, either while its connected to the arduino(or after the arduino saves the stuff above as a .txt or .csv file, whichever is easier), and plot those values on a colormap, which shows a color dependent on the value, to show the temperature like taking a picture with an infrared camera would.
I have tried looking at how to make colormaps, connecting an arduino device to matlab, and other stuff but still cant figure anything out. Any help would be appreciated!
1 个评论
Hussein Hamie
2022-11-4
Hi, I am doing a very similar project did you end up figuring out how to implement this as a live feed with the arduino connected to matlab?
回答(1 个)
Kaashyap Pappu
2019-11-26
There are multiple ways to do this. If you are saving data in a text file and then want to load it into MATLAB, you can use fscanf to load the matrix, into MATLAB workspace, into a variable.
Alternatively, you can download the MATLAB Support Package for Arduino Hardware and follow the steps here to set up serial reception of data from Arduino Hardware. Note that addition configuration may be required on the board to facilitate serial communication between the Arduino board and MATLAB.
Finally, use the colormap function on the image to get the desired output. If the matrix does not have RGB values, you may have to use imagesc to get the image plot.
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Red 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!