Output of number of people from a thermal image
조회 수: 1 (최근 30일)
이전 댓글 표시
How is it possible to get number of people as output from a theral image?I've attached a thermal image.
댓글 수: 0
답변 (2개)
Image Analyst
2022년 3월 23일
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
Image Analyst
2022년 3월 23일
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.
yanqi liu
2022년 3월 23일
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
yanqi liu
2022년 3월 24일
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));
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!