Skip to content

Instantly share code, notes, and snippets.

@ShivendraAgrawal
Created April 30, 2014 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShivendraAgrawal/dc2da3771afb5fbec3bf to your computer and use it in GitHub Desktop.
Save ShivendraAgrawal/dc2da3771afb5fbec3bf to your computer and use it in GitHub Desktop.
function [n2] = shivendra( image )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
rgb = imread(image) ;
gray = rgb2gray(rgb) ;
%(gray,'gray.jpg');
%imwrite(gray>180,'undilated.jpg');
%filteredgray = medfilt2(gray,[7 7]);
se = strel('ball',3,3);
dilatedgray = imdilate(gray,se);
bw = dilatedgray>180;
%imwrite(bw,'dilated.jpg');
%se = strel('ball',5,5);
%I = imread ('bw.jpg') ;
%I2 = imdilate(I,se);
n2 = nnz(bw) ;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment