Edge Detection in Images with Wavelet Transform

Note: Please Scroll Down to See the Download Link.

Introduction

Edge detection is used in computer vision applications for contours extraction of objects. The usual method is to use convolution operation of the image with complex filters like Sobel or Prewitt.

Sobel Filter

Real
1.0  0.0 -1.0
2.0  0.0 -2.0
1.0  0.0 -1.0
Imaginary
1.0  2.0  1.0
0.0  0.0  0.0
-1.0 -2.0 -1.0

Prewitt Filter

Real
0.5  0.0 -0.5
0.5  0.0 -0.5
0.5  0.0 -0.5
Imaginary
0.5  0.5  0.5
0.0  0.0  0.0
-0.5 -0.5 -0.5

You may extract the edges for example with my vec2D wrapper described in my article Vector Class Wrapper SSE Optimized for Math Operations.

However unless integer optimized, floating point operations might take quite a long time. With wavelet transform, you might achieve similar results with a few mathematical operations. For example, Haar transform of the image provides details of that image contained in the high frequency bands very similar in appearance if you used X and Y difference filters on the same image.

X Difference Filter

0.0  0.0  0.0
0.5  0.0 -0.5
0.0  0.0  0.0

Y Difference Filter

0.0  0.5  0.0
0.0  0.0  0.0
0.0 -0.5  0.0

If we keep the details of the image obtained with Haar transform, remove the coarse-grained low frequency component and perform image reconstruction, we obtain the edges of the objects present in the image.

Background

Image processing background for Edge Detection is needed. You might also consult my articles about wavelet analysis of image data: 2D Fast Wavelet Transform Library for Image Processing and Fast Dyadic Image Scaling with Haar Transform.

Using the Code

The code and the demo application are used from my article 2D Fast Wavelet Transform Library for Image Processing where you may find details on how to run the code and use the library. In this project, I added several edge specific operations so you may experiment with different wavelet filters, scales, and denoising thresholds to select the best combination. Below I demonstrate the daub1 filter application, which is the filter used in Haar transform.

Open the image and transform it to 1, 2 or 3 scales. You might add the threshold to remove the noise. 

SOFTWARE SPECIFICATION:-

 OPERATING SYSTEM                      :  Windows XP Professional

 FRONT END                                      :  Microsoft Visual Studio .Net 2010

 CODING LANGUAGE                      :  C# .Net

HARDWARE SPECIFICATION:-

    SYSTEM                                             :   Pentium III 700 MHz

    HARD DISK                                       :   40 GB

    MONITOR                                           :   15 VGA colour monitor

    RAM                                                     :   256MB

Click here to download Edge Detection in Images with Wavelet Transform source code