I have some thermal images and i need to find the maximum temperature each images and locate that pixel in the image
1 view (last 30 days)
Show older comments
I have some thermal images and i need to find the maximum temperature each images and locate that pixel in the image and to highlight the poistion of that area/ pixel in each image by giving some identification symbols or circles and store each image .
Kindly please help to solve this problem'
Thanks in advance
Jinu
0 Comments
Answers (1)
DGM
on 31 Mar 2023
Edited: DGM
on 31 Mar 2023
There are a number of demos for how to do this. I'm pretty sure you've seen some, so I'm assuming that you know the limitations.
I'm assuming that this is an example of the images you have:
If so, then:
N = 256; % number of quant levels
% the extracted colortable representation
CT0 = [1 0.0431 0; 1 0.0745 0; 1 0.106 0; 1 0.153 0; 1 0.184 0; 1 0.216 0; 1 0.263 0; 1 0.294 0;
1 0.325 0; 1 0.373 0; 1 0.404 0; 1 0.435 0; 1 0.482 0; 1 0.514 0; 1 0.545 0; 1 0.592 0;
1 0.624 0; 1 0.655 0; 1 0.702 0; 1 0.733 0; 1 0.765 0; 1 0.812 0; 1 0.843 0; 1 0.875 0;
1 0.922 0; 1 0.953 0; 1 0.984 0; 0.969 1 0; 0.937 1 0; 0.906 1 0; 0.859 1 0; 0.827 1 0;
0.796 1 0; 0.749 1 0; 0.718 1 0; 0.686 1 0; 0.639 1 0; 0.608 1 0; 0.576 1 0; 0.529 1 0;
0.498 1 0; 0.467 1 0; 0.42 1 0; 0.388 1 0; 0.357 1 0; 0.31 1 0; 0.278 1 0; 0.247 1 0;
0.2 1 0; 0.169 1 0; 0.137 1 0; 0.0902 1 0; 0.0588 1 0; 0.0275 1 0; 0 1 0; 0 1 0.0431;
0 1 0.0745; 0 1 0.106; 0 1 0.153; 0 1 0.184; 0 1 0.216; 0 1 0.263; 0 1 0.294; 0 1 0.325;
0 1 0.373; 0 1 0.404; 0 1 0.435; 0 1 0.482; 0 1 0.514; 0 1 0.545; 0 1 0.592; 0 1 0.624;
0 1 0.655; 0 1 0.702; 0 1 0.733; 0 1 0.765; 0 1 0.812; 0 1 0.843; 0 1 0.875; 0 1 0.922;
0 1 0.953; 0 1 0.984; 0 0.969 1; 0 0.937 1; 0 0.906 1; 0 0.859 1; 0 0.827 1; 0 0.796 1;
0 0.749 1; 0 0.718 1; 0 0.686 1; 0 0.639 1; 0 0.608 1; 0 0.576 1; 0 0.529 1; 0 0.498 1;
0 0.467 1; 0 0.42 1; 0 0.388 1; 0 0.357 1; 0 0.31 1; 0 0.278 1; 0 0.247 1; 0 0.2 1; 0 0.169 1;
0 0.137 1; 0 0.0902 1; 0 0.0588 1; 0 0.0275 1; 0 0 1];
x0 = linspace(0,1,110);
xf = linspace(0,1,N);
CT = interp1(x0,flipud(CT0),xf); % interpolate to form new CT
% this is the approximate nonlinear temperature scale from the image
% there's no ticks, and the labels don't line up uniformly
% so there's no way to know where they're actually supposed to be
% this is just a guess.
t0 = [30 51.2 60.6 68.8 75];
xt0 = (0:4)/4; % guess that they're supposed to be uniformly spaced
xt = linspace(0,1,N);
t = interp1(xt0,t0,xt,'pchip'); % interpolate to form new temp scale
plot(xt,t)
% crop the data region from composite image
inpict = imread('80-2_1922.png');
inpict = imcrop(inpict,[2 2 639 119]);
imshow(inpict)
% convert the pseudocolor image into an index array
T = rgb2ind(inpict,CT,'nodither');
% convert the indexes into estimated temperature values
T = t(double(T)+1);
imshow(T,[])
% find the max temperature in the image
maxT = max(T(:));
% since there is no one pixel of maximum temperature
% create a mask that describes the regions with that temperature
mask = T == maxT;
% create a colored overlay for visualization
alpha = 0.8; % overlay opacity
fgcolor = [1 0.5 0.3]; % overlay color
alpha = mask*alpha;
outpict = alpha.*permute(fgcolor,[3 1 2]) + (1-alpha).*mat2gray(T);
imshow(outpict)
0 Comments
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!