Research on intelligent identification algorithm of bagged grain quantity

Publisher:陈书记Latest update time:2010-09-21 Source: 电子技术应用 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

At present, the technical core of the video-based national grain reserve automatic supervision and auditing system is to accurately obtain the total amount of grain in the grain warehouse through automatic analysis and recognition of grain warehouse scene images by computer systems, so as to make up for the defects of the current manual supervision method, eliminate the phenomena of false warehouses and false interest subsidies, and meet the management needs of management departments for automatic supervision and auditing of grain reserves [1].

The grain bags in the grain reserve warehouse are stacked up in a three-dimensional manner from the bottom to the top layer by layer, forming a large cube structure, as shown in Figure 1(a). In the image captured by the camera, this large cube has three faces: the top face and two side faces. Due to the influence of lighting and stacking methods, the grayscale values ​​of different places on the surface of the grain bag in the video image will be very different. The central area of ​​the grain bag will be brighter, while the surrounding area will be darker. Therefore, visually, the boundary of the grain bag seen by people presents an approximate ellipse. Each grain bag can see three different faces in the video image, so three different types of ellipses will be formed. If the number of ellipses on the three faces of the large cube can be accurately identified, then the number of grain bags can be identified. The weight of each bag of grain is fixed and known, so the number of grain piles in the entire cube can be obtained. Therefore, the recognition of the number of bagged grain is the recognition of the number of ellipses in the image. Therefore, the key to the recognition of the number of grain in the grain reserve warehouse of bagged grain is to find a fast, accurate and effective method for extracting and describing the ellipse shape to ensure that each bag of grain can be accurately identified.

Ellipse boundary processing and description mainly include boundary location and description. This paper adopts an improved Laplace operator and boundary direction chain code to detect and describe the edge of bagged grain images. In view of the problem that the detected ellipse boundary has a small amount of incomplete closure, the closing operation of mathematical morphology is used to repair the gap connecting the boundary. Experiments have shown that the improved Laplace operator and boundary direction chain code have high robustness for bagged grain boundary segmentation and description, and can achieve good results.

1 Extraction of grain bag edge

Edge refers to a collection of pixels in an image that have a strong contrast in grayscale with the surrounding pixels. It is widely found between objects and between objects and backgrounds [2]. Image edge is one of the most important features of an image and is an important basis for image analysis such as image segmentation, texture features, and shape features. Specifically for bagged grain images, the edge describes the shape information of the grain bag, and the shape information is the basis for identifying and analyzing the elliptical edge of the grain bag. Therefore, the first task in processing bagged grain images is grain bag edge detection.

In digital images, edge points and noise points are grayscale mutation points in the image. Therefore, in edge detection, edge positioning ability and noise suppression ability are contradictory. Some algorithms have better edge positioning ability, while some algorithms have stronger noise resistance. Each algorithm has its own advantages and disadvantages. Reference [3] made appropriate improvements to the template of the existing Laplace edge detection operator based on the characteristics of bagged grain images. By setting more reasonable Laplace template weight parameters, the accuracy of edge detection of bagged grain images was improved, and the detected edge information was richer and clearer. The detection effect is shown in Figure 1(b).

In the process of edge detection of bagged grain images, the selected edge detection algorithm must not only accurately locate the edge, but also make the detected edge as closed as possible to facilitate boundary description and feature extraction. Experimental results show that although the improved Laplace operator has a good detection effect, the obtained edge is still not completely closed and there are a large number of false edges, which makes boundary description impossible. The reasons are: (1) The contrast of the image is low; (2) The image is relatively complex and has many targets. Therefore, it is difficult to obtain a closed edge curve simply by relying on edge detection operators.

Since Matheron proposed mathematical morphology in 1964, morphological methods have become an important means of nonlinear image processing with the efforts of many scholars represented by Meyer, Serra, and Sternberg [4]. Mathematical morphology achieves target feature extraction by selecting appropriate structural elements (probes). Its basic operations are: dilation, erosion, opening, and closing. Among them, opening and closing operations are compound operations composed of basic operations (dilation and erosion). Closing operations can remove small holes in the area, fill narrow fractures, elongated gullies, and gaps in the contour, which is just suitable for removing gaps on the edge of grain bags, so that the detected edge is a closed boundary. Since mathematical morphology is based on binary images, a binarization operation step needs to be added in image preprocessing. According to the characteristics of the grain bag shape, this paper selects an elliptical structural element to perform a mathematical morphological closing operation on the binarized result of Figure 1(a), and then performs edge detection to obtain the final grain bag edge contour, as shown in Figure 2.

2 Grain Bag Boundary Description

When describing the objects to be identified, we hope to use some methods that provide richer details than a single parameter and are more compact than the image itself to describe the objects. Image representation can be based on its internal features or external features, so the image description can be divided into two categories: boundary description (such as chain code, boundary segmentation, etc.) and region description (such as quadtree, skeleton, etc.). Usually, boundary description is more concerned with the shape characteristics of the region in the image, while region description tends to reflect the grayscale, color, texture and other characteristics of the region. In the automatic recognition of bagged grain, the focus is on the shape of the grain bag. Therefore, this paper chooses the boundary description method to describe the edge of the grain bag.

In the process of identifying grain bags, it is required to strictly count the characteristic parameters according to the actual shape of the grain bags. Therefore, it is important to accurately describe the edge contour. Domestic and foreign scholars have studied the description of two-dimensional contour curves from different angles and proposed the following methods for describing boundary curves.

(1) Polygonal approximation contour method. Reference [5] proposed to use the approximate polygon of the contour line to represent the boundary. Commonly used polygonal expression methods include: the minimum perimeter polygon method based on contraction, the minimum mean square error line segment approximation method based on aggregation, and the minimum mean square error line segment approximation method based on splitting. In digital images, the boundary curve is composed of pixels. If every two adjacent pixels form a straight line, then several straight lines can be used to accurately express the boundary. However, this method has a large amount of calculation and poor real-time performance. If the boundary pixels are discretized according to a certain algorithm, although the amount of calculation can be reduced, the accuracy of the boundary description is greatly reduced. Therefore, this method is not suitable for describing the edge of grain bags.

(2) Boundary curve representation based on B-spline. Reference [6] proposed a boundary curve representation method based on B-spline. The advantage of this method is that it takes into account the geometric characteristics of the contour line to a certain extent. However, sampling and fitting the contour curve is a rather cumbersome process and is not suitable for the boundary description of grain bags.

(3) Boundary chain code method. In 1977, Freeman first proposed 4-way chain code and 8-way chain code, so chain code is also called Freeman code [7]. Chain code method is a method of describing boundary curve by using the coordinates of the starting point of boundary curve and the direction code of boundary point. It is often used to represent curves and boundary areas in image processing, computer graphics, pattern recognition and other fields [8]. This method mainly uses a series of straight line segments with specific lengths and directions to represent the boundary of the target. Since the length of each line segment is fixed and the number of directions is limited, only the starting point of the boundary needs to be represented by absolute coordinates, and the remaining points can only use continuous directions to represent the offset. Moreover, for each point, only one direction number is needed to replace two coordinate values. It can be seen that the number of bits required to represent a direction number is less than that required to represent a coordinate value. Therefore, the use of chain code representation can greatly reduce the amount of data required for boundary representation. In addition, chain code has the characteristics of simplicity, saving storage space, easy calculation and translation invariance, making the statistics of closed area feature parameters simple and easy.

There are multiple ellipses in the bagged grain image, and each ellipse needs to be described and identified. Therefore, an algorithm with simple calculation, small storage and high real-time performance is needed. Moreover, the boundary of the grain bag is a closed curve. Therefore, this paper uses the boundary chain code method to describe the edge of the grain bag.

Digital images are sampled according to a fixed-pitch grid, so the simplest chain code is to track the boundary and assign a direction value to the line connecting every two adjacent pixels. Commonly used are 4-direction and 8-direction chain codes [9], as shown in Figure 3. In a digital image, there are 8 adjacent points around any pixel, and the 8-direction chain code just matches the actual situation of the pixel, so it can accurately describe the information of the central pixel and its adjacent points. In the 8-direction chain code, the chain code moves and encodes along the digital curve or boundary pixel in an eight-adjacent manner. The offset between two adjacent pixels is represented by a number from 0 to 7. The code value is increased by 1, and the direction it points to is rotated 45° counterclockwise.

A boundary curve can be uniquely determined by the starting point of the curve and the chain code of the curve. Assume that the curve S is shown in Figure 4, and its chain code is represented by the array Lianma[].

The array Lianma[]={0, 6, 0, 7, 0, 6, 5, 4, 4, 3, 2, 2, 2} obtained by using the 8-direction chain code to describe the curve S. As can be seen from the figure, as long as the coordinates of any point on the boundary and the chain code values ​​of other points are known, the boundary of the region can be accurately described. In order to obtain a complete boundary chain code for subsequent processing (such as chain code storage, feature extraction, reconstruction, etc.), the coordinates of the curve starting point, the curve chain code and the chain code length can be stored together in a chain code table [10]. The chain code table format is shown in Figure 5.

For the bagged grain image that has been edge extracted and binarized, the line scanning method is used to obtain the upper left corner boundary point of the grain bag edge as the starting point for tracking, and the 8-direction chain code is used to search for the edge. The algorithm steps of the boundary chain code tracking the boundary contour of the bagged grain image are shown in Figure 6.

The purpose of edge tracking of an image is to extract the feature points of the target object in the image (such as the endpoints, intersections, corners, and centroids of closed curves of the boundary curve) in order to identify the object. After extracting the elliptical edge curve of the grain bag in the bagged grain image, the following judgments can be made based on mathematical knowledge: (1) Set the ellipse variance threshold to determine whether the boundary curve is close to an ellipse shape; (2) If the boundary curve is an approximate ellipse, a linear combination of the mathematical features of a series of ellipses can be used as the membership function for bagged grain image recognition. The mathematical properties of an ellipse include perimeter, centroid, area, eccentricity, etc., and these parameters can be easily calculated through boundary chain codes [10]. The linear combination of feature quantities can be used as the membership function to identify the elliptical boundary of the bagged grain image to distinguish grain bags on different surfaces, thereby achieving the purpose of intelligent recognition.

In order to solve the problem that the extracted edge is not completely closed, the closed operation of mathematical morphology is used to preprocess the binary image and then perform edge detection, and finally a completely closed boundary is obtained. Compared with other methods, the chain code method has the characteristics of simple algorithm, can greatly reduce data, can improve image processing speed and matching efficiency, and has the characteristics of translation invariance, which makes the statistics of characteristic parameters of closed curve area simple and easy. Accurate detection and description of grain bag edges is the premise of intelligent identification of grain quantity. Experiments have shown that this paper uses the improved Laplace operator to detect the edge of bagged grain images, and the extracted boundaries are smoother, continuous and clearer.

Reference address:Research on intelligent identification algorithm of bagged grain quantity

Previous article:Research on virtual chemical scene optimization technology based on EON
Next article:Research on the application of CAN bus in home intelligent control system

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号