I m currently working on fuzzy based approach in image segmentation using an ultrasound image. I hv already generated the membership function. I m having a difficulty to generate the function which expresses entropy of the fuzzy set.

H(x) = 1/(M*N) ΣΣ Sn(μ(g(i,j))
(i=1,2,...M; j=1,2,....N)
How to execute this function? Pls provide me the code. Also I would like to ask about the mapping of ultrasound image from intensity space domain (g(i,j)) to fuzzy domain (μ(g(i,j))?

2 Comments

List the toolboxes you have in the Products section below, for example Fuzzy Logic or Image Processing.
I m using both fuzzy logic and Image processing toolbox. I hv used Fuzzy logic toolbox for generatins S-membership function using 'smf' command.

Sign in to comment.

Answers (1)

hi, try this function :
function h = fuzzy_entropy(x,n)
% FUZZY_ENTROPY : Computes the first order estimate of the entropy matrix
%
% H = FUZZY_ENTROPY( X, N ) returns the first order estimate of matrix X
% with N symbols ( N =256 if omitted) in bits /symbol . The estimate assume
% statistically independant source caracterized by the relative frequency
% of the occurance of the element in X
error(nargchk(1,2,nargin)) % Check Input Arguments
if nargin < 2
n=256; % default n
end
x=double(x);
xh=hist(x(:),n); % Compute N-bin histogram
xh=xh /sum(x(:)); % Compute probablities
% Make mask to eliminate zeros since log2(0)=-Inf
i=find(xh);
h=-sum(xh(i).*log2(xh(i))+((1-xh(i)).*log2(1-xh(i)))); % Compute entropy

Categories

Find more on Fuzzy Logic Toolbox in Help Center and File Exchange

Asked:

on 26 Feb 2013

Community Treasure Hunt

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

Start Hunting!