I have this program that work fine until it reach the evaluation indicating an evalfis error like Error using evalfismex

1 次查看(过去 30 天)
clc;close all;clear all
Irgb = imread('greens.jpg');
Igray = rgb2gray(Irgb);
figure
image(Igray,'CDataMapping','scaled')
colormap('gray')
title('Input Image in Grayscale')
I = im2double(Igray);
Gx = [-1 1];
Gy = Gx';
Ix = conv2(I,Gx,'same');
Iy = conv2(I,Gy,'same');
figure
image(Ix,'CDataMapping','scaled')
colormap('gray')
title('Ix')
figure
image(Iy,'CDataMapping','scaled')
colormap('gray')
title('Iy')
fis = newfis('edgeDetection');
sx = 0.1; sy = 0.1;
fis = addvar(fis,'input','Ix',[-1 1]);
fis = addmf(fis,'input',1,'zero','gaussmf',[sx 0]);
fis = addvar(fis,'input','Iy',[-1 1]);
fis = addmf(fis,'input',2,'zero','gaussmf',[sy 0]);
wa = 0.1; wb = 1; wc = 1; ba = 0; bb= 0; bc = 0.7;
fis = addvar(fis,'output','Iout',[0 1]);
fis = addmf(fis,'output',1,'white','trimf',[wa wb wc]);
fis = addmf(fis,'output',1,'black','trimf',[ba bb bc]);
rulelist=[1 1 1 1 1; 0 0 2 1 1];
fis=addrule(fis,rulelist);
figure
subplot(2,2,1)
plotmf(fis,'input',1)
title('Ix')
subplot(2,2,2)
plotmf(fis,'input',2)
title('Iy')
subplot(2,2,[3 4])
plotmf(fis,'output',1)
title('Iout')
Ieval = zeros(size(I));
for ii = 1:size(I,1)
Ieval(ii,:) = evalfis([(Ix(ii,:));(Iy(ii,:))]',fis);
end
figure
image(I,'CDataMapping','scaled')
colormap('gray')
title('Original Grayscale Image')
figure
image(Ieval,'CDataMapping','scaled')
colormap('gray')
title('Edge Detection Using Fuzzy Logic')

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fuzzy Inference System Modeling 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by