GitHunt
TH

thushanperera95/Edge-Detector

C implementation of the Sobel and Robert's Cross edge detection algorithms.

Edge Detector in C

Implementation of the Sobel and Robert's Cross edge detection algorithms.

Notes:

Only supports the .pgm file format. Feel free to add support for other file formats like .png
Deals with edges of the image by ignoring a 1 pixel border around the image.
Lower the value of 'threshold' in the 'process' function for better edge detection.

Build:

Run makefile

Usage:

./process -p .pgm -o .pgm [-s]
-s parameter to enable Sobel. The default is Robert's Cross.

Examples:
Lena Original

Alt text

Lena with Robert's Cross

Alt text

Lena with Sobel

Alt text

Languages

C98.5%Makefile1.5%

Contributors

MIT License
Created August 23, 2015
Updated October 19, 2025
thushanperera95/Edge-Detector | GitHunt