Output of number of people from a thermal image

3 vues (au cours des 30 derniers jours)
Neha Tom Merin
Neha Tom Merin le 23 Mar 2022
Commenté : yanqi liu le 24 Mar 2022
How is it possible to get number of people as output from a theral image?I've attached a thermal image.

Réponses (2)

Image Analyst
Image Analyst le 23 Mar 2022
Yes. First of all use the actual temperature image, not this pseudocolored RGB image. Then threshold at some temperature to get a binary image. Then call bwareafilt() to get rid of blobs that are too big or too small to be a person. Then call bwlabel() to count the number of blobs.
See my Image Segmentation Tutorial in my File Exchange:
  8 commentaires
Neha Tom Merin
Neha Tom Merin le 23 Mar 2022
What changes should be made if I dont have a colorbar for my image?
Image Analyst
Image Analyst le 23 Mar 2022
Then you can't convert to temperature. Or you could just assume some colormap. Otherwise you'll have to just work on the pseudocolor image (like yanqi did), but conversion from RGB to gray scale is not linear at all, so that method is not reliable. For example, the gray scale of one color may be the same as that of a completely different color. You'd be best off trying to construct some kind of colormap to convert RGB into temperature.

Connectez-vous pour commenter.


yanqi liu
yanqi liu le 23 Mar 2022
im = imread('https://ww2.mathworks.cn/matlabcentral/answers/uploaded_files/938099/rgb.png');
jm = rgb2lab(im);
bw = im2bw(mat2gray(jm(:,:,2)), 0.8);
bw = bwareaopen(bw, 500);
stats = regionprops(bw);
num = length(stats);
figure; imshow(im, []);
for i = 1 : num
hold on; rectangle('position', stats(i).BoundingBox, 'EdgeColor', 'g', 'LineWidth', 2)
end
title(sprintf('共%d个候选目标', num));
  2 commentaires
Neha Tom Merin
Neha Tom Merin le 23 Mar 2022
I tried for other images. But, it doesn't come out right. Attaching another one here.
yanqi liu
yanqi liu le 24 Mar 2022
yes,sir,it is one simple method for target image,so if we change image,may be should change some process step,such as
im = imread('https://ww2.mathworks.cn/matlabcentral/answers/uploaded_files/938954/gui.jpeg');
jm = rgb2lab(im);
bw = im2bw(mat2gray(jm(:,:,3)), 0.5);
bw = bwareaopen(imclearborder(bw), 1000);
stats = regionprops(bw);
num = length(stats);
figure; imshow(im, []);
for i = 1 : num
hold on; rectangle('position', stats(i).BoundingBox, 'EdgeColor', 'g', 'LineWidth', 2)
end
title(sprintf('共%d个候选目标', num));

Connectez-vous pour commenter.

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by