dilation code does not work

%dilation code
close all;
clear all;
clc;
A=imread( 'fingerprint.tif' );
%Structuring element
b = [0 1 0; 1 1 1; 0 1 0];
C=padarray(A,[0 3]);
D=false(size(A));
for i=1:size(C,1)
for j=1:size(C,2)-6
D(i,j)=sum(B&C(i,j:j+6));
end
end
figure(1),imshow(D);title('dilation');

9 Commenti

Rik
Rik il 8 Nov 2019
You aren't using your structuring element. Is that on purpose? And do you need it to be a loop?
aslan memo
aslan memo il 8 Nov 2019
Ihave error this step D(i,j)=sum(B&C(i,j:j+6));
darova
darova il 8 Nov 2019
What is wrong with it?
aslan memo
aslan memo il 8 Nov 2019
aa.PNG
KALYAN ACHARJYA
KALYAN ACHARJYA il 8 Nov 2019
Modificato: KALYAN ACHARJYA il 8 Nov 2019
What is "B" here?
You are trying to "&" operation on two different sizes matrices???
here
b & C(i,j:j+6)
aslan memo
aslan memo il 8 Nov 2019
b ıs the Structuring element
Rik
Rik il 8 Nov 2019
No, b is your structuring element, B doesn't exist. And you haven't explained if you need a loop or not.
aslan memo
aslan memo il 25 Dic 2019
thankyu @rik @kalyan im solved
Image Analyst
Image Analyst il 25 Dic 2019
Why not simply use imdilate()?

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su MATLAB Coder in Centro assistenza e File Exchange

Tag

Richiesto:

il 8 Nov 2019

Commentato:

il 25 Dic 2019

Community Treasure Hunt

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

Start Hunting!

Translated by