Finding the threshold of thermal images

조회 수: 1 (최근 30일)
asaf omer
asaf omer 2022년 2월 15일
댓글: yanqi liu 2022년 2월 16일
Hello.
I have some thermal images and i wanna find the optimal thresholds,is there a command that can can help with this?
So far I didnt find something usefull.
thanks

답변 (1개)

Image Analyst
Image Analyst 2022년 2월 15일
There is no optimal threshold. You have to decide what temperature range you're interested in. An image just has a bunch of temperatures in it. How could it possibly know that you're interested in the range from 240 degrees C and hotter? It can't. Only you would know that.
By the way, if you need to convert a pseudocolored image into a temperature image, see my attached demo.
  댓글 수: 3
Image Analyst
Image Analyst 2022년 2월 15일
You can find the max of the histogram and fall down a certain amount from there, like until it gets to 2% of the max:
[counts, edges] = histcounts(thermalImage);
[maxCount, indexOfMax] = max(counts);
thresholdLevel = 0;
for k = indexOfMax : length(counts)
if counts(k) < 0.02 * maxCount
thresholdLevel = edges(k);
end
end
or you could try my attached triangle threshold method, which is good at finding the "corner" of skewed histograms.
yanqi liu
yanqi liu 2022년 2월 16일
yes,sir,may be use cumsum to get the target rate
clc; clear all; close all;
thermalImage = imread('cameraman.tif');
[counts,centers] = hist(thermalImage(:), 0:255);
counts2 = cumsum(counts);
for k = 1 : length(counts2)
if counts2(k) < 0.5 * counts2(end)
else
% find 50% rate
thresholdLevel = centers(k);
break;
end
end
bw = thermalImage < thresholdLevel;
figure; imshow(bw);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by