フィルターのクリア

otsu's code

1 回表示 (過去 30 日間)
shaimaa mohamed
shaimaa mohamed 2017 年 8 月 29 日
回答済み: Image Analyst 2017 年 8 月 29 日
I need code to segment red area only from this image
  1 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2017 年 8 月 29 日
編集済み: KALYAN ACHARJYA 2017 年 8 月 29 日
Otsu code use for Global Thresholding.
[T SM]=graythresh(input gray image);
Where T=Threshold>output from following code function otsuthresh SM=Separability Measure
Source: Gonzalez Book (Image Processing+Matlab)

サインインしてコメントする。

回答 (2 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2017 年 8 月 29 日
%if true
function [T,SM]=otsuthresh(h);
h=h/sum(h);
h=h(:);
i=(1:numel(h))';
P1=cumsum(h);
m=cumsum(i.*h);
mG=m(end);
sigSquared=((mG*P1-m).^2)./(P1.*(1-P1)+eps);
maxSigsq=max(sigSquared);
T=mean(find(sigSquared==maxSigsq));
T=(T-1)/(numel(h)-1);
SM=maxSigsq/(sum(((i-mG).^2).*h)+eps);
% end

Image Analyst
Image Analyst 2017 年 8 月 29 日
shaimaa, you would NOT use Otsu for that. You need to do it "manually". First identify the values of the starting and ending thermal values in your image. Let's say the red range starts at 32 degrees and ends at 33 degrees. So then to segment out those temperatures, you'd do
binaryImage = themalImage > 32 & thermalImage < 33;

Community Treasure Hunt

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

Start Hunting!

Translated by