Continuous Image Acquisition and Edge Detection Using Morphological Filters and Classical Edge Detection Algorithms in Labview

DOI : 10.17577/IJERTV6IS120131

Download Full-Text PDF Cite this Publication

Text Only Version

Continuous Image Acquisition and Edge Detection Using Morphological Filters and Classical Edge Detection Algorithms in Labview

Panchami S V

    1. ech Student,

      Digital Communication and Networking, GSSSIETW, Mysuru

      Dr. M V Sathyanarayana

      Professor and Head of the Dept, ECE Dept,

      GSSSIETW, Mysuru

      Senthilkumar S

      Senior Software Engineer, Kemsys Technology, Mysuru

      Abstract Edges are nothing but outline of an object. The boundary between the object and its background form an edge, hence by identifying the Edges of an object accurately we can measure basic properties like Area, Perimeter and Shape Therefore, edge detection is used to find the discontinuities in surface orientation, changes in material properties and variations in scene illuminations. In this paper, implementation of edge detection of real time video using both classical and morphological methods are done using LabVIEW, here we have compared the results of First order derivatives of Traditional edge detection methods with morphological edge detection method.

      Keywords Edge detection, LabVIEW, Dilation, Erosion, Morphological operations


        The region of interest where there is sudden change in intensity, those regions are called edges and corners. In machine vision and image processing these features will play an important role in object identification. Edge detection is ability to determine the edges of an object and it is a primary step in image enhancement procedures, the abrupt change in gray level intensity values of neighbor pixel will be an edge, therefore when there is highest difference between two neighbors pixels then there will be an edge is detected. The intensity of the pixels at the borders of a shadow also translates from a low to a high value. Due to this, any edge detection technique detects this outline of shadows as edges. This results in detection of false edges. Similarly, when there is a little change in the intensity between two objects, some edge detectors may fail in detecting this small difference as an edge of the objects [1], in many computer vision and image processing systems the Edge detection and corner detection are essential tasks. Edge detection has many applications like motion tracking, object recognition and stereo matching. The main objective of edge detector is to detect both strong as well as weak edges in order to do so various methods like traditional and mathematical morphology operators are being used.

      2. MATHEMATICAL MORPHOLOGY Imperfections may be present in binary images. In

        particular, the noise and texture will cause distortion to the binary images to the regions produced by simple thresholding. Morphology is nothing but the study of the structure of an object. Morphological filters will simplify the segmented

        image by smoothing out the outlines of an object using filling small holes and eliminating small projections. Morphological image processing will work in the objective of removing these imperfections by accounting for the form and structure of the image. These techniques can be extended to gray scale images also. Mathematical morphology is a new mathematical technique which is used to process and analyze the images. The process will be in the mathematical way which means that the analysis is based on theory, topology and lattice algebra, function and so on. Another application of Mathematical Morphology is to filter the images, it is a well known non- linear filter for image enhancement. It will not use mathematical modeling instead it used set theory to analyze the images. Mathematical Morphology will be well suited for processing binary images because the method will relay on only on the relative ordering of the pixel values not on their numerical values.

        1. Morphological Operations

          The basic morphological operators are as below:

          1. Erosion: Shrinking the foreground

          2. Dilation: Expanding the foreground

        Dilation: The dilation process is performed by laying the structuring element B on the image A and sliding it across the image in a manner similar to convolution [2]. The difference is in the operation performed. The different steps of dilation are:

        1. if the origin of the structuring element coincides with a white pixel in the image, there is no change; move to the next pixel.

        2. if the origin of the structuring element coincides with a black in the image, make black all pixels from the image covered by the structuring element. The Notation is as under:

        Figure 1: (a)Original (b) Applied mask (c)Dilated Image

        Erosion: The erosion process is similar to dilation, but we turn pixels to white, not black. As before, slide the structuring element across the image and then follow these steps:

        1. if the origin of the structuring element coincides with a white pixel in the image, there is no change; move to the next pixel.

        2. If the origin of the structuring element coincides with a black pixel in the image, and at least one of the black pixels in the structuring element falls over a white pixel in the image, then change the black pixel in the image (corresponding to the position on which the centre of the structuring element falls) from black to a white. The Notation is as under:

        Figure 2: (a)Original (b) Applied mask (c)Eroded Image

      3. TRADITIONAL OPERATIONS Some traditional operators are as below:

        1. First order derivative / gradient methods are as follows:

          1. Roberts operator

          2. Sobel operator

          3. Prewitt operator

        2. Second order derivative:

          1. Laplacian

          2. Laplacian of Gaussian

          3. Difference of Gaussian

        3. Optimal edge detection:

          1. Canny edge detection

        Roberts edge detection is oldest edge detection method amongst all, it is more used where simplicity and speed are in main concern for hardware implementation, in this method the horizontal and vertical edges are detected individually and then they are combined to get complete result of edge detection. The Roberts detector uses the following masks to approximate digitally the first derivatives as difference between adjacent pixel [2].

        Figure 5: Prewitt Operator

        Sobel operator is very effective in edge detection, operator will convolve the image with a small, separable and integer valued filter in horizontal and vertical, therefore relatively inexpensive in terms of computations. The operator uses 33 masks which are convolved with original image to calculate approximations of the derivatives one for horizontal and one for vertical are as follows [2].

        Figure 4: Sobel Operator

        Prewitt operator is the oldest and easy to understand in edge detection of images. The Prewitt edge detector uses the following mask to approximate digitally the first derivatives of horizontal and vertical. [2]

        Figure 5: Prewitt Operator

      4. LABVIEW

        LabVIEW is a graphical programming language. Programmers work with two views:

        a front-panel view and a schematic diagram view[3]. Since the front panel view is a necessary part of the integrated Development Environment (IDE), developing human machine Interfaces (HMI) is practically automatic. In fact, it actually is automatic, but the automatically generated HMIs are badly organized. Much of the programming effort goes into prettying up the HMI to make it communicate better to humans.

        A. Advantages of LabVIEW


          Reduced time to discovery get results faster.

        1. Reduced time to prototype create a functional prototype in less time.

        2. Reduced time to market productize an idea in less Time.

        3. Smoother technology transfer process use the same tools as industry to help achieve a smoother and more efficient technology transfer process.

        4. Protection of intellectual property using embedded, field-programmable gate array (FPGA)-based technology.

        5. Multidisciplinary development encourage researchers

          from different disciplines to contribute to the project using the same development tools [3].

        6. Improved simulations achieve better/faster prototyping, hardware-in-the-loop (HIL) simulations, and proofs of concept (POCs).


          1. Software requirements

            Software Tool: LabVIEW 2012

            Software modules: Vision Acquisition Software

            Vision Development Module

          2. Proposed algorithm

        Steps of the proposed algorithm are:

        1. Open IMAQdx camera connection for image acquisition

        2. Configure image grab by setting continuous acquisition with a buffer count > 1

        3. Start IMAQdx task.

        4. Allocate memory space for acquired images as well as copied images for processing using IMAQ create.

        5. Get images every loop iteration from specified camera.

        6. Convert to grayscale by extracting the luminance colour plane.

        7a. True Case: Create 2 copies of grayscale image; one to dilate and one to erode. After applying morphological filters subtract the erosion from the dilation and output image.

        7b. False Case: Implement LabVIEW edge detection algorithms and output resulting image.

        1. Stop running program when stop button is hit or an error occurs.

        2. Close camera connection and free up image memory by using IMAQ destroy.

        3. Merge errors into simple error handler.

          Figure 3: Block Diagram of Proposed Algorithm

          The block diagram of proposed algorithm in LabVIEW is as shown in above figure3, we are comparing the results of the Traditional methods (Roberts operator, Sobel operator, Prewitt operator) and Morphological edge detection. The program itself uses default camera i.e. cam0, and start acquiring live video using the inbuilt system camera.

      6. OBTAINED RESULTS AND CONCLUSION Below block diagram shows the front panel of the

proposed edge detection algorithm, it shows the output of the program where we can capture continuous video simultaneously we can do edge detection.

Figure 4: Front Panel of Proposed Algorithm

Figure 5: Edge Detected videos using (a) Roberts (b) Prewitt (c) Sobel (d) Morphological

Edge detection has become a crucial step for detecting a correct object of an Image. We have observed in many theoretical and practical environments that Sobel Operator is better than Roberts and Prewitt operator. So in this paper we just compare our Proposed Operator with Sobel Operator. The classical operator such as Sobel, and Prewitt which uses first derivative has very simple calculation to detect the edges and their orientations but has inaccurate detection sensitivity in case of noise. In the mean time we have applied our Proposed Operator to detect the edges which gives better results than Sobel and other operators. We can make decision by observing the subjective and object comparisons that our Proposed Operator is optimal, When compared to Sobel operator. By doing comparison between traditional and morphological operators result, we come to know that the result of applying proposed model is better than all. The main advantages of mathematical morphology are direct geometric interpretation, simplicity and efficiency in hardware implementation.


    1. Ravi Kumar A.V, Dr. Nataraj K.R, Dr.Rekha K.R Morphological Real Time Video Edge Detection in Labview International Journal of Computer Science and Information Technologies, Vol. 3 (2) , 2012,3808-3811.

    2. Suman Rani, Deepti Bansal, Beant Kaur, Detection of Edges Using Mathematical Morphological Operators open transactions on information processing Volume 1, number 1, may 2014.

    3. Ravi Kumar A.V, Nataraj K.R, Result Analysis of LabVIEW and MatLab in Application of Image Edge Detection International Journal of Computer Applications (0975 888) Volume 48 No.9, June 2012

    4. M Rama Bai, "A new approach for border extraction using morphological methods", International Journal of Engineering Science and Technology Vol.2(8),2010.

    5. Suman Rani*, Deepti Bansal, Beant Kaur, Detection of Edges Using Mathematical Morphological Operators Open Transactions On Information Processing Volume 1, Number 1, MAY 2014.

    6. J. Mahena, Medical edge detection based on mathematical morphology, International Journal of Computer & Communication Technology (IJCCT), vol. 2, no. 6, pp. 4953, 2011.

    7. K. B. R. Suman, B. Deepti, Detection of edges using image processing: Literature review, in International Conference on Emerging Technologies in Electronics and Communications, pp. 1925, 2013.

Leave a Reply