Question: This program should be written in C Language This problem is Sobel image edge detection in C 3. THE PROBLEM IMAGE EDGE DETECTION (AS DESCRIBED
This program should be written in C Language





This problem is Sobel image edge detection in C
3. THE PROBLEM IMAGE EDGE DETECTION (AS DESCRIBED IN ASSIGNMENT 2) Given an mxm image A, the required task is to detect edges in the image. This type of operation is a standard practice in image processing and computer vision, and is a required step in tasks, such as automated object recognition by a robot or by a machine, and in shape retrieval and classification. It is also performed during the stage of image and video compression, for edge-based compression scbemes. For simplicity, we assume that the input image is always square (but this does not have to be the case). The required edge detection is performed using a 2D filtering mask as follows. Step 1: Filtering Define a 2D mask as an nx n matrix. For now we assume n is a small odd number, example -3, 5, or 7. For each nxn block we compute the product of the values in the mask with the corresponding position in the small block. We replace the value at the center of the small block from the image with the sum of the products. Specifically, if I(x,y) is the pixel value at position (x, y) in the image I, and E(x, y) is resulting edge response after the filtering using the mask w. The edge response is obtained as: E(x, y)= w( p, q)/(x + p, y + q). where a=(n-1)/2 The filtering is performed using a horizontal mask (wn) and a vertical mask (w) mask produces a component image, which are then combined to obtain the final edge response image. Each E(x, y)=IE,(x, y) + E,(x, y) For this assignment, we perform simple Sobel edge detection, with the masks defined by the following matrices: 1 -21 -1 0 1 01, w,=1-2 0 2 -1 0 1 3. THE PROBLEM IMAGE EDGE DETECTION (AS DESCRIBED IN ASSIGNMENT 2) Given an mxm image A, the required task is to detect edges in the image. This type of operation is a standard practice in image processing and computer vision, and is a required step in tasks, such as automated object recognition by a robot or by a machine, and in shape retrieval and classification. It is also performed during the stage of image and video compression, for edge-based compression scbemes. For simplicity, we assume that the input image is always square (but this does not have to be the case). The required edge detection is performed using a 2D filtering mask as follows. Step 1: Filtering Define a 2D mask as an nx n matrix. For now we assume n is a small odd number, example -3, 5, or 7. For each nxn block we compute the product of the values in the mask with the corresponding position in the small block. We replace the value at the center of the small block from the image with the sum of the products. Specifically, if I(x,y) is the pixel value at position (x, y) in the image I, and E(x, y) is resulting edge response after the filtering using the mask w. The edge response is obtained as: E(x, y)= w( p, q)/(x + p, y + q). where a=(n-1)/2 The filtering is performed using a horizontal mask (wn) and a vertical mask (w) mask produces a component image, which are then combined to obtain the final edge response image. Each E(x, y)=IE,(x, y) + E,(x, y) For this assignment, we perform simple Sobel edge detection, with the masks defined by the following matrices: 1 -21 -1 0 1 01, w,=1-2 0 2 -1 0 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
