Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
Fuzzy inferecne filter for image

Subject: Fuzzy inferecne filter for image

From: Twilighter

Date: 25 Jul, 2011 17:19:09

Message: 1 of 1


i'm struggling with this filter, and i really need someone to show me how i can do it...

just the idea, maybe i'm getting it right or wrong

i need someone to tell me even the idea of it how to go through it

i just noticed that there is no much fuzzy logic questions here & even most of them regarding this area are not answered

Please Please Help me in that

i have those rules

R1: If more of xi are Very High Then En(xi) is Very High.
R2: If more of xi are High Then En(xi) is High.
R3: If more of xi are Medium Then En(xi) is Medium.
R4: If more of xi are Low Then En(xi) is Low.
R5: If more of xi are Very Low Then En(xi) is Very Low.

more is an S function 1/ 1 + exp ^ - (axi -b)

En = sum of all rules multiplied by a constant vector [1 0.8 0.6 0.4 0.2]

xi a pixel in na image ...

how can i do something like this using FIS

i wrote my own code but i see that the En output depends on all the five rules, and the En should be calculates from the rules but how can i apply the IF ... Then ...
it's like recursive ....

this is a fuzzy filter .... and this is the part i cant do, more details are in this paper

what i have done was to find the 3x3 window pixel and i loop through every 9 pixel and i make it the i/p of my FIS filter which i'm not sure of the way i implemented it
and that's my question

i made a matrix which each colum in it represents 9 pixels which is the 3x3 neighborhood so the matrix for my 64x64 image is m x n
m is 9 pixel & i have n =4096

[m,n] = size(NFC);

tri_param = [0.2 0.4 0.6;
             0.4 0.6 0.8;
             0.6 0.8 1];
trap_param = [-inf -0.2 0.2 0.4;
              0.8 1 1.4 inf]
          % Applying the Fuzzy inference algorithm
          % take the pixel 3x3 window and determine the memership
          % degree of each of the pixels within the 5 i/p memebership

for i = 1:1:n
    ante_mf = zeros(5,9);
    R = zeros(5,1);
    xi = NFC(:,i);
    ante_mf(1, :) = trapmf(xi',trap_param(1,:));
    ante_mf(2, :) = trimf(xi',tri_param(1,:));
    ante_mf(3, :) = trimf(xi',tri_param(2,:));
    ante_mf(4, :) = trimf(xi',tri_param(3,:));
    ante_mf(5, :) = trapmf(xi',trap_param(2,:));
    z = xi ./ 9; % the more i/p of xi/total number of xi
    for j = 1:5
        min_mf = min(min(ante_mf(j,:)));
        %indx = find(ante_mf(j,:)==min_mf);
        sigValue = sigmf(z(5),[alpha beta]);
        MoreMF = S_More(z(5),alpha, beta);
        R(j) = min_mf .* MoreMF ;
    En(i) = sum (Ck.*R);

please tell me how can i modify this code so it will fit the logic i nthe paper cause this is incomplete cause i didnt apply the Rules on the output,

If more of Xj are Very High, then En (xj) is Very High.

En(xj) is very high is not computed

 i really dunno how to explain it ....

i hope i explain it fully

thank you for any help ...
know it's very valuable for me

with hope to receive any help in that with god well

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us