Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.63 KB

README.md

File metadata and controls

45 lines (34 loc) · 1.63 KB

Sobel filter on grayscale pgm images

Repo that performs sobel filter on grayscale pgm images for edge detection purposes. Both binary (P2) and text (P5) formats are supported.

You can find sample pgm images on the links below:

Usage

First, say make to compile.

Pass in the input and desired output filenames with the flags x and o respectively. If you want to see X and Y gradients of the image, simply specify --export-gradients option afterwards.

./main -x [input file] -o [output file] --export-gradients (optional)

Examples

Original image

Gradients

X Y

Output image

Original image

Output image