thermal image processing, the maximum temperature area isolation

1 view (last 30 days)
Hello, I have problem with matlab code. I have JPG image file and I need that image will be convert to mat file. The second step is the temperature value research. In the face area i need to found the temperature which is bigger than indicates significance ( for ex. 30 C) and market that area in the picture. I try to write some code but I have only that:
clear all; close all; clc;
addpath(genpath(pwd));
Thermo = 'C:\Users\Dovile\Desktop\bakalauras\MatLab\';
if ~isdir(Thermo)
errorMessage = sprintf('Error: The following folder does not exist:\n%s', Thermo);
uiwait(warndlg(errorMessage));
return;
end
filePattern = fullfile(Thermo, '*.jpg');
jpegFiles = dir(filePattern);
result = cell(1,100);
for k = 1:length(jpegFiles)
maxvalue = 0;
maxvalue_g = 255;
maxmalue_b = 255;
max_x = 0;
max_y = 0;
baseFileName = jpegFiles(k).name;
fullFileName = fullfile(Thermo, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
imageArray= imread(fullFileName);
[x,y,z]=size(imageArray);
I1=rgb2gray(imageArray);
[x,y,z]=size(I1);
for j = 1:x
for i = 1:y
if I1(j,i) > maxvalue
maxvalue = I1(j,i);
max_x = j;
max_y = i;
end
if imageArray(j,i,1) > 150
imageArray(j,i,:) = [255,0,0];
end
end
end
imageArray(max_x,max_y,:) = [0,0,0];
%I1=rgb2gray(imageArray); figure,imshow(I1); title('gray converted Image')
colormap('default'); % set colormap
result{k} = imageArray;
figure,imagesc(result{k}); % draw image and scale colormap to values range
hold on;
plot(max_x,max_y,'g.','MarkerSize',20)
title(fullFileName)
colorbar;
end
save kita.mat result;
load kita.mat
%image(k)

Answers (2)

Dovile
Dovile on 6 May 2014
Can anyone help me?

Dovile
Dovile on 8 May 2014
Anyone?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!