红外图像是热辐射成像,由于场景中的目标与背景的温差相对较小,红外图像的动态范围大、对比度
低, 信噪比也较可见光图像的低。为了能够从红外图像中正确地识别出目标,必须对红外图像进行增强处理。一般红外探测器的性能区分于材料,氧化钒等高端的灵敏度 高相应的价格较贵,多晶硅的一般灵敏度要差但价格相对较低,也不会太受禁运封锁购买比较方便,也是非制冷做成的热像仪没有制冷电路会节省成本、降低功耗和 减小体积。一般探测精度为50mk左右,常温下的温度变化只有二三十度,产生的灰度响应变化一般也就几十个灰度级。这样的图像很难区别出各种图像内部的物 体,所以需要进行真个动态范围的拉伸,将图像处理的更家锐,图像清楚容易辨识。
clear;
clc;
%%%%%%%%%%%%%%单帧图像取值%%%%%%%%%%%%%
save3 =zeros(3,2,'uint16');
fid = textread('3006b.txt','%s');
fid1 = hex2dec(fid);
save3(:,:) = reshape(fid1,3,2);
sample1 = zeros(3,2,'double');
sample1 = save3(:,:);
%%%%%%%%%%%%%%%找出最大灰度%%%%%%%%%%%%%
line_buff = zeros(1,6,'uint16');
line_buff = reshape(sample1,1,6);
for i= 2:6
max = line_buff(1,1);
if line_buff(1,i) > max
max = line_buff(1,i);
end
end
%%%%%%%%%%%%%%%找出最小灰度%%%%%%%%%%%%%
for i= 2:6
min = line_buff(1,1);
if line_buff(1,i) < min
min = line_buff(1,i);
end
end
%%%%%%%%%%%%%%%设定拉伸的灰度级数%%%%%%%%%%%%%%%%%%%
H_tho = 256;
L_tho = 0;
%%%%%%%%%%%%%%%计算拉伸比率%%%%%%%%%%%%%%%%%%%%
sample2 = zeros(1,6,'uint16');
rat = (H_tho-L_tho)/(max-min);
for i=1:6
sample2(1,i) = line_buff(1,i)*rat;
end
for i= 1:6
sample2(1,i) =sample2(1,i) - min*rat;
end
%%%%%%%%%%%%%%%%显示效果%%%%%%%%%%%%%%%%%%%%%%%%
sample3 = reshape(sample2,3,2);
subplot(2,2,1),imshow(uint8(sample1));title('拉伸前');
subplot(2,2,2),imshow(uint8(sample3));title('拉伸后');
数据文件上传嫌麻烦就没传,有兴趣的可以找我索取
QQ:356636122