Question: Description : You need to implement a program to detect edges in an input image using Sobel method. o Input : The following value from

Description : You need to implement a program to detect edges in an input image using
Sobel method.
o Input : The following value from keyboard.
Input image file name (square size, and .ppm format (P6)).
threshold value for edge detection (integer).
o You can use one of the Sobel filters in the lecture slide.
o Your program needs to do the following basically:
Get input values above.
Perform ReadPPM for input image.
Perform CreatPPM for output image.
Initialize all pixel values of output image as white (255).
Convolute input image with the Sobel filter (Gx) you selected, and save the
results as an array, and convolute input image with the Sobel filter (Gy) you
selected, and save the results as a different array. You need to apply this step
to gray scale values of all pixels.
Apply an equation (i.e, Detect edges = sqrt ((outputs by Gx)2+(outputs by
Gy)2
) to the above arrays.
If the result of this formula is larger than the input threshold value, put a black
pixel into the output image created by CreatPPM above using PutRPixel,
PutGPixel, and PutBPixel.
Perform WritePPM for output images.
o Output : an image file (.ppm format, i.e., edge.ppm) as edge detection result, in
which edge lines are black pixels, and all others are white pixels

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!