Roberts Cross Edge Detection and Implementing in Matlab

How It Works

Roberts Cross Edge Detection is actually a convolution. Therefore in order to perform Roberts operator we are gonna convolve the original image with the kernels below firstly:

How to Detect Edges with Roberts Operator in Matlab

Event though i didn’t use a built in function to perform Roberts Operator, usage is really simple.

im = imread('image.jpg');im_d = im2double(im);
im = rgb2gray(im_d);
hx = [+1 0; 0 -1];
hy = [0 +1; -1 0];
Gx = imfilter(im, hx);
imshow(Gy); figure;
Gy = imfilter(im, hy);
imshow(Gx); figure;
Gm = sqrt(Gx.^2 + Gy.^2);
imshow(Gm);

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store