Created
April 14, 2015 00:30
-
-
Save nelsondspy/a3630925e7d1d772540c to your computer and use it in GitHub Desktop.
morfología de imágenes binarias tema 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tema1() | |
SOL1(); | |
end | |
function SOL1() | |
I = im2bw( imread('binbolin.bmp') ); | |
%para que los elementos de interes tengan valor 1 y resto 0 | |
Ic = ~I; | |
%elemento estructurante con forma de disco de radio 2 | |
ES1 = strel('disk', 2); | |
%la erosion deja solo los circulos | |
R1= nimerosion(Ic, ES1, 1); | |
imshow(R1); | |
%se eliminan los circulos restandolos de la imagen principal, se dilata R1 | |
%para compensar la erosion aplicada anteriormente | |
R2 = Ic - nimdilatacion(R1,ES1,1 ); | |
%se vuelve a complementar para obtener el color original | |
R2 = ~R2; | |
%imagenes | |
figure; | |
imshow(R2); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment