How to perform an region growing on Edge detected image after edge detection?
2 次查看(过去 30 天)
显示 更早的评论
This is the code of edge detected image I have perform region growing on this image
function[vg]=coloredge(f)
sh=fspecial('sobel');
sv=sh;
Hx=imfilter(double(f(:,:,1)),sh);
Hy=imfilter(double(f(:,:,1)),sv);
Sx=imfilter(double(f(:,:,2)),sh);
Sy=imfilter(double(f(:,:,2)),sv);
Vx=imfilter(double(f(:,:,3)),sh);
Vy=imfilter(double(f(:,:,3)),sv);
gxx=Hx.^2+Sx.^2+Vx.^2;
gyy=Hy.^2+Sy.^2+Vy.^2;
gxy=Hx.*Hy+Sx.*Sy+Vx.*Vy;
A=0.5*(atan(2*gxy./(gxx-gyy+eps)));
G1=0.5*((gxx+gyy)+(gxx-gyy).*cos(2*A)+2*gxy.*sin(2*A));
A=A+pi/2;
G2=0.5*((gxx+gyy)+(gxx-gyy).*cos(2*A)+2*gxy.*sin(2*A));
G1=G1.^0.5;
G2=G2.^0.5;
vg=mat2gray(max(G1,G2));
0 个评论
回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!