[go: up one dir, main page]

CN101976350B - Grain storage pest detection and identification method based on video analytics and system thereof - Google Patents

Grain storage pest detection and identification method based on video analytics and system thereof Download PDF

Info

Publication number
CN101976350B
CN101976350B CN2010105200241A CN201010520024A CN101976350B CN 101976350 B CN101976350 B CN 101976350B CN 2010105200241 A CN2010105200241 A CN 2010105200241A CN 201010520024 A CN201010520024 A CN 201010520024A CN 101976350 B CN101976350 B CN 101976350B
Authority
CN
China
Prior art keywords
grain
area
insect
stored
video
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN2010105200241A
Other languages
Chinese (zh)
Other versions
CN101976350A (en
Inventor
杨颖�
高万林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Agricultural University
Original Assignee
China Agricultural University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Agricultural University filed Critical China Agricultural University
Priority to CN2010105200241A priority Critical patent/CN101976350B/en
Publication of CN101976350A publication Critical patent/CN101976350A/en
Application granted granted Critical
Publication of CN101976350B publication Critical patent/CN101976350B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Catching Or Destruction (AREA)
  • Image Analysis (AREA)

Abstract

本发明提供了一种基于视频分析的储粮害虫检测识别方法以及相应的检测识识别装置。本发明的方法包括以下步骤:S1:获取处于运动状态的待测储粮样品的多帧连续图像;S2:将每一帧图像分割为粮虫区域和背景区域;S3:在每一帧分割后的图像内以所述粮虫区域为中心限定粮虫搜索区域,该粮虫搜索区域由M×M个该粮虫区域构成;S4:基于预置的匹配标准,在第N+1帧图像的粮虫搜索区域内搜索与第N帧图像的粮虫区域相匹配的区域,并分别记录两者之间的匹配度值;S5:将累计匹配度值超过预定阈值的粮虫区域识别为存在粮虫的区域。该方法可以克服现有检测识别方法中普遍存在的误检、漏检缺陷,并能实现粮虫的存活和类型判定。

Figure 201010520024

The invention provides a video analysis-based detection and recognition method for stored grain pests and a corresponding detection and recognition device. The method of the present invention comprises the following steps: S1: Acquire multiple frames of continuous images of the stored grain samples to be tested in a moving state; S2: Segment each frame of image into a grain insect area and a background area; S3: After each frame is segmented In the image, the grain worm search area is defined centering on the grain worm area, and the grain worm search area is composed of M×M grain worm areas; S4: Based on the preset matching standard, the N+1 frame image Search for an area that matches the grain insect area of the Nth frame image in the grain insect search area, and record the matching value between the two; S5: identify the grain insect area with the cumulative matching degree exceeding the predetermined threshold as the grain insect area. Insect area. This method can overcome the defects of misdetection and missed detection which are common in the existing detection and identification methods, and can realize the survival and type determination of grain insects.

Figure 201010520024

Description

基于视频分析的储粮害虫检测识别方法及其系统Detection and recognition method and system of stored grain pests based on video analysis

技术领域 technical field

本发明涉及检测技术领域,尤其涉及一种基于视频分析的储粮害虫检测与识别方法及其系统。The invention relates to the technical field of detection, in particular to a method and system for detecting and identifying stored grain pests based on video analysis.

背景技术 Background technique

我国是世界上最大的粮食储藏国家,每年由于粮虫危害造成的国库储粮损失高达10多亿元人民币。当前的储粮害虫(粮虫)检测方法主要有近红外光谱法、X射线法、图像处理和机器视觉法等。其中,近红外光谱法和X射线法通过对粮食逐粒扫描识别粮虫的种类,虽然识别效果较好,但是效率太低且设备的成本较高。my country is the largest grain storage country in the world, and the loss of grain stored in the treasury due to the damage of grain insects is as high as more than 1 billion yuan every year. The current detection methods for stored grain pests (grain insects) mainly include near-infrared spectroscopy, X-ray methods, image processing and machine vision methods. Among them, the near-infrared spectroscopy method and the X-ray method identify the types of grain insects by scanning the grains one by one. Although the identification effect is good, the efficiency is too low and the cost of the equipment is high.

基于图像处理和机器视觉的储粮害虫检测和识别技术因其识别效率高且成本低等优势已成为近年来的研究热点。然而,现有的基于图像处理和机器视觉的检测识别方法普遍存在两个问题:首先,由于需要针对一幅静态图像进行处理,图像噪声将导致粮虫的误检和漏检;其次,现有方法无法判断粮虫存活与否。The detection and recognition technology of stored grain pests based on image processing and machine vision has become a research hotspot in recent years because of its advantages of high recognition efficiency and low cost. However, there are generally two problems in the existing detection and recognition methods based on image processing and machine vision: first, because a static image needs to be processed, image noise will lead to false detection and missed detection of food insects; second, the existing The method cannot judge whether the grain worm survives or not.

发明内容 Contents of the invention

(一)要解决的技术问题(1) Technical problems to be solved

本发明要解决的技术问题是:如何克服现有的基于图像处理和机器视觉的储粮害虫检测识别方法中普遍存在的误检、漏检缺陷,以及如何实现粮虫的存活和类型判定。The technical problem to be solved by the present invention is: how to overcome the defects of misdetection and missed detection commonly existing in the existing methods for detecting and identifying stored grain pests based on image processing and machine vision, and how to realize the survival and type determination of grain insects.

(二)技术方案(2) Technical solution

为解决上述技术问题,本发明的技术方案提供了一种基于视频分析的储粮害虫检测识别方法,包括以下步骤:In order to solve the above technical problems, the technical solution of the present invention provides a method for detecting and identifying stored grain pests based on video analysis, comprising the following steps:

S1:获取处于运动状态的待测储粮样品的多帧连续图像;S1: Acquire multiple frames of continuous images of the stored grain sample to be tested in a moving state;

S2:将每一帧图像分割为粮虫区域和背景区域;S2: Segment each frame of image into grain insect area and background area;

S3:在每一帧分割后的图像内以所述粮虫区域为中心限定大小为M×M个所述粮虫区域的粮虫搜索区域;S3: In the divided image of each frame, define a grain insect search area with a size of M×M grain insect areas centered on the grain insect area;

S4:基于预置的匹配标准,在第N+1帧图像的粮虫搜索区域内搜索与第N帧图像的粮虫区域相匹配的区域块,并分别记录两者之间的匹配度值;S4: Based on the preset matching standard, search for an area block that matches the grain insect area of the Nth frame image in the grain insect search area of the N+1 frame image, and record the matching degree values between the two;

S5:将累计匹配度值超过预定阈值的粮虫区域识别为存在粮虫的区域。S5: Recognize the grain worm area whose cumulative matching degree value exceeds a predetermined threshold as the area where grain worm exists.

进一步地,所述方法在步骤S5之后还包括:检测所述存在粮虫的区域在所述多帧连续图像中相对于其背景区域的分别的运动矢量值,并计算其平均运动矢量值,通过所述平均运动矢量值判断所述存在粮虫的区域内的粮虫是否为存活粮虫。Further, after step S5, the method also includes: detecting the respective motion vector values of the region with grain insects in the multi-frame continuous images relative to its background region, and calculating its average motion vector value, by The average motion vector value judges whether the grain insects in the area where grain insects are present are living grain insects.

进一步地,所述方法在步骤S5之后还包括:提取所述存在粮虫的区域的图像特征,并通过SVM分类器获得分类结果和类型概率值;根据所述概率值的统计结果判断所述存在粮虫的区域内的粮虫的类型。Further, after step S5, the method also includes: extracting the image features of the area where grain insects exist, and obtaining classification results and type probability values through an SVM classifier; judging the existence of The type of food worms in the area of food worms.

进一步地,所述存在粮虫的区域相对于其背景区域的运动矢量值通过以下步骤获得:Further, the motion vector value of the region where grain worms exist relative to its background region is obtained through the following steps:

S401:根据待测储粮的运动状态构建六参数仿射模型,获得背景储粮的运动矢量值;S401: Construct a six-parameter affine model according to the motion state of the stored grain to be measured, and obtain the motion vector value of the background stored grain;

S402:获取所述存在粮虫的区域与与其相匹配的区域块之间的位移值,作为所述存在粮虫的区域的绝对运动矢量值;S402: Obtain the displacement value between the area where grain worms exist and the matching area block, as the absolute motion vector value of the area where grain worms exist;

S403:根据所述背景储粮的运动矢量值和所述存在粮虫的区域的绝对运动矢量值获得所述存在粮虫的区域相对于其背景区域的运动矢量值。S403: Obtain the motion vector value of the area where grain insects exist relative to its background area according to the motion vector value of the background stored grain and the absolute motion vector value of the area where grain insects exist.

优选地,所述步骤S2通过自定义阈值法实现。Preferably, the step S2 is realized by a custom threshold method.

优选地,所述步骤S4通过三步搜索法实现。Preferably, the step S4 is realized by a three-step search method.

优选地,所述步骤S4中,所述预置的匹配标准为:将第N+1帧图像的粮虫搜索区域中与第N帧图像的粮虫区域之间的灰度值差平方和最小的区域块识别为所述相匹配的区域块。Preferably, in the step S4, the preset matching standard is to minimize the sum of the squares of gray value differences between the food insect search area of the N+1th frame image and the grain insect area of the Nth frame image The region blocks identified as the matching region blocks.

相应地,本发明的技术方案还提供了一种基于视频分析的储粮害虫检测识别系统,包括储粮视频采集装置和储粮害虫检测识别装置,其中,Correspondingly, the technical solution of the present invention also provides a stored-grain pest detection and identification system based on video analysis, including a stored-grain video acquisition device and a stored-grain pest detection and identification device, wherein,

储粮视频采集装置,获取处于运动状态的储量样品的视频,并将所述视频传送给储粮害虫检测识别装置;The stored grain video acquisition device acquires the video of the stored grain sample in motion, and transmits the video to the stored grain pest detection and identification device;

储粮害虫检测识别装置,包括:Storage grain pest detection and identification device, including:

视频解析模块,将储粮视频采集装置传送的视频解析为多帧连续图像;The video analysis module analyzes the video transmitted by the grain storage video acquisition device into multiple frames of continuous images;

粮虫检测模块,对每一图像分别进行粮虫区域的分割和提取,并基于所述粮虫区域限定搜索区域;对于每一粮虫区域,在所述多帧图像的搜索区域内进行搜索匹配;根据搜索匹配结果识别和定位其中存在粮虫的区域。The grain worm detection module is used to segment and extract the grain worm area for each image, and limit the search area based on the grain worm area; for each grain worm area, search and match in the search area of the multi-frame image ; Identify and locate areas where grain worms exist based on search matching results.

进一步地,所述储粮害虫检测识别装置还包括:Further, the stored grain pest detection and identification device also includes:

活虫识别统计模块,检测所述存在粮虫的区域在所述多帧连续图像中相对于其背景区域的分别的运动矢量值,并计算其平均运动矢量值,通过所述平均运动矢量值判断所述存在粮虫的区域内的粮虫是否为存活粮虫。The living insect identification statistics module detects the respective motion vector values of the area where grain insects exist in the multi-frame continuous images relative to its background area, and calculates its average motion vector value, and judges by the average motion vector value Whether the grain worms in the area where grain worms exist are living grain worms.

进一步地,所述储粮害虫检测识别装置还包括:Further, the stored grain pest detection and identification device also includes:

粮虫类型识别模块,提取所述存在粮虫的区域的图像特征,并通过SVM支持向量机分类器获得分类结果和类型概率值;根据所述概率值的统计结果判断其内粮虫的类型。Grain worm type identification module extracts the image features of the region where the grain worms exist, and obtains classification results and type probability values through the SVM support vector machine classifier; judges the type of grain worms according to the statistical results of the probability values.

(三)有益效果(3) Beneficial effects

与现有技术相比,根据本发明的基于视频分析的储粮害虫检测识别方法及其系统具有以下优势:Compared with the prior art, the method and system for detecting and identifying stored grain pests based on video analysis according to the present invention have the following advantages:

基于多帧图像验证进行储粮害虫检测,通过连续多帧的搜索和比较来提高粮虫检测的准确率,避免了粮虫的漏检和误检;The detection of stored grain pests is based on multi-frame image verification, and the accuracy of grain insect detection is improved through continuous multi-frame search and comparison, avoiding missed and false detections of grain insects;

基于视频运动分析进行储粮活虫检测,通过粮虫的运动特征判断粮虫的存活状态,实现对储粮活虫的检测和实时统计;Detection of stored grain live insects based on video motion analysis, judging the living status of grain insects through the movement characteristics of grain insects, and realizing the detection and real-time statistics of stored grain live insects;

基于统计进行粮虫类型识别,针对活虫的形态不固定性,通过统计多帧的粮虫识别结果,选取概率均值最大的类型作为粮虫的类型,提高了粮虫识别的准确率。Grain insect type identification is based on statistics. Aiming at the shape instability of live insects, by counting multi-frame grain insect recognition results, the type with the largest average probability is selected as the type of grain insect, which improves the accuracy of grain insect identification.

附图说明 Description of drawings

图1是根据本发明一种实施方式的基于视频分析的储粮害虫检测识别方法的流程图;Fig. 1 is a flowchart of a method for detecting and identifying stored grain pests based on video analysis according to an embodiment of the present invention;

图2是根据本发明一种实施方式的基于视频分析的储粮害虫检测识别方法中搜索匹配过程示意图;Fig. 2 is a schematic diagram of the search and matching process in the method for detecting and identifying stored grain pests based on video analysis according to an embodiment of the present invention;

图3是根据本发明一种实施方式的基于视频分析的储粮害虫检测识别系统的结构框图。Fig. 3 is a structural block diagram of a system for detecting and identifying stored grain pests based on video analysis according to an embodiment of the present invention.

具体实施方式 Detailed ways

本发明提出的基于视频分析的储粮害虫检测识别方法及其系统,结合附图和实施例说明如下。The method and system for detecting and identifying stored grain pests based on video analysis proposed by the present invention are described as follows in conjunction with the accompanying drawings and embodiments.

图1所示为依照本发明一种实施方式的基于视频分析的储粮害虫检测识别方法的流程图。由图1中可以看出,该方法包括以下步骤:Fig. 1 is a flowchart of a method for detecting and identifying stored grain pests based on video analysis according to an embodiment of the present invention. As can be seen from Figure 1, the method includes the following steps:

S1:获取处于运动状态的待测储粮样品的多帧连续图像S1: Acquire multiple frames of continuous images of the stored grain sample to be tested in a moving state

实施过程中,可以摄取放置于传送带上的储粮样品的视频,并对视频进行解析,以获得多帧连续图像。During the implementation process, the video of the stored grain samples placed on the conveyor belt can be captured and analyzed to obtain multiple frames of continuous images.

具体地,可以根据需要通过粮食取样装置定时从粮库中扦取各类粮食样本;将粮食样本撒落在传送装置上,由此在传送装置的传送带上形成单层粮食样本;使用摄像装置拍摄该单层粮食样本随着传送带移动的过程并形成视频;将视频解析为多帧连续的储粮图像。优选地,可以对上述粮食传送装置进行额外照明,以保持视频的图像亮度稳定。视频解析为本领域现有技术,在此不作赘述。Specifically, various grain samples can be regularly taken from the grain depot through the grain sampling device according to needs; the grain samples are scattered on the conveying device, thereby forming a single layer of grain samples on the conveyor belt of the conveying device; The single-layer grain sample moves with the conveyor belt and forms a video; the video is parsed into multiple frames of continuous grain images. Preferably, the above-mentioned grain conveying device can be provided with additional lighting to keep the image brightness of the video stable. Video parsing is an existing technology in the art, and details are not described here.

S2:将每一帧图像分割为粮虫区域和背景区域S2: Segment each frame of image into grain insect area and background area

具体来说,粮虫区域是指包含害虫的一个小图像块,如图2中左侧部分的小方框所示;而每一帧图像中除去粮虫区域之外的区域即为背景区域。在对每一帧储粮图像进行分割之前,可以先采用平滑和锐化技术对其进行处理以增强图像中粮虫与背景的反差和整幅图像的清晰度,例如,采用robert算子或者sobel算子对储粮图像进行边缘提取,得到粮虫灰度图象;然后,针对灰度图象的像素值,通过K-均值聚类自适应阈值法确定一个将储粮图像分割为粮虫区域和背景区域的最佳阈值;通过获得的最佳阈值将储粮图像二值化;最后通过数学形态学的蚀膨胀操作获得完整的粮虫区域。当然,也可以使用其他任何能够获得相同处理效果的图像处理方法。Specifically, the grain insect area refers to a small image block containing pests, as shown in the small box on the left side of Figure 2; and the area except the grain insect area in each frame of image is the background area. Before segmenting each frame of stored grain image, it can be processed by smoothing and sharpening techniques to enhance the contrast between the grain worm and the background in the image and the clarity of the whole image, for example, using the Robert operator or the Sobel algorithm The edge extraction of the stored grain image is carried out to obtain the grayscale image of grain insects; then, according to the pixel value of the grayscale image, a K-means clustering adaptive threshold method is used to determine a method to divide the stored grain image into grain insect regions and The optimal threshold value of the background area; binarize the stored grain image through the obtained optimal threshold value; finally, the complete grain insect area is obtained through the erosion and expansion operation of mathematical morphology. Of course, any other image processing method that can obtain the same processing effect can also be used.

S3:在每一帧分割后的图像内以所述粮虫区域为中心限定粮虫搜索区域;S3: Defining a grain worm search area centered on the grain worm area in each frame of the segmented image;

具体来说,对于每一帧分割后的储粮图像,以粮虫区域为中心,扩张其周围M×M个单元块大小的区域,由此在其周围划分出一个粮虫搜索区域,如图2中右侧部分的大方框所示(即搜索窗口);其中,该单元块(图2中右侧部分的小窗口)的大小应该与粮虫区域大小相同或近似相同;图2中所示M为3。优选地,M取8。Specifically, for each frame of the segmented stored grain image, centering on the grain worm area, expand the area with the size of M×M unit blocks around it, thereby dividing a grain worm search area around it, as shown in the figure 2 shown in the big box on the right part (that is, the search window); wherein, the size of the unit block (the small window on the right part in Fig. 2) should be the same or approximately the same as the size of the grain insect area; M is 3. Preferably, M is 8.

S4:基于预置的匹配标准,在第N+1帧图像的粮虫搜索区域内搜索与第N帧图像的粮虫区域相匹配的区域,并记录两者之间的匹配度值;S4: Based on the preset matching standard, search for an area that matches the grain insect area of the Nth frame image in the grain insect search area of the N+1 frame image, and record the matching value between the two;

具体实施过程中,对于第N帧图像中的粮虫区域,可在第N+1帧图像中的粮虫搜索区域内,基于预置的匹配标准,搜索与第N帧图像中的粮虫区相匹配的区域块,并记录两者的匹配度值。这里的匹配度值是指第N帧图像的粮虫区域与第N+1帧图像的粮虫搜索区域中待匹配区域块之间灰度值差的平方和;这里的预置匹配标准为:取第N+1帧图像的粮虫搜索区域中差值平方和最小的区域块作为与第N帧图像的粮虫区域相匹配的区域。In the specific implementation process, for the grain insect area in the Nth frame image, the grain insect area in the Nth frame image can be searched based on the preset matching criteria in the grain insect search area in the Nth frame image Matching area blocks, and record the matching value of the two. The matching value here refers to the sum of the squares of the gray value difference between the grain worm area of the Nth frame image and the grain worm search area of the N+1 frame image; the preset matching standard here is: Take the area block with the smallest difference square sum in the grain insect search area of the N+1 frame image as the area matching the grain insect area of the Nth frame image.

优选地,如图2所示,上述匹配过程可以通过三步搜索法实现:S401,从图2右侧部分中搜索窗口的中心点开始,选取最大搜索长度的一半为步长,对与该中心点距离为步长的八个单元块进行块匹配,匹配对象为图2左侧部分中小方框所示的粮虫区域,并分别计算匹配度值,比较后确定匹配度值最高的区域块;S402,将步长减半,以S401中获得的匹配度值最高的区域块为中心,对与该中心点距离为步长的八个单元块进行块匹配,并分别计算匹配度值,比较后确定匹配度值最高的区域块;S403,重复步骤S402,直至步长为1,则当前获得的匹配度值最高的区域块即为相匹配的区域块,搜索结束。此时,记录步骤S403中的匹配度值。Preferably, as shown in Figure 2, the above-mentioned matching process can be realized by a three-step search method: S401, starting from the center point of the search window in the right part of Figure 2, select half of the maximum search length as the step size, and match the center point The eight unit blocks whose point distance is the step size carry out block matching, and the matching object is the grain worm area shown in the small box in the left part of Figure 2, and the matching degree values are calculated respectively, and the area block with the highest matching degree value is determined after comparison; S402, halving the step size, taking the area block with the highest matching value obtained in S401 as the center, performing block matching on the eight unit blocks whose distance from the center point is the step size, and calculating the matching value respectively, after comparison Determine the area block with the highest matching degree; S403, repeat step S402 until the step size is 1, then the currently obtained area block with the highest matching degree is the matching area block, and the search ends. At this time, the matching degree value in step S403 is recorded.

S5:将累计匹配度值超过预定阈值的粮虫区域识别为粮虫。S5: Identify the grain insect area whose cumulative matching degree value exceeds a predetermined threshold as the grain insect.

具体实施过程中,对所述多帧连续图像依次执行步骤S4,对每一帧图像的所有粮虫区域均进行搜索匹配及匹配度值计算;如果某一粮虫区域的累计匹配度值超过给定的阈值,则认为检测到粮虫。In the specific implementation process, step S4 is performed sequentially on the multiple frames of continuous images, and all grain insect regions of each frame of image are searched for matching and matching degree value calculation; if the cumulative matching degree value of a certain grain insect region exceeds the given If the threshold is set, it is considered that grain insects have been detected.

优选地,预定阈值为0.6。Preferably, the predetermined threshold is 0.6.

通过上述步骤S1-S5,本实施例提供了一种基于多帧图像验证的储粮害虫检测方法,通过连续多帧的搜索和比较来提高粮虫检测的准确率,避免了粮虫的漏检和误检。Through the above steps S1-S5, this embodiment provides a stored grain pest detection method based on multi-frame image verification, which improves the accuracy of grain pest detection through continuous multi-frame search and comparison, and avoids missed detection of grain pests and false positives.

优选地,本发明的基于视频分析的储粮害虫检测识别方法在检测到粮虫后,还可以进一步地识别该粮虫是否处于存活状态。Preferably, the method for detecting and identifying stored grain pests based on video analysis of the present invention can further identify whether the grain pests are alive after detecting the grain pests.

具体来说,根据检测到的粮虫区域,进一步判断粮虫是否存活,并对存活的粮虫数量进行统计。识别过程包括以下步骤:Specifically, according to the detected area of grain insects, it is further judged whether the grain insects are alive, and the number of surviving grain insects is counted. The identification process includes the following steps:

S11:在储粮样品传送装置上标记若干个特征点,通过特征点匹配得到六参数的仿射模型,以描述摄像装置的全局运动规律;六参数仿射模型的构建属于现有技术,在此不做赘述。S11: Mark several feature points on the stored grain sample transfer device, and obtain a six-parameter affine model through feature point matching to describe the global motion law of the camera device; the construction of the six-parameter affine model belongs to the prior art, here I won't go into details.

S12:获得每一存在粮虫的区域相对于其背景储粮的运动矢量值;S12: Obtain the motion vector value of each area where grain worms exist relative to its background stored grain;

具体来说,通过步骤S11中构建的仿射模型可以得到背景储粮的运动矢量值;在步骤S4中会得到一个与该存在粮虫的区域相匹配的区域块,两者之间的位移值即为该存在粮虫的区域的绝对运动矢量;将该存在粮虫的区域的绝对运动矢量值减去该背景储粮的运动矢量值即为该存在粮虫的区域内的粮虫相对于其背景储粮的运动矢量值;该相对运动矢量为粮虫存活与否的判断标准。Specifically, the motion vector value of the background stored grain can be obtained through the affine model constructed in step S11; in step S4, an area block matching the area where grain insects exist will be obtained, and the displacement value between the two That is, the absolute motion vector of the area where grain worms exist; subtracting the motion vector value of the background stored grain from the absolute motion vector value of the area where grain worms exist is The motion vector value of the background stored grain; the relative motion vector is the criterion for judging whether the grain worm survives or not.

S13:计算每一粮虫在多帧连续图像中的平均运动矢量值,并将平均运动矢量值大于零的粮虫识别为活虫。S13: Calculate the average motion vector value of each grain insect in multiple frames of continuous images, and identify the grain insect whose average motion vector value is greater than zero as live insects.

通过上述步骤S11-S13,本实施例的基于视频分析的储粮害虫检测识别方法还提供了一种基于视频运动分析的储粮活虫检测方法,通过粮虫的运动特征判断粮虫的存活状态,实现对储粮活虫的检测和实时统计。Through the above steps S11-S13, the method for detecting and identifying stored grain pests based on video analysis in this embodiment also provides a method for detecting live insects in stored grains based on video motion analysis, judging the survival status of grain insects through the movement characteristics of grain insects , Realize the detection and real-time statistics of stored grain live insects.

优选地,本发明的基于视频分析的储粮害虫检测识别方法在检测到粮虫后,还可以进一步地判断其所属的害虫类型。识别过程包括以下步骤:Preferably, the stored-grain pest detection and recognition method based on video analysis of the present invention can further determine the type of pest it belongs to after detecting the grain pest. The identification process includes the following steps:

S21:将检测到的所有粮虫的粮虫区域作为待识别区域。对于每一粮虫的待识别区域,提取其灰度、周长、面积、傅立叶算子等图像特征;S21: Use the grain insect areas of all the grain insects detected as the area to be identified. For the area to be identified of each grain insect, image features such as its grayscale, perimeter, area, and Fourier operator are extracted;

S22:将所述灰度、周长、面积、傅立叶算子等图像特征输入支持向量机(support vector machine,SVM)分类器,对粮虫类型进行识别,得到粮虫的分类结果和所属类别的概率值;S22: Input the image features such as grayscale, perimeter, area, and Fourier operator into a support vector machine (support vector machine, SVM) classifier to identify the type of grain insects, and obtain the classification results of grain insects and the category they belong to. probability value;

S23:统计步骤S22的识别结果中各类型概率值的平均值,选取平均值最大的类型作为该粮虫的类型,以此避免单帧图像识别准确率不高。S23: Calculate the average value of the probability values of each type in the recognition results of step S22, and select the type with the largest average value as the type of the grain worm, so as to avoid the low accuracy rate of single-frame image recognition.

通过上述步骤S21-S23,本实施例的基于视频分析的储粮害虫检测识别方法还提供了一种基于统计的粮虫类型识别方法,针对活虫的形态不固定性,通过统计多帧的粮虫识别结果,选取概率均值最大的类型作为粮虫的类型,提高了粮虫识别的准确率。Through the above steps S21-S23, the method for detecting and identifying stored grain pests based on video analysis in this embodiment also provides a method for identifying types of grain insects based on statistics. According to the results of insect identification, the type with the largest mean value of probability is selected as the type of grain insect, which improves the accuracy of grain insect identification.

根据上述实施例所描述的基于视频分析的储粮害虫检测识别方法,本发明还提供了一种基于视频分析的储粮害虫检测识别系统。According to the method for detecting and identifying stored grain pests based on video analysis described in the above embodiments, the present invention also provides a system for detecting and identifying stored grain pests based on video analysis.

如图3所示,本实施例的系统包括储粮视频采集装置和储粮害虫检测识别装置两个部分。As shown in FIG. 3 , the system of this embodiment includes two parts: a stored-grain video acquisition device and a stored-grain pest detection and identification device.

具体来说,储粮视频采集装置用于实现步骤S1中的连续图像的获取。相应地,其包括:Specifically, the grain storage video acquisition device is used to realize the acquisition of continuous images in step S1. Accordingly, it includes:

储粮取样单元,用于从粮仓中扦取各类粮食样本;The stored grain sampling unit is used to take various grain samples from the granary;

储粮传送单元,用于单层传送粮食样本,便于摄像单元进行拍摄;优选地,所述储粮传送单元为传送带;The grain storage conveying unit is used for conveying grain samples in a single layer, which is convenient for the camera unit to take pictures; preferably, the grain storage conveying unit is a conveyor belt;

摄像单元,用于拍摄储粮随传送装置运动过程的运动视频,并将其传送给储粮害虫检测识别装置。The camera unit is used to shoot the motion video of the stored grain moving with the conveying device, and transmit it to the stored grain pest detection and identification device.

优选地,本实施例的储粮视频采集装置还可以包括照明单元,用于对储粮传送单元进行照明,以确保储粮视频的图像亮度稳定。Preferably, the stored-grain video collection device of this embodiment may further include a lighting unit for illuminating the stored-grain conveying unit, so as to ensure stable image brightness of the stored-grain video.

具体来说,储粮害虫检测识别装置用于实现步骤S2-S5所述的视频分析处理过程。相应地,其包括:Specifically, the device for detecting and identifying stored grain pests is used to realize the video analysis and processing process described in steps S2-S5. Accordingly, it includes:

视频解析模块,将储粮视频采集装置传送的视频解析为多帧连续图像;例如,Directshow等软件可将视频流解析为多帧连续的图像以供进一步处理;The video analysis module analyzes the video transmitted by the grain storage video acquisition device into multiple frames of continuous images; for example, software such as Directshow can analyze the video stream into multiple frames of continuous images for further processing;

粮虫检测模块,对每一图像分别进行粮虫区域的分割和提取,并基于所述粮虫区域限定搜索区域;对于每一粮虫区域,在所述多帧图像的搜索区域内进行搜索匹配;根据搜索匹配结果识别和定位其中存在粮虫的区域。The grain worm detection module is used to segment and extract the grain worm area for each image, and limit the search area based on the grain worm area; for each grain worm area, search and match in the search area of the multi-frame image ; Identify and locate areas where grain worms exist based on search matching results.

优选地,本实施例的储粮害虫检测识别装置还可以包括:Preferably, the stored grain pest detection and identification device of this embodiment may also include:

活虫识别统计模块,检测所述存在粮虫的区域在所述多帧连续图像中分别的运动矢量值,通过其平均运动矢量值识别其内的粮虫是否为存活粮虫;以及The living insect identification and statistics module detects the respective motion vector values of the region where grain insects exist in the multi-frame continuous images, and identifies whether the grain insects therein are living grain insects through their average motion vector values; and

粮虫类型识别模块,提取所述存在粮虫的区域的图像特征,并通过SVM分类器获得分类结果和类型概率值;根据所述概率值的统计结果判断其内粮虫的类型。Grain worm type identification module extracts the image features of the area where the grain worm exists, and obtains the classification result and type probability value through the SVM classifier; judges the type of the grain worm according to the statistical result of the probability value.

需要说明的是,关于本实施例中基于视频分析的储粮害虫检测识别系统的各个部分的工作原理,可以参见前述基于视频分析的储粮害虫检测识别方法的相应描述,在此不做赘述。It should be noted that, regarding the working principle of each part of the system for detecting and identifying stored grain pests based on video analysis in this embodiment, you can refer to the corresponding description of the method for detecting and identifying stored grain pests based on video analysis, and details will not be repeated here.

以上实施方式仅用于说明本发明,而并非对本发明的限制,有关技术领域的普通技术人员,在不脱离本发明的精神和范围的情况下,还可以做出各种变化和变型,因此所有等同的技术方案也属于本发明的范畴,本发明的专利保护范围应由权利要求限定。The above embodiments are only used to illustrate the present invention, but not to limit the present invention. Those of ordinary skill in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, all Equivalent technical solutions also belong to the category of the present invention, and the scope of patent protection of the present invention should be defined by the claims.

Claims (8)

1.一种基于视频分析的储粮害虫检测识别方法,其特征在于,包括以下步骤: 1. A method for detecting and identifying stored grain pests based on video analysis, characterized in that, comprising the following steps: S1:获取处于运动状态的待测储粮样品的多帧连续图像; S1: Acquire multiple frames of continuous images of the stored grain sample to be tested in a moving state; 所述步骤S1具体包括步骤: The step S1 specifically includes the steps of: 通过粮食取样装置定时从粮库中扦取各类粮食样本; Regularly take various grain samples from the grain depot through the grain sampling device; 将粮食样本撒落在传送装置上,由此在传送装置的传送带上形成单层粮食样本; dropping the grain sample onto the conveyor, thereby forming a single layer of the grain sample on the conveyor belt; 对粮食传送装置进行额外照明,以保持视频的图像亮度稳定; Additional lighting on the grain conveyor to keep the image brightness of the video stable; 使用摄像装置拍摄该单层粮食样本随着传送带移动的过程并形成视频; Use a video camera to shoot the process of the single-layer grain sample moving along the conveyor belt and form a video; 将视频解析为多帧连续的储粮图像; Parse the video into multi-frame continuous grain storage images; S2:将每一帧图像分割为粮虫区域和背景区域; S2: Segment each frame of image into grain insect area and background area; S3:在每一帧分割后的图像内以所述粮虫区域为中心限定粮虫搜索区域,所述粮虫搜索区域由M×M个所述粮虫区域构成; S3: In the divided image of each frame, define a grain insect search area centered on the grain insect area, and the grain insect search area is composed of M×M grain insect areas; S4:基于预置的匹配标准,在第N+1帧图像的粮虫搜索区域内搜索与第N帧图像的粮虫区域相匹配的区域块,并分别记录两者之间的匹配度值; S4: Based on the preset matching standard, search for an area block that matches the grain insect area of the Nth frame image in the grain insect search area of the N+1 frame image, and record the matching degree values between the two; S5:将累计匹配度值超过预定阈值的粮虫区域识别为存在粮虫的区域; S5: identifying the grain insect area whose cumulative matching degree value exceeds a predetermined threshold as an area where grain insects exist; S6:检测所述存在粮虫的区域在所述多帧连续图像中相对于其背景区域的分别的运动矢量值,并计算其平均运动矢量值,通过所述平均运动矢量值判断所述存在粮虫的区域内的粮虫是否为存活粮虫。 S6: Detect the respective motion vector values of the area with grain insects in the multi-frame continuous images relative to its background area, and calculate its average motion vector value, and judge the presence of grain insects by the average motion vector value Whether the grain worms in the worm area are living grain worms. 2.如权利要求1所述的基于视频分析的储粮害虫检测识别方法,其特征在于,所述方法在步骤S5之后还包括:提取所述存在粮虫的区域的图像特征,并通过SVM支持向量机分类器获得分类结果和类型概率值;根据所述概率值的统计结果判断所述存在粮虫的区域内的 粮虫的类型。 2. The method for detecting and identifying stored grain pests based on video analysis as claimed in claim 1, characterized in that, after step S5, the method also includes: extracting the image features of the region where grain insects exist, and supporting them through SVM The vector machine classifier obtains the classification result and the type probability value; According to the statistical result of the probability value, the type of the grain worm in the area where the grain worm exists is judged. 3.如权利要求1所述的基于视频分析的储粮害虫检测识别方法,其特征在于,所述存在粮虫的区域相对于其背景区域的运动矢量值通过以下步骤获得: 3. the stored-grain pest detection and recognition method based on video analysis as claimed in claim 1, is characterized in that, the motion vector value of the area of described existence grain insect with respect to its background area is obtained by the following steps: S401:根据待测储粮的运动状态构建六参数仿射模型,获得背景储粮的运动矢量值; S401: Construct a six-parameter affine model according to the motion state of the stored grain to be measured, and obtain the motion vector value of the background stored grain; S402:获取所述存在粮虫的区域与与其相匹配的区域块之间的位移值,作为所述存在粮虫的区域的绝对运动矢量值; S402: Obtain the displacement value between the area where grain worms exist and the matching area block, as the absolute motion vector value of the area where grain worms exist; S403:根据所述背景储粮的运动矢量值和所述存在粮虫的区域的绝对运动矢量值获得所述存在粮虫的区域相对于其背景区域的运动矢量值。 S403: Obtain the motion vector value of the area where grain insects exist relative to its background area according to the motion vector value of the background stored grain and the absolute motion vector value of the area where grain insects exist. 4.如权利要求1-3中任意一项所述的基于视频分析的储粮害虫检测识别方法,其特征在于,所述步骤S2通过自定义阈值法实现。 4. The method for detecting and identifying stored grain pests based on video analysis according to any one of claims 1-3, wherein said step S2 is realized by a self-defined threshold method. 5.如权利要求1-3中任意一项所述的基于视频分析的储粮害虫检测识别方法,其特征在于,所述步骤S4通过三步搜索法实现。 5. The method for detecting and identifying stored grain pests based on video analysis according to any one of claims 1-3, wherein the step S4 is realized by a three-step search method. 6.如权利要求1-3中任意一项所述的基于视频分析的储粮害虫检测识别方法,其特征在于,所述步骤S4中,所述预置的匹配标准为:将第N+1帧图像的粮虫搜索区域中与第N帧图像的粮虫区域之间的灰度值差平方和最小的区域块识别为所述相匹配的区域块。 6. The method for detecting and identifying stored grain pests based on video analysis according to any one of claims 1-3, characterized in that, in the step S4, the preset matching standard is: the N+1th The area block with the smallest sum of squares of gray value differences between the grain worm search area of the frame image and the grain worm area of the Nth frame image is identified as the matching area block. 7.一种基于视频分析的储粮害虫检测识别系统,其特征在于,包括储粮视频采集装置和储粮害虫检测识别装置,其中, 7. A stored grain pest detection and identification system based on video analysis, characterized in that it includes a stored grain video acquisition device and a stored grain pest detection and identification device, wherein, 储粮视频采集装置,获取处于运动状态的储量样品的视频,并将所述视频传送给储粮害虫检测识别装置; The stored grain video acquisition device acquires the video of the stored grain sample in motion, and transmits the video to the stored grain pest detection and identification device; 所述储粮视频采集装置包括: The grain storage video acquisition device includes: 储粮取样单元,用于从粮仓中扦取各类粮食样本; The stored grain sampling unit is used to take various grain samples from the granary; 储粮传送单元,用于单层传送粮食样本,便于摄像单元进行拍摄,所述储粮传送单元为传送带;  The grain storage transmission unit is used for single-layer transmission of grain samples, which is convenient for the camera unit to take pictures, and the storage grain transmission unit is a conveyor belt; 摄像单元,用于拍摄储粮随传送装置运动过程的运动视频,并将其传送给储粮害虫检测识别装置; The camera unit is used to shoot the motion video of the stored grain moving with the conveying device, and transmit it to the stored grain pest detection and identification device; 照明单元,用于对储粮传送单元进行照明,以确保储粮视频的图像亮度稳定; The lighting unit is used to illuminate the grain storage transfer unit, so as to ensure that the image brightness of the grain storage video is stable; 储粮害虫检测识别装置,包括: Storage grain pest detection and identification device, including: 视频解析模块,将储粮视频采集装置传送的视频解析为多帧连续图像; The video analysis module analyzes the video transmitted by the grain storage video acquisition device into multiple frames of continuous images; 粮虫检测模块,对每一图像分别进行粮虫区域的分割和提取,并基于所述粮虫区域限定搜索区域;然后,基于预置的匹配标准,在第N+1帧图像的粮虫搜索区域内搜索与第N帧图像的粮虫区域相匹配的区域块,并分别记录两者之间的匹配度值;最后,将累计匹配度值超过预定阈值的粮虫区域识别为存在粮虫的区域; The grain insect detection module performs segmentation and extraction of the grain insect area on each image, and limits the search area based on the grain insect area; then, based on the preset matching criteria, the grain insect search of the N+1th frame image Search for the area blocks that match the grain insect area of the Nth frame image in the area, and record the matching value between the two; finally, identify the grain insect area with the cumulative matching degree value exceeding the predetermined threshold as the grain insect area area; 活虫识别统计模块,检测所述存在粮虫的区域在所述多帧连续图像中相对于其背景区域的分别的运动矢量值,并计算其平均运动矢量值,通过所述平均运动矢量值判断所述存在粮虫的区域内的粮虫是否为存活粮虫。 The living insect identification statistics module detects the respective motion vector values of the area where grain insects exist in the multi-frame continuous images relative to its background area, and calculates its average motion vector value, and judges by the average motion vector value Whether the grain worms in the area where grain worms exist are living grain worms. 8.如权利要求7所述的基于视频分析的储粮害虫检测识别系统,其特征在于,所述储粮害虫检测识别装置还包括: 8. The stored-grain pest detection and identification system based on video analysis as claimed in claim 7, wherein said stored-grain pest detection and identification device further comprises: 粮虫类型识别模块,提取所述存在粮虫的区域的图像特征,并通过SVM支持向量机分类器获得分类结果和类型概率值;根据所述概率值的统计结果判断其内粮虫的类型。  Grain worm type identification module extracts the image features of the region where the grain worms exist, and obtains classification results and type probability values through the SVM support vector machine classifier; judges the type of grain worms according to the statistical results of the probability values. the
CN2010105200241A 2010-10-20 2010-10-20 Grain storage pest detection and identification method based on video analytics and system thereof Expired - Fee Related CN101976350B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105200241A CN101976350B (en) 2010-10-20 2010-10-20 Grain storage pest detection and identification method based on video analytics and system thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105200241A CN101976350B (en) 2010-10-20 2010-10-20 Grain storage pest detection and identification method based on video analytics and system thereof

Publications (2)

Publication Number Publication Date
CN101976350A CN101976350A (en) 2011-02-16
CN101976350B true CN101976350B (en) 2012-11-21

Family

ID=43576234

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105200241A Expired - Fee Related CN101976350B (en) 2010-10-20 2010-10-20 Grain storage pest detection and identification method based on video analytics and system thereof

Country Status (1)

Country Link
CN (1) CN101976350B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515130A (en) * 2019-09-03 2019-11-29 河南工业大学 A method and device for detecting stored grain pests based on channel state information

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI428185B (en) * 2011-09-29 2014-03-01 Nat Univ Tsing Hua Tiny insect testing station
CN103177266A (en) * 2013-04-07 2013-06-26 青岛科技大学 Intelligent stock pest identification system
CN104978727B (en) * 2014-04-04 2018-03-16 北京大学深圳研究生院 Organism survival number detection method and device
CN105787460B (en) * 2016-03-14 2019-09-10 南京市疾病预防控制中心 A kind of schistosoma miracidium automatic recognition system
CN106022370B (en) * 2016-05-17 2019-03-29 北京农业信息技术研究中心 Blade MEBO ribbon gauze monitoring method and system
CN106815819B (en) * 2017-01-24 2019-08-13 河南工业大学 More strategy grain worm visible detection methods
CN107292891A (en) * 2017-06-20 2017-10-24 华南农业大学 A kind of detection method of counting of the southern vegetables Severe pests based on machine vision
US10375947B2 (en) * 2017-10-18 2019-08-13 Verily Life Sciences Llc Insect sensing systems and methods
WO2019126971A1 (en) * 2017-12-25 2019-07-04 仲恺农业工程学院 Pest disaster monitoring method based on machine vision
CN108040997B (en) * 2017-12-25 2020-09-11 仲恺农业工程学院 A method of pest monitoring based on machine vision
CN108305270B (en) * 2018-03-19 2022-11-01 河南工业大学 Storage grain insect counting system and method based on mobile phone photographing
CN108205669B (en) * 2018-05-21 2018-09-11 上海小慧智能科技有限公司 Nematode recognition methods and device
CN108875825B (en) * 2018-06-12 2022-01-25 河南工业大学 Granary pest detection method based on image blocking
CN111222551A (en) * 2019-12-30 2020-06-02 成都云尚物联环境科技有限公司 Sewage pipeline defect image identification method and device, storage medium and electronic equipment
CN112288022B (en) * 2020-11-02 2022-09-20 河南工业大学 A Grain Insect Recognition Method and Recognition System Based on Feature Fusion of SSD Algorithm
CN113361429B (en) * 2021-06-11 2022-11-04 长江大学 Analysis method and experimental device for movement behaviors of stored grain pests

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1897694A (en) * 2005-07-15 2007-01-17 索尼株式会社 Moving-object tracking control apparatus, moving-object tracking system, moving-object tracking control method, and program
CN101673403A (en) * 2009-10-10 2010-03-17 安防制造(中国)有限公司 Target following method in complex interference scene

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1139890C (en) * 2001-08-18 2004-02-25 贺贵明 Intelligent monitor system and method for grain insects in grain depot
CN1547040A (en) * 2003-12-12 2004-11-17 上海交通大学 Spectral vector fast coding matching method
CN100495438C (en) * 2007-02-09 2009-06-03 南京大学 A moving target detection and recognition method based on video surveillance
CN101604384B (en) * 2009-07-17 2012-06-27 周易 Individualized fingerprint identification method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1897694A (en) * 2005-07-15 2007-01-17 索尼株式会社 Moving-object tracking control apparatus, moving-object tracking system, moving-object tracking control method, and program
CN101673403A (en) * 2009-10-10 2010-03-17 安防制造(中国)有限公司 Target following method in complex interference scene

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张红涛等.基于SVM的储粮害虫图像识别分类.《农机化研究》.2008,(第8期),第1-3部分. *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515130A (en) * 2019-09-03 2019-11-29 河南工业大学 A method and device for detecting stored grain pests based on channel state information
CN110515130B (en) * 2019-09-03 2021-08-06 河南工业大学 A method and device for detecting stored grain pests based on channel state information

Also Published As

Publication number Publication date
CN101976350A (en) 2011-02-16

Similar Documents

Publication Publication Date Title
CN101976350B (en) Grain storage pest detection and identification method based on video analytics and system thereof
CN104198497B (en) Surface defect detection method based on visual saliency map and support vector machine
CN107316036B (en) Insect pest identification method based on cascade classifier
CN110246122A (en) Small size bearing quality determining method, apparatus and system based on machine vision
CN102393397B (en) System and method for detecting surface defects of magnetic shoe
CN105469105A (en) Cigarette smoke detection method based on video monitoring
CN110766702B (en) Agaricus bisporus grading judgment method
KR20190118451A (en) Apparel production monitoring system using image recognition
CN112184648A (en) A deep learning-based piston surface defect detection method and system
CN103735253A (en) Tongue appearance analysis system and method thereof in traditional Chinese medicine based on mobile terminal
CN110032946B (en) Aluminum/aluminum blister packaging tablet identification and positioning method based on machine vision
CN103279765A (en) Steel wire rope surface damage detection method based on image matching
CN112330607A (en) Coal and gangue identification method, device and system based on image identification technology
CN104156983A (en) Public transport passenger flow statistical method based on video image processing
CN110046560A (en) A kind of dangerous driving behavior detection method and camera
CN103745224A (en) Image-based railway contact net bird-nest abnormal condition detection method
CN104866865B (en) A kind of contact net balanced line fault detection method based on DHOG and discrete cosine transform
CN110619266B (en) Target object identification method and device and refrigerator
CN106056139A (en) Forest fire smoke/fog detection method based on image segmentation
CN110057828A (en) A kind of surface inspecting method and system based on machine vision
CN108171098B (en) Bar code detection method and equipment
CN106529551B (en) Intelligent identification and counting detection method of circle-like objects for packaging industry
CN105096342A (en) Intrusion detection algorithm based on Fourier descriptor and histogram of oriented gradient
CN104899559B (en) A kind of rapid pedestrian detection method based on video monitoring
CN107273815A (en) A kind of individual behavior recognition methods and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20121121

Termination date: 20211020