clc;
close all;
clear all;

% Read the test Image
% Convert the image to binary image

myorigimg = im2bw(rgb2gray(myorigimg));
subplot(3, 3, 1);
imshow(myorigimg);title('Originalimage');

% Create Structuring Element
se = strel('disk', 9);

% Perform dilation operation using imdilate command
% Display the dilated image

mydilatedimg = imdilate(myorigimg, se);
subplot(3, 3, 2);
imshow(mydilatedimg);title('Dilated image');

% Perform Erosion operation using imerode command
% Display the Eroded image

myerodedimg = imerode(myorigimg, se);
subplot(3, 3, 3);
imshow(myerodedimg);title('Eroded image');

% Find Internal Boundary
% Internal Boundary = Dilated Image AND Not of Eroded Image
% Display Internal Boundary

internalboundimg = mydilatedimg & ~ myerodedimg;
subplot(3, 3, 4);
imshow(internalboundimg,[]);title('Internal Boundary');

% Find External Boundary
% External Boundary = Dilated Image AND Not of Eroded Image
% Display External Boundary

externalboundimg = mydilatedimg & ~myorigimg;
subplot(3, 3, 5);
imshow(externalboundimg,[]);title('External Boundary');

% Find Morphological Gradient
% Morphological Gradient = Dilated Image AND Not of Eroded Image
% Display External Boundary

subplot(3, 3, 6);

% Perform Thinning operation using bwmorph() command
% Display the dilated image

thinf = bwmorph(myorigimg,'thin');
subplot(3,3,7);
imshow(thinf);title('Thinning of the Image');

% Perform Thickening operation using bwmorph()command
% Display the dilated image

thickf = bwmorph(myorigimg,'thicken');
subplot(3,3,8);
imshow(thickf);title('Thickening of the Image');

% Perform Skeletonozation operation using bwmorph()command
% with 8 iterations and display the dilated image

skelf100 = bwmorph(myorigimg,'skel',9);
subplot(3,3,9);
imshow(skelf100);title('Skeletonization - 9 iterations');
MATLAB CODE - for Morphological Image Processing Reviewed by Suresh Bojja on 10/21/2015 09:51:00 PM Rating: 5

Subjects & Labs

AC (6) ADS (2) ATMEL (6) AWP (5) C- Language (3) CAO (5) CDAC (1) CMC (6) CN (10) Control Sys (2) CVSM (2) DBMS (1) DC (5) DIP (17) DLD (10) DS (4) DSD&DICA (9) DSP (6) EDC (45) Embedded (7) EMWTL (6) ENERGY AUDIT (1) Engg.Chemistry (11) Faculty Labs (1) Fuzzy (3) II MID (1) LICA (1) Linux OS (1) Materials (1) MATLAB (27) MCU IDE 8051 (1) MEMS (4) MPMC (57) MTECH (6) MWE (2) OC (1) PDC (9) Projects (8) RADAR (1) Research (9) RVSP (3) SC (1) Softwares (1) SS (2) STLD (19) TCSS (1) TSSN (1) TV Engg (1) VHDL (4) VLSI (8) WCN (1) WSN (2)
Theme images by sebastian-julian. Powered by Blogger.