当前位置:网站首页>Mlx90640 infrared thermal imager temperature measurement module development notes (4)
Mlx90640 infrared thermal imager temperature measurement module development notes (4)
2022-07-25 09:55:00 【Hebei stable control technology】
MLX90640 Infrared thermal imager temperature measurement module development notes ( Four ) Handling of damaged and bad pixels
As before “ Development Notes ( One )” said ,MLX90640 There may be no more than 4 Damaged pixels or bad pixels , After the temperature calculation process is completed , These bad pixels will get wrong temperature data , For dealing with these bad data MLX The recommended methods and specific functions are also given .( In fact, it is to find the adjacent normal temperature data and take the average to replace the bad data )

Previous development notes ( One ) In the content of API library , There is no processing function for bad pixels , Add... Here .
int CheckAdjacentPixels(uint16_t pix1, uint16_t pix2)
{
int pixPosDif;
pixPosDif = pix1 - pix2;
if(pixPosDif > -34 && pixPosDif < -30)
{
return -6;
}
if(pixPosDif > -2 && pixPosDif < 2)
{
return -6;
}
if(pixPosDif > 30 && pixPosDif < 34)
{
return -6;
}
return 0;
}
float GetMedian(float *values, int n)
{
float temp;
for(int i=0; i<n-1; i++)
{
for(int j=i+1; j<n; j++)
{
if(values[j] < values[i])
{
temp = values[i]; values[i] = values[j]; values[j] = temp;
}
}
if(n%2==0)
{
return ((values[n/2] + values[n/2 - 1]) / 2.0);
}
else
{
}
return values[n/2];
}
int IsPixelBad(uint16_t pixel,paramsMLX90640 *params)
{
for(int i=0; i<5; i++)
{
if(pixel == params->outlierPixels[i] || pixel == params->brokenPixels[i])
{
return 1;
}
}
return 0;
}
void MLX90640_BadPixelsCorrection(uint16_t *pixels, float *to, int mode, paramsMLX90640
*params)
{
float ap[4]; uint8_t pix; uint8_t line; uint8_t column;
pix = 0;
while(pixels[pix] != 0xFFFF)
{
line = pixels[pix]>>5;
column = pixels[pix] - (line<<5);
if(mode == 1)
{
if(line == 0)
{
if(column == 0)
{
to[pixels[pix]] = to[33];
}
else if(column == 31)
{
}
else
{
}
}
to[pixels[pix]] = to[62];
to[pixels[pix]] = (to[pixels[pix]+31] + to[pixels[pix]+33])/2.0;
else if(line == 23)
{
if(column == 0)
{
to[pixels[pix]] = to[705];
}
else if(column == 31)
{
}
else
{
}
}
to[pixels[pix]] = to[734];
to[pixels[pix]] = (to[pixels[pix]-33] + to[pixels[pix]-31])/2.0;
else if(column == 0)
{
to[pixels[pix]] = (to[pixels[pix]-31] + to[pixels[pix]+33])/2.0;
}
else if(column == 31)
{
}
else
{
to[pixels[pix]] = (to[pixels[pix]-33] + to[pixels[pix]+31])/2.0;
ap[0] = to[pixels[pix]-33];
ap[1] = to[pixels[pix]-31]; ap[2] = to[pixels[pix]+31]; ap[3] = to[pixels[pix]+33];
to[pixels[pix]] = GetMedian(ap,4);
}
else
{
}
if(column == 0)
{
to[pixels[pix]] = to[pixels[pix]+1];
}
else if(column == 1 || column == 30)
{
to[pixels[pix]] = (to[pixels[pix]-1]+to[pixels[pix]+1])/2.0;
}
else if(column == 31)
{
}
else
{
0)
to[pixels[pix]] = to[pixels[pix]-1];
if(IsPixelBad(pixels[pix]-2,params) == 0 && IsPixelBad(pixels[pix]+2,params) ==
{
ap[0] = to[pixels[pix]+1] - to[pixels[pix]+2]; ap[1] = to[pixels[pix]-1] - to[pixels[pix]-2];
if(fabs(ap[0]) > fabs(ap[1]))
{
}
else
{
}
else
{
}
to[pixels[pix]] = to[pixels[pix]-1] + ap[1];
to[pixels[pix]] = to[pixels[pix]+1] + ap[0];
to[pixels[pix]] = (to[pixels[pix]-1]+to[pixels[pix]+1])/2.0;
}
}
}
pix = pix + 1;
}
}
It's easy to use , In Development Notes ( 3、 ... and )MLX90640_CalculateTo(Frame, MLXPars, 0.95, Tr, Temp); Then add two lines . as follows ( Italics are additions ):
……
MLX90640_CalculateTo(Frame, MLXPars, 0.95, Tr, Temp); MLX90640_BadPixelsCorrection(MLXPars.brokenPixels, Temp, 1, MLXPars); MLX90640_BadPixelsCorrection(MLXPars.outlierPixels, Temp, 1, MLXPars);
……
/*
After the above treatment ,Temp The damaged and bad pixels in have been handled ,Temp The array contains the processed
768 A temperature value .
*/

边栏推荐
- CDA Level1知识点总结之多维数据透视分析
- 基于PackNet的演进——丰田研究院(TRI)深度估计文章盘点(下)
- Hyperautomation for the enhancement of automation in industries 论文翻译
- ~3 CCF 2022-03-2 travel plan
- [data mining] Chapter 2 understanding data
- 【数据挖掘】第二章 认识数据
- Sort out personal technology selection in 2022
- 深度估计自监督模型monodepth2在自己数据集的实战——单卡/多卡训练、推理、Onnx转换和量化指标评估
- Coredata storage to do list
- ARM预备知识
猜你喜欢

Camera attitude estimation

MLX90640 红外热成像仪测温模块开发说明

Connection and data reading of hand-held vibrating wire vh501tc collector sensor

T5论文总结

Evolution based on packnet -- review of depth estimation articles of Toyota Research Institute (TRI) (Part 2)

First knowledge of opencv4.x --- image histogram matching

matlab绘图|坐标轴axis的一些常用设置
![[Android studio] batch data import to Android local database](/img/fc/758df0ba1c4c5b4f0eb8ccbcb4952c.png)
[Android studio] batch data import to Android local database

TensorFlow raw_rnn - 实现seq2seq模式中将上一时刻的输出作为下一时刻的输入

【深度学习模型部署】使用TensorFlow Serving + Tornado部署深度学习模型
随机推荐
FPGA基础进阶
Segmentation based deep learning approach for surface defect detection
CDA Level1多选题精选
CUDA 解释 - 深度学习为何使用 GPU
低功耗和UPF介绍
基于PackNet的演进——丰田研究院(TRI)深度估计文章盘点(上)
Learning new technology language process
First knowledge of opencv4.x --- image histogram matching
深度估计自监督模型monodepth2论文总结和源码分析【理论部分】
UI prototype resources
Yolov5 realizes target detection of small data sets -- kolektor defect data set
ARMV8 datasheet学习
First knowledge of opencv4.x --- image histogram drawing
括号匹配问题
First knowledge of opencv4.x --- drawing shapes on images
[deep learning] self encoder
matlab如何导入大量数据
Bracket matching problem
ISP图像信号处理
How to import a large amount of data in MATLAB