Sitemap
Pnitya

Pnitya

From Pixels to Edges: Edge Detection Using Convolution on a DSP Board

3 min readOct 23, 2026

“A practical look at how a Sobel filter reveals object boundaries in a grayscale image “

By: Nitya Patel , Sanskruti Patel , Lipi Panthari

Guided by: Shubham Mundada, Dr. Reena Sonkusare and Dr. Kiran TALELE

Electronics and Telecommunication Engineering | Sardar Patel Institute of Technology, Mumbai

Introduction

How can a computer identify the outline of an object in an image?

One useful technique is edge detection, which highlights places where image brightness changes sharply. In our Digital Signal Processing (DSP) experiment, we implemented edge detection using two-dimensional convolution on the MicroDSP6748 board, based on the TMS320C6748 processor. The aim was to connect the theory of convolution with a practical implementation on DSP hardware.

Convolution and the Sobel operator

Convolution combines image pixels with a small matrix of coefficients called a kernel. A 3 × 3 kernel processes nine neighbouring pixels through multiplication and addition, producing one output value. Repeating this operation across the image creates the processed result.

Get Pnitya’s stories in your inbox

Join Medium for free to get updates from this writer.

We used the Sobel operator, which applies two 3 × 3 kernels. Gx responds to brightness changes across the horizontal direction and highlights many vertical boundaries; Gy responds to changes across the vertical direction and highlights many horizontal boundaries. We combined their absolute responses using E(i,j) = |Gx(i,j)| + |Gy(i,j)|. Each output value was limited to the 8-bit range of 0–255.

How we performed the experiment

First, we used Python, OpenCV and NumPy to convert a blurred skull image to grayscale and resize it to 64 × 64 pixels. The script exp10.py saved the 4,096 pixel values in a C header file, image_data.h, which was added to the Code Composer Studio (CCS) project.

The C program then processed each pixel on the DSP board. It examined the pixel’s 3 × 3 neighbourhood and accumulated the Sobel responses using repeated multiply-and-add operations, known as multiply-accumulate (MAC) operations. At image borders, the program reused the nearest valid pixel so it would not read outside the matrix. The resulting 64 × 64 output matrix was printed in the CCS console.

Finally, we copied the matrix into op.py. The Python script reconstructed an 8-bit grayscale image and enlarged it to 384 × 384 pixels for easier viewing.

Press enter or click to view image in full size

Results and learning

The output highlighted the skull outline, eye sockets, nose opening and jaw as bright edges, while relatively uniform areas appeared dark. Some edges looked thick and soft because the original image was blurred and reduced to 64 × 64 pixels. Strong responses were capped at 255, so some bright areas were saturated.

As a cross-check, we independently calculated the same Sobel operation on the host computer. Its output matched the DSP’s 64 × 64 matrix for all 4,096 pixels. This verified that the computed values were consistent with the intended algorithm.

Conclusion

This experiment demonstrated how two-dimensional convolution can turn image data into a useful edge map on a DSP board. We learned how kernels, MAC operations and border handling work together in an image-processing algorithm, and why checking the output matters. The work was limited to edge detection on a 64 × 64 image; processing speed and real-time performance were not measured. The same fundamentals provide a starting point for exploring more advanced image-processing techniques.

--

--