I aware of some steps
canny edge detection
gradient for canny image
stroke width detection
connected component grouping.
I got struck while implementing 3rd step. Please any one give me clear steps with MATLAB code for 3rd step.
clc;
clear all;
close all;
I=imread('ss.bmp');
I1=rgb2gray(I);
ed=edge(I1,'canny',0.2);
[gx gy]=gradient(double(ed),0.5);
figure;
imshow(I);
gm=sqrt(gx.^2+gy.^2);
gdp=atan2(gy,gx);
figure;
imshow(gm);
[r c]=size(gdp);
%if pixel p lies on the stroke boundary,then gdp(gradient direction) must%%be perpendicular to the orientation of the stroke%for i=1:r
for i=1:r
for j=1:c
if gdp(i,j)==ed(i,j)
ray(i,j)=gm(i,j)+1*gdp(i,j);
end
end
end
In above code after finding gradient magnitude and direction, after that i need to consider gradient direction gdp of edge pixel p.then i need to follow the ray, ray=p+n.gdp, for n>0 until another edge pixel q is found. Please help me how to implement these steps.
I aware of some steps
I got struck while implementing 3rd step. Please any one give me clear steps with MATLAB code for 3rd step.
In above code after finding gradient magnitude and direction, after that i need to consider gradient direction gdp of edge pixel p.then i need to follow the ray, ray=p+n.gdp, for n>0 until another edge pixel q is found. Please help me how to implement these steps.