InTechOpen uses cookies to offer you the best online experience. By continuing to use our site, you agree to our Privacy Policy.

Physics » "Colorimetry and Image Processing", book edited by Carlos M. Travieso-Gonzalez, ISBN 978-953-51-3745-0, Print ISBN 978-953-51-3744-3, Published: January 24, 2018 under CC BY 3.0 license. © The Author(s).

Chapter 6

Real-Time Video Analysis in Agriculture by Using LabVIEW Software

By Abdullah Beyaz
DOI: 10.5772/intechopen.71236

Article top


Inspection steps for building a vision application [3].
Figure 1. Inspection steps for building a vision application [3].
Hand anthropometry application samples in agricultural tools and machines.
Figure 2. Hand anthropometry application samples in agricultural tools and machines.
Front panel of sample application.
Figure 3. Front panel of sample application.
Sample application block diagram.
Figure 4. Sample application block diagram.
National instruments camera network webpage.
Figure 5. National instruments camera network webpage.
National instruments DAQ devices webpage.
Figure 6. National instruments DAQ devices webpage.
Defined template.
Figure 7. Defined template.
Object and coordinate detection by using LabVIEW software.
Figure 8. Object and coordinate detection by using LabVIEW software.
Determined locations on graph.
Figure 9. Determined locations on graph.
Relationship between thumb finger caliper measurements as the first finger.
Figure 10. Relationship between thumb finger caliper measurements as the first finger.
Relationship between second finger caliper measurements.
Figure 11. Relationship between second finger caliper measurements.
Relationship between third finger caliper measurements.
Figure 12. Relationship between third finger caliper measurements.
Relationship between fourth finger caliper measurements.
Figure 13. Relationship between fourth finger caliper measurements.
Relationship between fifth finger caliper measurements.
Figure 14. Relationship between fifth finger caliper measurements.

Real-Time Video Analysis in Agriculture by Using LabVIEW Software

Abdullah Beyaz
Show details


Technological developments help us to make our lives easier, such as video analysis systems. Because of that reason, these systems are commonly used in different fields. So, this kind of applications is rising these days. There are two important factors for widespread of this technology. The first factor is an increase of video capture performances at video processing units, and the second factor is decrease in prices of the video processing units. In this chapter, some general information is given about video processing technique and the information held by a LabVIEW application. As LabVIEW application, finger anthropometric measurements have been performed by utilizing the video analysis technique for agricultural machinery and instrument evolution. At the application, real-time anthropometric measurements have been done from instantly obtained video images. Real-time anthropometric measurements of video images were obtained from Ankara University Faculty of Agriculture students by using LabVIEW software. To check result accuracy, the obtained value was compared with the caliper measurements. After that differences between the results were examined statistically. In the performed study, all real-time video image values show that this system can be used effectively for real-time anthropometric measurements.

Keywords: LabVIEW, video analysis, agriculture, anthropometric measurements, ergonomics

1. Introduction

The human visual system is limited to a very narrow portion of the spectrum, so today image processing is used in wide variety of applications. By this way, it is possible to improve the visual appearance of images to a human. A vision system contains an electronic unit for image acquisition from devices like human vision system. There are a lot of computer vision systems in many areas to use as inspection systems to check the size of objects. Likewise, we can utilize them for biometric measurements. This chapter contains the comparison of two measurement methods that are commonly used for analysis processes. One of them is caliper measurement as experimental measurement, and the other one is video measurement system as an image processing application.

Nowadays, video analysis systems and applications are increasing with technological developments. These systems and applications are helping us to make our lives easier. There are two important factors effects widespread of this technology: the first factor is the superior performance of video capture devices, and the second factor is decreasing at prices of video processing units [1].

Several studies have been done in this field with different objects for developing more efficient systems. Nowadays, it is also developing efficiently. A lot of programming languages (C, C++, C#, Visual Basic, Delphi, etc.) and also software development platforms (MATLAB, LabVIEW, etc.) can be used for this aim. The image measurements are often used as a method for acquiring scientific data. This method generally requires well-defined features or structure, also edges or unique color, texture, or some combination of these factors. These types of measurements can be performed on all of the visual scenes or on individual features that are important for determining on the visual scenes [2]. The inspection steps for building a vision application can be seen in Figure 1 .


Figure 1.

Inspection steps for building a vision application [3].

In this chapter, some general information is given about video processing technique. For this aim, a LabVIEW application is presented for explaining the technique. There are a lot of applications at literature in this field. For example, Szabo et al. [4], in their study, defined the color of objects by using LabVIEW 8.6, NI Vision Development Module, NI IMAQ for USB software. Then they have compared the results with the software developed by them, which is written in LabWindows CVI/ANSI C programming language. They also reported that developed system could be successfully used in robotics fields and object classification.

Pal Singh and Julka [5] in their research classified different sizes of screws from getting images by using LabVIEW Vision Assistant software. They have indicated that the software successfully classified screws.

Ravi Kumar et al. [6] in their research stated that determination of edges could be done successfully from real-time video images by using the software which is developed by them at LabVIEW platform.

Dilip and Bhagirathi [7] in their research claimed that defined coins could be determined by using a smart camera (NI-1742) and the software which is developed on LabVIEW 2010 Vision Assistant platform. They emphasize that the software identifies the coins successfully.

These researchers show that video processing at LabVIEW platform is reliable, fast, comfortable, and inexpensive. Because of these reasons, video processing techniques on the LabVIEW platform are explained in this chapter with an application from the ergonomic field for the aim of agricultural machinery and tool development. First of all, we have to know why we use ergonomics in agricultural machinery and tool development. The answer of this question is “Ergonomics interested in design and design efficiency for a human. Also, it means wherever design and design efficiency interact with human-environment-machine systems.” So, ergonomic principles are essential for human-based systems. Knowing the anthropometric dimensions of the human physical structure is a prerequisite for the design of human-machine interaction systems. Working with the help of muscle force, machine, and tool compatibility is important regarding work efficiency [8].

Different forms of control elements can be found on agricultural machines such as a handle, lever, and buttons. So, dimensions of agricultural tools are essential for human anthropometry. These control element dimensions should be set in each way according to the anthropometric measurements and applied science data ( Figure 2 ). When we look at this perspective, the issue is important for the development of agricultural machinery design and manufacturing [8].


Figure 2.

Hand anthropometry application samples in agricultural tools and machines.

In this application, video images were used for anthropometric measurements which were obtained from real-time video. For this intention, hand images are obtained from Ankara University, Faculty of Agriculture students.

2. Material and method

2.1. Material

2.1.1. Image processing languages

The appropriate programming language and programming platform are significant for the image analysis applications. Also in real-time imaging, we have to choose logical and accessible interfaces for the best applications that we need. Additionally, it means right hardware and software combinations. There are a lot of programming languages such as C, C++, C#, Java, Visual Basic, FORTRAN, BASIC, etc., to implement real-time color imaging systems. In many instances, they have adverse effects like you sustain to know deeply programming information for many image analysis applications. But the LabVIEW platform gives an opportunity for rapidly image processing applications than C and other programming languages for real-time color imaging systems. It is probably a good thing because of the secure programming benefits for agricultural engineers. Understanding the performance impact of various language features is difficult. There is no clear answer, for experimentation with the language compiler and performance of measurements. But LabVIEW tools can be helpful for obtaining the most useful measurement results.

2.1.2. LabVIEW

LabVIEW is a software development platform with a graphical interface that millions of technologists and scientists use. Rather than other software development platforms, LabVIEW offers comfortable and more visual platform for developing software. Ever since 1986, LabVIEW platform improved great graphical programming library, and now it offers great convenience in all areas where we use engineering data [9]. LabVIEW graphical interface and sample application Front panel

LabVIEW software has two components for graphical programming as front panel and block diagram. The front panel is an interactive software part where the user can enter data in software and which has an interface area with different visual elements like indicators and graphics; it is also based on human-machine interaction. It means you can watch the screen output. By the visual elements placed in this field, the interface of needed software can be created in a short time. Figure 3 shows the front panel of a sample application which has been developed by using LabVIEW.


Figure 3.

Front panel of sample application. Block diagram

The block diagram is the place where the actual programming operation was done. The source codes are run in this place which is created by using the links between virtual objects. Post-processing outputs can be seen on the front panel after software input and output processing. All virtual elements which have input and output ports can be seen as an icon. The block diagram is created by using this icon combination for software development. Figure 4 shows the block diagram which was developed by using LabVIEW platform for the sample application.


Figure 4.

Sample application block diagram.

2.1.3. Hardware and display issue

Understanding the hardware support for image accusation is fundamental of the analysis of real-time performance of the color image measurement systems. Some computers contain special hardware for real-time image measurement applications with high-performance processors with the optimum structural support for complex imaging measurements. The technological developments give us a chance for buying low-cost pixel processors for real-time imaging applications. But commonly personal computers are used for color image measurement systems. There are many structural issues relating to real-time performance like memory capacity, memory access times, storage device speed, display hardware performance, and storage capacity. Real-time design of imaging measurement systems contains the necessary decisions like quality or working speed versus resolution [10]. Cameras

Recent technological developments reduced the complexity of the imaging devices, and also the cost of these color devices decreased. So, the popularity of these devices is still increasing for the consumers. Single-sensor digital cameras are used today in research activities in the area of color image acquisition, processing, and storage. Single-sensor camera image processing methods are getting more significant with the developments of digital camera-based applications.

LabVIEW supports lots of cameras which have a different communication protocol. Some of them are wireless, and some of them have wire connections. These cameras can be classified as bus type, scan type, and color type. Bus-type cameras can be classified as GigE, Usb3, Camera Link, IEEE 1394, IEEE 1394b, IP camera, and Parallel Digital. Scan-type cameras can be classified as area scan and line scan cameras. Also, color-type cameras can be classified as color and monochrome cameras. All supported cameras can be found easily on National Instruments camera network web page ( Figure 5 ).


Figure 5.

National instruments camera network webpage. DAQ devices

In this application, we did not use any DAQ devices for measuring or sending analog and digital signals, but some applications require DAQ devices for controlling or measuring processes [10].

DAQ devices have an interface between a PC and the real world for outside signals. The first function of DAQ devices is taking analog and digital signals for processing, and the second function is sending analog and digital outputs for controlling a physical unite. There are many ways for measuring different types of signals that we required. A sensor or measurement device sends analog and digital signals of a physical phenomenon for measurements like electrical voltage. You can also send analog and digital output signals for controlling a physical unit. For this reason, it is important to understand analog and digital signal types for controlling their actions. Based on your analog and digital signals of your application, you can decide which DAQ device you need. There are a lot of functions of DAQ devices, for example, you can measure analog-digital input and output. Also, you can generate analog and digital input and outputs [10].

There are different types of DAQ devices for one or multiple functions which support your application. You can find DAQ devices, according to input or output channels of your application, but you have to decide the price of the needed DAQ device. This decision can be done from the web page of supported NI products ( Figure 6 ).


Figure 6.

National instruments DAQ devices webpage.

2.2. Method

2.2.1. Measurement types Surface area measurement

Surface areas describe the boundaries between regions. A surface area analysis of the different components of objects gives valuable data with the prediction relations. Thus, a scientist uses different methods for assessing areas of targets that they concern, and one of them is an image processing and analysis technique [10]. Length measurement

Length measurement is usually applied to objects that have one long dimension in comparison to others. For small objects like buttons or control arm’s length as machine parts, measurement can be performed by applying image analysis and processing technique. Photographic enlargement of the dimensions helps us to assess the length of agricultural products easily [10]. Determining number

In the field of machine vision, blob detection refers to visual modules that are targeted at detecting points or regions in the image that are either brighter or more colored than the smothering. Also, determination of the numbers of objects is important for agricultural applications. We can define the specific gravity of seeds, thousand grain weight, a number of droplets in spraying, etc., for learning biological material properties. These attributes also can be applied for agricultural machine and tool development. For instance, the numbers of the droplets on a leaf in pesticide application are an important parameter for determining optimum pesticide usage in agricultural products, because pesticides affect environment and employing them in high doses cause air, land, and water contamination [10]. Color measurements

RGB and CIELab are widely used as standard spaces for comparing colors. A set of primary colors, such as the RGB primaries, defines a color triangle; only colors within this triangle can be reproduced by mixing the primary colors [10]. Determining location

There are several definitions of location and pixels in an ordinary image. For instance, the x and y coordinates of the midpoint of a feature can be determined simply by the minimum and maximum limits of the pixels. Normally, starting from the top left corner of the array, the pixel addresses them. The global coordinate system gives us info about real pixel dimension values [10]. Neighbor relationships

Local coordinates and individual features of the pixels are important for some applications, and neighbor pairs are the easiest way to identify differences between the products. The histogram of the distribution of these features gives the answers [10]. Perimeter measurements

The perimeter of a feature is a well-defined and familiar geometrical parameter. Measuring a numerical value that identifies the object properties can be easily used to determine agricultural products and machine part perimeter measurement. Some systems estimate the length of the boundary around the object by counting the pixels, but some of them use the picture selection method which is based on the selection of the objects manually of images, to investigate the perimeter value [10]. Describing shape

Shape and size are inseparable in a physical object, and both are necessary if the object is to be satisfactorily described. Further, in defining the shape, some dimensional parameters of the object must be measured. Seeds, grains, fruits, and vegetables are irregular in shape because of the complexity of their specifications, theoretically, that requires an infinite number of measurements [10]. 3D measurements

3D metrics have first been developed for simplification purposes, but three-dimensional image assessments cause new challenges. There is measurement distortion between an original 3D surface and its twisted version. The other significant problem is an analysis of 3D views by using 2D screens. Image measures still require identifying the pixels that are linked to each other [10].

2.2.2. The experimental methodology

Ankara University, Faculty of Agriculture, Department of Agricultural Machinery and Technologies students helped for the hand dimension determinations. The specifications of these 25 students were recorded as 171 cm average height, 64 kg average weight, and 23 years average age, respectively. The student’s hand measurements had been done by using a caliper with 1 mm precision. The caliper measurement results are compared with video analysis to check the accuracy of the determination, and the difference between the results was analyzed statistically.

2.2.3. Video processing method of sample application

The software development process has been done by using LabVIEW graphical program interface tools. For this purpose, LabVIEW Vision module and its sub-modules have been used. The LabVIEW Vision module contains video processing and motion detection codes. At Vision sub-module Vision Acquisition Software (VAS) was used for imaging and video acquisition functions. Also, Vision Development Module (VDM) was used for image processing and analysis functions.

In this application, a template of the selected object was created by using Vision Assistant elements which are seen in the display area. By this way, the template position is determined by using the developed software ( Figures 7 and 8 ).


Figure 7.

Defined template.


Figure 8.

Object and coordinate detection by using LabVIEW software.

Webcam measurement has been done from 50 cm distance. The specified object has been detected automatically at the two-dimensional axis and positioned by using Math script module ( Figure 9 ).


Figure 9.

Determined locations on graph.

Measurement process has been started with measurement of the thumb finger as the first finger and measurement of all other fingers, respectively. The characteristics of the dataset

All experimental measurements had been performed with a caliper with 1 mm precision. In this sample application, a USB webcam (Logitech C920) is used which has 1920 × 1080 pixel resolution, USB 3.0 interface unit, and video capture capability up to 30 frames per second ( Figure 6 ). Webcam resolution is set to 640 × 480 pixels and 30 frames per second for the software working speed competence. Also, computational results obtained from the software under 1 second as (x 1y 1, x 2y 2) coordinate data. Coordinate ranges of the measurement graph are set as 640 × 480 for the real resolution comparison for the vision area. Then this (x 1y 1, x 2y 2) coordinate data are used for each finger dimension evaluation. Caliper measurements and video coordinate data are analyzed by using regression analysis and also prediction equations added to this regression results for understanding the efficiency of video measurement system.

3. Results and discussion

The studies in the literature support the research findings. The literature studies show that the high success rate can be achieved in this kind of researches. But in this study, parallax errors affected the results. So, in this application, the positions of the fingers affected the webcam parallax errors. These parallax errors can be noticed from the results.

When we look at Figures 10 14 , it is seen that the value of the regression is 76.9% for the first finger, 88% for the second finger, 68.2% for the third finger, 75.4% for the fourth finger, and 85% for the fifth finger.


Figure 10.

Relationship between thumb finger caliper measurements as the first finger.


Figure 11.

Relationship between second finger caliper measurements.


Figure 12.

Relationship between third finger caliper measurements.


Figure 13.

Relationship between fourth finger caliper measurements.


Figure 14.

Relationship between fifth finger caliper measurements.

Alike the obtained results of this application, Beyaz [8] stated that measurement of regression value rates between 68.2% and 93.2% which is obtained from hand photos.

Epak et al. [11] stated that they developed plate recognition system by using an ordinary computer, camera, LabVIEW 8.2.1 Vision Assistant, and LabVIEW 11.0, and success of the system is 98%.

Mertens et al. [12] in their research stated that they had used 100 clean and 100 dirty eggs for distinguishing clean ones. They used a camera capable of 30 frames per second with 640 × 480 resolution for the software which they developed in LabVIEW 6.0 platform. They also stated that examples have 91% accuracy.

Velasco et al. [13] studied on shape detection using Kinect; they find the shape detection effectiveness on LabVIEW platform as 100%.

Raut and Ingole [14] worked on detecting leaf diseases using image analysis; they made the plant disease detection accurate with high precision 93%.

Rob et al. [15] studied on motion tracking by using a web cam on LabVIEW; they stress that they are tracking the defined object effectively.

4. Conclusions

In this chapter, digital video processing technique has been explained. At first, basic requirements about the video processing were discussed for understanding video analysis and acquisition system of LabVIEW. Then a sample application has been given. The results of video analysis of sample application have been presented and parallax errors explained. The results of real-time video measurements show that the technique works fast and easy in many fields. When we look at this technology, we need to use computer and electronic-based systems. These systems promise a future as a solution to the problems. By this way, we can develop more efficient machine and tools for agricultural applications like fertilizing, pesticide applications, product sorting, and classification.


1 - Ün MO. LabVIEW based target tracking system development [master thesis] T. C. Marine War College, Institute of Marine Sciences and Engineering, Department of Electronics Systems Engineering; 2013 Turkish Republic Council of Higher Education Thesis Center
2 - Russ JC. The Image Processing Handbook. fifth ed. CRC Press; 2006. ISBN: 0-8493-7254-2
3 - Anonymous. IMAQ Vision for LabVIEW User Manual. 2015. [Accessed: 29.03.2015]
4 - Szabo R, Gontean A, Lie I. Cheap Live Color Recognition with Webcam. 2011. 978-1-4577-0746-9/11/$26.00 ©2011 IEEE
5 - Pal Singh A, Julka N. Screw classification using machine vision. IJECT. 2011;2(1):31-33. ISSN: 2230-7109 (Online)
6 - Ravi Kumar AV, Nataraj KR, Rekha KR. Morphological Real-Time Video Edge Detection in LabVIEW. (IJCSIT) International Journal of Computer Science and Information Technologies. 2012;3(2):3808-3811
7 - Dilip R, Bhagirathi V. Image processing techniques for coin classification using LabVIEW. Open Journal of Artificial Intelligence. 2013, 2013;1(1):13-17. DOI: 10.12966/ojai.08.03.2013
8 - Beyaz A, Eminoğlu MB, Acar Aİ, Öztürk R, Turker U. Determination of agricultural workers hand anthropometry using image analysis method. 16th National Ergonomics Congress, 3-5 December 2010, Çorum. 2010. Book of abstracts 22 p
9 - Küçüker A. What is LabVIEW?. 2013. [Accessed: 31.07.2014]
10 - Beyaz A. Advanced Topics in Measurements. Chapter 7: Machine Vision Measurement Technology and Agricultural Applications. InTech; 2012. ISBN: 978-953-51-0128-4.
11 - Epak K, Kaushik M, Vashishath M. License plate recognition system based on image processing using LabVIEW. International Journal of Electronics Communication and Computer Technology (IJECCT). 2012;2(4):183-188
12 - Mertens K, De Ketelaere B, Kamers B, Bamelis FR, Kemps BJ, Verhoelst EM, De Baerdemaeker JG, Decuypere EM. Dirt detection on brown eggs by means of color computer vision. Poultry Science. 2005;84:1653-1659
13 - Velasco N, David Rivas L, Galarza EE. Object detection and comparison of different shapes and materials using Kinect. Journal of Telecommunication Electronic and Computer Engineering. 2017;9(1–5):97-100. e-ISSN: 2289-8131
14 - Raut S, Ingole K. Review on leaf disease detection using image processing techniques. International Research Journal of Engineering and Technology (IRJET), 2017;04(04):2044-2047. e-ISSN: 2395-056
15 - Rob R, Tirian GO, Panoiu M. LabVIEW application for motion tracking using USB camera. IOP Conference Series: Materials Science and Engineering. 2017;200:012008