0
  • 聊天消息
  • 系统消息
  • 评论与回复
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
创作中心

完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>

3天内不再提示

MLX90640红外热成像仪测温模块开发笔记(四)

工程监测 来源:工程监测 作者:工程监测 2022-07-22 09:33 次阅读

MLX90640 红外热成像仪测温模块开发笔记(四)损坏和不良像素的处理
如前“开发笔记(一)”所说,MLX90640 可能存在不超过 4 个像素的损坏或者不良像素,在温度计算过程完成后,这些不良像素点会得到错误的温度数据,对于处理这些不良数据 MLX 也给出了推荐方法和具体的函数。(其实就是找相邻的正常的温度数据取平均来代替不良数据)

pYYBAGLYqLqAVRUnAAhYW2N-cns992.png河北稳控科技MLX90640 红外热成像仪测温模块


前面开发笔记(一)的内容中所说的 API 库,里面缺少了对不良像素点的处理函数,在这里补上。
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{
for(int j=i+1; 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;
}
}
用法很简单,在开发笔记(三)MLX90640_CalculateTo(Frame, MLXPars, 0.95, Tr, Temp);之后添加两行即可。如下(斜体是添加的内容):
……
MLX90640_CalculateTo(Frame, MLXPars, 0.95, Tr, Temp); MLX90640_BadPixelsCorrection(MLXPars.brokenPixels, Temp, 1, MLXPars); MLX90640_BadPixelsCorrection(MLXPars.outlierPixels, Temp, 1, MLXPars);
……
/*
经过上面的处理后,Temp 中的损坏和不良像素点已经处理,Temp 数组中是处理完成后的
768 个温度值。
*/

pYYBAGK6lTGAd79hAAcQSZdFtVQ429.png河北稳控科技MLX90640 红外热成像仪测温成果展示

审核编辑:汤梓红

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
  • 红外热成像仪

    关注

    1

    文章

    99

    浏览量

    14766
  • 测温模块
    +关注

    关注

    0

    文章

    10

    浏览量

    2820
  • MLX90640
    +关注

    关注

    2

    文章

    22

    浏览量

    1037
收藏 人收藏

    评论

    相关推荐

    MLX90640 红外成像仪测温模块开发笔记(完整版)

    MLX90640 红外成像仪测温模块开发笔记(一)概述及
    的头像 发表于 08-01 15:12 1903次阅读
    <b class='flag-5'>MLX90640</b> <b class='flag-5'>红外</b>热<b class='flag-5'>成像仪</b><b class='flag-5'>测温</b><b class='flag-5'>模块</b><b class='flag-5'>开发笔记</b>(完整版)

    MLX90640红外成像仪测温传感器模块PC端操作教程

    MLX90640 红外成像仪测温传感器模块PC端操作教程
    的头像 发表于 08-12 14:08 2603次阅读
    <b class='flag-5'>MLX90640</b><b class='flag-5'>红外</b>热<b class='flag-5'>成像仪</b><b class='flag-5'>测温</b>传感器<b class='flag-5'>模块</b>PC端操作教程

    MLX90640红外成像-红眼睛相机(中文资料/开发笔记/测试源码)

    `以实际项目为主线的开发笔记,包括了资料准备、中文资料、API移植、成像算法、插值方法等最近用MLX90640捣鼓DIY了个红外相机,US
    发表于 10-15 19:18

    RK3288 mlx90640的驱动开发描述

    1、mlx90640的驱动开发描述mlx90640是一款红外热像仪模块, 32×24 像素, I2C 接口通信,兼容 3.3V/5V 电平。
    发表于 05-16 10:28

    MLX90640 开发笔记 成果展示 红眼睛相机

    MLX90640 开发笔记 成果展示-红眼睛相机 原理:几乎所有利用或者发射能量的物体在发生故障前都会产生发热现象。保证电气和机械系统运行可靠性的关键便是对能源的有效管理。现在,红外成像
    发表于 06-28 13:45

    MLX90640开发微型红外成像仪的优势与特点

    , 8*8 能干什么,也就能做个红外测温枪吧。 前段时间因为公司生产电路板测试需要,打算买一台红外成像仪测量电路板发热是否正常,商用的价格还是有些小贵的,我们电路板都不大所以就找了一台
    的头像 发表于 06-28 15:34 1297次阅读
    <b class='flag-5'>MLX90640</b><b class='flag-5'>开发</b>微型<b class='flag-5'>红外</b><b class='flag-5'>成像仪</b>的优势与特点

    红外成像仪测温模块MLX90640开发笔记(一)

    MLX90640 开发笔记(一)概述及开发资料准备 现在自己在做红外成像仪的越来越多了,两年前有个井下机电设备运行状态的科研项目,当时使用了
    的头像 发表于 07-19 14:50 1080次阅读
    <b class='flag-5'>红外</b>热<b class='flag-5'>成像仪</b><b class='flag-5'>测温</b><b class='flag-5'>模块</b><b class='flag-5'>MLX90640</b><b class='flag-5'>开发笔记</b>(一)

    MLX90640红外成像仪测温模块开发笔记(三)

    开始以 2Hz 的速率测量实时数据并更新到 RAM,自动更新状态寄存器。
    的头像 发表于 07-21 09:18 743次阅读
    <b class='flag-5'>MLX90640</b><b class='flag-5'>红外</b>热<b class='flag-5'>成像仪</b><b class='flag-5'>测温</b><b class='flag-5'>模块</b><b class='flag-5'>开发笔记</b>(三)

    MLX90640红外成像仪测温模块开发笔记(五)

    MLX90640 的 32*24=768 像素虽然比以往的 8*8 或者 16*8 像素提高了很多,但若直接用这些像素还是不能很好的形成热像图,为了使用这些像素点平滑成像就需要对其进行插值,使用更多的像素来绘制图像。
    的头像 发表于 07-25 09:23 757次阅读
    <b class='flag-5'>MLX90640</b><b class='flag-5'>红外</b>热<b class='flag-5'>成像仪</b><b class='flag-5'>测温</b><b class='flag-5'>模块</b><b class='flag-5'>开发笔记</b>(五)

    MLX90640 红外成像仪测温传感器模块开发笔记(六)

    MLX90640 红外成像仪测温传感器模块开发笔记(六)
    的头像 发表于 07-26 09:09 1183次阅读
    <b class='flag-5'>MLX90640</b> <b class='flag-5'>红外</b>热<b class='flag-5'>成像仪</b><b class='flag-5'>测温</b>传感器<b class='flag-5'>模块</b><b class='flag-5'>开发笔记</b>(六)

    MLX90640 红外成像仪测温传感器模块开发笔记(七)

    MLX90640 红外成像仪测温传感器模块开发笔记(七) 小结-注意事项  
    的头像 发表于 07-27 13:41 768次阅读
    <b class='flag-5'>MLX90640</b> <b class='flag-5'>红外</b>热<b class='flag-5'>成像仪</b><b class='flag-5'>测温</b>传感器<b class='flag-5'>模块</b><b class='flag-5'>开发笔记</b>(七)

    MLX90640 红外成像仪测温传感器模块开发笔记(九)

    MLX90640 红外成像仪测温传感器模块开发笔记(九)EEPROM、 RAM、寄存器说明 河
    的头像 发表于 07-29 09:46 868次阅读
    <b class='flag-5'>MLX90640</b> <b class='flag-5'>红外</b>热<b class='flag-5'>成像仪</b><b class='flag-5'>测温</b>传感器<b class='flag-5'>模块</b><b class='flag-5'>开发笔记</b>(九)

    MLX90640 红外成像仪测温传感器模块开发笔记(十)

    从第一篇开发笔记到今天最后MLX90640 红外成像仪测温传感器模块
    的头像 发表于 08-01 09:13 955次阅读
    <b class='flag-5'>MLX90640</b> <b class='flag-5'>红外</b>热<b class='flag-5'>成像仪</b><b class='flag-5'>测温</b>传感器<b class='flag-5'>模块</b><b class='flag-5'>开发笔记</b>(十)

    MLX90640 红外成像仪测温传感器 手机连接操作详细

    河北稳控科技MLX90640 红外成像仪测温传感器  手机 APP 软件 RedEye 连接 MLX90640
    的头像 发表于 08-10 10:03 2915次阅读
    <b class='flag-5'>MLX90640</b> <b class='flag-5'>红外</b>热<b class='flag-5'>成像仪</b><b class='flag-5'>测温</b>传感器 手机连接操作详细

    MLX90640开发笔记分享

    ,8*8 能干什么,也就能做个红外测温枪吧。前段时间因为公司生产电路板测 试需要,打算买一台红外成像仪测量电路板发热是否正常,商用的价格还是有些小贵的,我 们电路板都不大所以就找了
    发表于 09-18 17:48 4次下载