Image Processing Labview
Image Processing Labview
2012, AJCSIT, All Right Reserved. executable program. The block diagram has other lower-level VIs and built in functions. The blocks can be connected using wires to indicate the dataflow. Front panel ob- jects have corresponding terminals on the block dia- gram to allow dataflow from the user to the program and back to the user. c. Sub-VIs is analogous to subroutines in conventional programming languages. [1] provides an introduction
166
Sharma et. al/ Role of Lab View In Image Processing To LabVIEW. [2] provides more information on LabVIEW. In some applications such as image processing, execution speed is critical. LabVIEW is the only graphical programming system with a compiler that generates optimized code with execution speeds comparable to compiled C programs. Thus, LabVIEW has the ability to create stand-alone executable applications, which run at compiled execution speeds. Another advantage of LabVIEW is the fact that it includes built in applications, such as the IMAQ Vision for image processing. IMAQ Vision includes more than 400 imaging functions and interactive imaging windows and utilities for displaying and building imaging systems. IMAQ Vision gave us the opportunity to create examples for all the important functions in image processing, and use them for educational purposes. [3] provides information on IMAQ Vision. quantization. A.2 Sampling To demonstrate the effects that different sampling rates have on images, we created the Sampling VI whose front
Fig. 6. Original (left), sampled (middle), interpolated (right) panel shown in Fig [5]. while there is a mathematical the- ory of sampling, the intuitive aspects of sampling can be understood by a diversity of users by visual observation of its effects. This VI reads in an image and sub-samples it to the user-specified size. The user has the option to sub- sample the image to the sizes of 256*256, 128*128, 64*64, and 32*32, using our VI. Fig [6] shows the sub- sampling of the input image to the specified size. The sub-sampled image is scaled to the size of the input image, by dupli- cating columns and rows of the sub-sampled image. In this image, we can see the effects that sampling has on images. The effects of sampling become more pronounced when the sampling rate is decreased. Aliasing effects can be demonstrated when severe under sampling occurs. B. Binary Image processing Binary images have only two possible gray levels and can be represented using only one bit per pixel. Besides developing VIs for thresholding grayscale images to bi- nary, we also demonstrate the effects of binary morphology. Morphological operations are defined by moving a struc- turing element over the image to be modified, in such a way that it is centered over every image pixel at some point. When the structuring element is centered over a region of the image, a logical operation is performed on the pixels covered by the structuring element, yielding a binary out- put. We created the Morphology VI for demonstrating the effects of various morphological operations on binary im- ages. In this VI, we implemented the seven following mor- phological operations: Median, Dilation, Erosion, Open,
Fig. 4. Original (left), Quantized (right) II. Visualization modules The front panel provides an excellent intuitive graphi- cal user interface (GUI) to vary various parameters in the algorithm. These GUIs resemble the controls on many in- struments and provide a userfriendly interface (hence the name Virtual Instrument). In this section, we describe few of the LabVIEW VIs that we developed. A. Analog to digital conversion Sampling and quantization help to transform the con- tinuous domain image into a digital format. The effects of sampling and quantization can be visualized effectively with the following two VIs. This is a basic concept that must be understood by any practitioner in any field utiliz- ing digital images. A.1 Quantization The Quantization VI (front panel in Fig [3]) demon- strates the effects that different quantization levels have on images. This VI reads in an 8-bits/pixel image and creates an output image whose number of bit levels is Specified by the input parameter Number of bits. The user has the options to create images that have 1, 2, 4, or 8 bit levels. Fig [4] shows the effects of
167
Fig. 10. Original(left), DFT Magnitude(middle), DFT Phase(right) D.1 Discrete Fourier Transform (DFT) This way, the lower frequency information is clustered together near the origin at the centered of the display. The Center/ Uncenter input parameter of the front panel specifies whether the DFT will be displayed with its low frequencies clustered together at the center of the image or not. It is also the case that the low-amplitude frequencies in the magnitude of the DFT will be hard to see, thus it is best to logarithmically compress the DFT magnitude prior to display. An option is given again for displaying the log compressed or uncompressed magnitude of the DFT. This is specified by the Compr/Uncompr input parameter of the front panel. Fig [10] shows an image and the magnitude and phase of the DFT. D.2 Directional DFTs When the DFT of an image is brighter along a specific orientation, the image contains highly oriented components in that direction. Suppose that we define several oriented
Fig. 8. Original(left), Offset and Scaling(middle), Full Scale stretch(right) Close, Open-Close, and Close-Open. The user has the op- tion to test all the above morphological operations on an image, and also to modify the type and size of the struc- turing element. The Morphology VI allows the following structuring element types: Row, Column, Square, Cross, and X-Shape. C. Histogram and point operations (Grayscale) We developed VIs that perform linear (offset, scaling and full-scale contrast stretch) and non-linear (logarithmic range compression) image point operations. The VI for a linear point operation is shown in Fig [7]. The user has the option to perform the offset and scaling operations or to perform a full scale contrast stretch operation on an input image. The histograms of the input image and the image after the linear point operation are also displayed in the front panel in the Histogram and New Histogram Wave- form Graph indicators. Effects of linear point operations on an image are shown in Fig [8] D. Image analysis (Frequency interpretations) The Fourier transform is fundamental to image filtering and spectral theory, yet is a difficult concept for many users to correctly grasp. We therefore begin by explaining the concept of digital frequency and digital sinusoidal gratings (2-D sine waves) as the basis functions for the DFT. We have also constructed the FFT (Fast Fourier Transform) demonstration VI that calculates and displays the magni- tude and the phase of the DFT for gray level images. The front panel of this VI is shown in Fig [9] Usually, the DFT is displayed with its centered coordinates (u, v) = (0, 0 at the center of the image.
Fig. 12. Original (left), Result of directional DFT (middle), regions selected (Right) Zero- one images. Masking the DFT with these images will produce IDFT images with highlyoriented frequencies remaining.To demonstrate this effect, we implemented the DFT Direction VI. The input parameters, Theta 1 and Theta 2, to this VI, are used as the starting and final angles (in degrees) respectively, of the black region in the mask images as it can be seen from the Circle illustration in the front panel in Fig [11]. Results of DFT masking are shown in Fig [12]. The other VI s developed includes linear and non-linear filtering, image compression schemes and a large
168
Sharma et. al/ Role of Lab View In Image Processing number of edge detectors. We have presented simplest ones here for the purpose of illustration. the REFERENCES [1] Lisa K. Wells and Jeffrey Travis, LabVIEW for Everyone, Graph- ical Programming made even easier, Prentice Hall, 1999. [2] Labview User Manual, National Instruments, 2005. [3] BridgeVIEW and LabVIEW IMAQ Vision for G reference man- ual, National Instruments, 2007.
CONCLUSION In this paper, we gave an overview of Digital Image Processing We described the use of powerful visualization tools developed using LabVIEW for image processing. An overview of LabVIEW and a few of the demonstrations developed were provided.
169