Machine Vision Using Labview
Machine Vision Using Labview
CHAPTER 1
OVERVIEW
Page 1
1.1
INTRODUCTION
Machine vision is a continuously growing area of research dealing with processing
and analyzing of image data. It plays a key role in the development of intelligent systems. The principal goal of research on intelligent systems is to develop machines that have the ability to perceive, reason, move, and learn from experiences. Machine vision (MV) is a branch of engineering that uses computer vision in the context of manufacturing. It is the analysis of images to extract data for controlling a process or activity. Building Machine Vision system with LabVIEW Real-Time provides an environment for complete deterministic control. Because the underlying real-time operating system is a simplified kernel, we have fewer chances for latency or delays caused by interrupt service routines. Machine Vision systems running LabVIEW Real-Time easily integrate with other measurement and automation devices, so we can use high-speed interconnects between devices in a PXI chassis for advanced measurement capabilities and facilitate communication between devices without host intervention. An embedded machine vision system consists of several components. First we need a development machine or host computer. This computer allows us to do all the necessary software development, including acquiring sample images, prototyping vision strategies, and benchmarking the application. After we are satisfied with our imaging strategy, we must download the code to a ruggedized and embedded computer running a real-time operating system. Next, generate LabVIEW code from Vision Builder. We can make modifications to this code and integrate additional functionality, such as data acquisition, remote monitoring, or motion control. Next, we can download the code to the target embedded PXI controller. The PXI system runs autonomously from the host computer. The real-time operating system on the target PXI machine ensures system reliability. For monitoring the inspection, we can send image data to the host computer via Ethernet, or we can view image data, complete with graphical overlays and text, via the video-out port on the PXI controller. LabVIEW (Laboratory Virtual Instrumentation Engineering Workbench) is a platform and development environment for a visual programming language from National Dept. of ECE, MVJCE Bangalore. Page 2
Machine Vision using LabVIEW Instruments. The purpose of such programming is automating the usage of processing and measuring equipment in any laboratory setup. The graphical language is named "G". Originally released for the Apple Macintosh in 1986, LabVIEW is commonly used for data acquisition, instrument control, and industrial automation on a variety of platforms including Microsoft Windows, various versions of UNIX, Linux, and Mac OS X. The latest version of LabVIEW is version LabVIEW 2010, released in August 2010. The programming language used in LabVIEW, also referred to as G, is a dataflow programming language. Execution is determined by the structure of a graphical block diagram (the LV-source code) on which the programmer connects different function-nodes by drawing wires. These wires propagate variables and any node can execute as soon as all its input data become available. Since this might be the case for multiple nodes simultaneously, G is inherently capable of parallel execution. Multi-processing and multi-threading hardware is automatically exploited by the built-in scheduler, which multiplexes multiple OS threads over the nodes ready for execution. LabVIEW ties the creation of user interfaces into the development cycle. LabVIEW programs/subroutines are called virtual instruments (VIs). Each VI has three components: a block diagram, a front panel and a connector panel. The last is used to represent the VI in the block diagrams of other, calling VIs. Controls and indicators on the front panel allow an operator to input data into or extract data from a running virtual instrument. However, the front panel can also serve as a programmatic interface. Thus a virtual instrument can either be run as a program, with the front panel serving as a user interface, or, when dropped as a node onto the block diagram, the front panel defines the inputs and outputs for the given node through the connector pane. This implies each VI can be easily tested before being embedded as a subroutine into a larger program. The graphical approach also allows non-programmers to build programs by dragging and dropping virtual representations of lab equipment with which they are already familiar. The LabVIEW programming environment, with the included examples and the documentation, makes it simple to create small applications. This is a benefit on one side, but there is also a certain danger of underestimating the expertise needed for high-quality G programming. For Dept. of ECE, MVJCE Bangalore. Page 3
Machine Vision using LabVIEW complex algorithms or large-scale code, it is important that the programmer possess an extensive knowledge of the special LabVIEW syntax and the topology of its memory management. The most advanced LabVIEW development systems offer the possibility of building stand-alone applications. Furthermore, it is possible to create distributed applications, which communicate by a client/server scheme, and are therefore easier to implement due to the inherently parallel nature of G. The image above is an illustration of a simple LabVIEW program showing the dataflow source code in the form of the block diagram in the lower left frame and the input and output variables as graphical objects in the upper right frame. The two are the essential components of a LabVIEW program referred to as a Virtual Instrument VI.
1.2
RECOGNITION OF NEED
Page 4
CHAPTER 2
LITERATURE SURVEY
Page 5
Page 6
Machine Vision using LabVIEW integrated with graphical programming using "script nodes" and uses a syntax that is generally compatible with MATLAB. The fully modular character of LabVIEW code allows code reuse without modifications: as long as the data types of input and output are consistent, two sub VIs are interchangeable. The LabVIEW Professional Development System allows creating stand-alone executables and the resultant executable can be distributed an unlimited number of times. The run-time engine and its libraries can be provided freely along with the executable. A benefit of the LabVIEW environment is the platform independent nature of the G code, which is (with the exception of a few platform-specific functions) portable between the different LabVIEW systems for different operating systems. There is a low-cost LabVIEW Student Edition aimed at educational institutions for learning purposes. There is also an active community of LabVIEW users who communicate through several e-mail groups and Internet forums.
Page 7
matching) (
Decision Circuit
Elimination Process
In this proposed system, the video frames from the camera are given as the input to the processing unit(LabVIEW) and is compared each time with the reference image stored in the memory. This comparison is done by using the technique called Pattern Matching. Based on the output from the processing unit the decision circuit decides whether the region of interest in the product is defective or not. If a defective product is encountered it is communicated serially to the microcontroller which eliminates the product with the help of a motor connected to it.
Page 8