Joined: Tue Mar 27, 2007 10:55 pm Posts: 2279 Location: Earth Has thanked: 39 time Have thanks: 61 time
sobel operator is used for edge detection using first derivative.Horizontal and vertical components used .Gradient is the square root it taken for the sum of two components .
Code:
clc; %% create a new figure to show the image . newImg = imread('Water lilies.jpg'); figure(1); %% show the loaded image. imshow(newImg);
figure(2); %% convert RGB to gray scale. I = rgb2gray(newImg) imshow(I); %% apply sobel filter. size(I) BW = edge(I,'sobel',0.1); imshow(BW);
Attachments:
sobel.GIF [ 54.99 KiB | Viewed 2504 times ]
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )