CN103632157B - Individual plant wheat fringe portion kernal number method of counting - Google Patents
Individual plant wheat fringe portion kernal number method of counting Download PDFInfo
- Publication number
- CN103632157B CN103632157B CN201210304177.1A CN201210304177A CN103632157B CN 103632157 B CN103632157 B CN 103632157B CN 201210304177 A CN201210304177 A CN 201210304177A CN 103632157 B CN103632157 B CN 103632157B
- Authority
- CN
- China
- Prior art keywords
- wheat
- ear
- area
- grains
- image
- 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.)
- Active
Links
- 241000209140 Triticum Species 0.000 title claims abstract description 113
- 238000000034 method Methods 0.000 title claims abstract description 55
- 235000021307 Triticum Nutrition 0.000 claims abstract description 111
- 235000013339 cereals Nutrition 0.000 claims abstract description 108
- 241000495841 Oenanthe oenanthe Species 0.000 claims abstract description 54
- 238000013178 mathematical model Methods 0.000 claims abstract description 49
- 238000012545 processing Methods 0.000 claims abstract description 49
- 238000012360 testing method Methods 0.000 claims abstract description 20
- 210000005069 ears Anatomy 0.000 claims abstract description 19
- 241001024327 Oenanthe <Aves> Species 0.000 claims abstract description 15
- 238000012795 verification Methods 0.000 claims description 20
- 238000000605 extraction Methods 0.000 claims description 16
- 238000004364 calculation method Methods 0.000 claims description 5
- 238000004458 analytical method Methods 0.000 abstract description 6
- 238000007781 pre-processing Methods 0.000 abstract description 3
- 230000000877 morphologic effect Effects 0.000 description 8
- 230000010339 dilation Effects 0.000 description 5
- 230000003628 erosive effect Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 238000009826 distribution Methods 0.000 description 3
- 238000009395 breeding Methods 0.000 description 2
- 230000001488 breeding effect Effects 0.000 description 2
- 230000002349 favourable effect Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 241001270131 Agaricus moelleri Species 0.000 description 1
- 238000012271 agricultural production Methods 0.000 description 1
- 230000009418 agronomic effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000005202 decontamination Methods 0.000 description 1
- 230000003588 decontaminative effect Effects 0.000 description 1
- 238000003306 harvesting Methods 0.000 description 1
- 238000000691 measurement method Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
Landscapes
- Image Processing (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
本发明公开了一种小麦穗部籽粒数计数方法,该方法包括步骤:S1.利用CCD摄像头采集小麦穗部的正视图,并对采集到的正视图进行预处理;S2.数学形态学分析:采用数学形态学处理中开运算合理地去除结构元素小的部分;对每个空洞进行填充操作,利用面积法将小于面积P的对象全部去杂;S3.小麦穗部特征参数提取:为建立小麦穗部相关特征参数与籽粒数间的相关关系,提取小麦穗部的面积特征和穗轴长度特征;S4.建立数学模型:利用最小二乘法建立小麦穗部面积和穗轴长度特征参数与其籽粒数间数学模型;S5.数学模型检验:对小麦穗部面积特征和长轴特征与其籽粒数之间的相关关系进行验证,确保了这两种模型的实用性。本发明的方法能够通过提取小麦穗部图像面积特征和长轴长度特征,建立穗部图像面积特征和长轴长度特征与其籽粒数之间数学模型,从而能够比较准确迅速客观地计数出小麦穗部籽粒数,与人工比较大大提高穗部籽粒计数的效率。
The invention discloses a method for counting the number of grains on ears of wheat. The method comprises the steps of: S1. collecting a front view of wheat ears by using a CCD camera, and preprocessing the collected front views; S2. mathematical morphology analysis: The opening operation in the mathematical morphology processing is used to reasonably remove the small parts of the structural elements; the filling operation is performed on each cavity, and all objects smaller than the area P are removed by the area method; Correlation between the relevant characteristic parameters of the ear and the number of grains, extracting the area characteristics and cob length characteristics of the wheat ear; S4. Establishing a mathematical model: using the least square method to establish the characteristic parameters of the ear area and cob length and the number of grains of the wheat ear Mathematical model among them; S5. Mathematical model test: To verify the correlation between wheat ear area characteristics and long axis characteristics and its grain number, to ensure the practicability of these two models. The method of the present invention can establish a mathematical model between the area feature of the ear image, the length feature of the major axis and the number of grains by extracting the area feature and the length feature of the major axis of the wheat ear image, thereby being able to count the ears of wheat more accurately, rapidly and objectively The number of grains, compared with manual operation, greatly improves the efficiency of ear grain counting.
Description
技术领域technical field
本发明涉及到一种利用数字图像处理技术计数出单株小麦穗部籽粒数的方法。The invention relates to a method for counting the number of grains at the panicle of a single wheat plant by using digital image processing technology.
背景技术Background technique
小麦穗部籽粒数就是小麦成熟时穗部所有饱满籽粒的数量。The number of grains in the ear of wheat is the number of full grains in the ear when the wheat is mature.
小麦生产过程中的最终产量始终是农业生产者最关注的事情,实际上为便于小麦的产后加工管理,尽早准确获知小麦产量进行估产始终是生产者和农业管理部门的迫切需要。因此小麦田间产量估测需要准确知道小麦籽粒成熟时在麦穗上具体的籽粒数目。农学育种和栽培专家进行实验室考种时,也希望快速获知小麦穗部籽粒数量,加速小麦育种工作。在通过计数麦穗上的籽粒数基础上,根据此品种的千粒重和其他相关参数,从而可较快和准确地推测大田小麦产量。The final yield in the wheat production process is always the most concerned thing for agricultural producers. In fact, in order to facilitate the post-harvest processing and management of wheat, it is always an urgent need for producers and agricultural management departments to know the wheat yield as early as possible and estimate the yield. Therefore, the estimation of wheat field yield needs to accurately know the specific number of grains on the ear when the wheat grains are mature. When agronomic breeding and cultivation experts conduct laboratory planting tests, they also hope to quickly know the number of wheat spikes and accelerate wheat breeding. On the basis of counting the number of grains on the ears of wheat, according to the thousand-grain weight of this variety and other relevant parameters, the yield of field wheat can be estimated quickly and accurately.
现阶段农业测产方法如下:样点面积及调查内容。理论测产时,每点取1平方米,调查亩穗数;在每个样点中随机取20穗,调查穗粒数;千粒重按该品种常年千粒重计算。The agricultural production measurement methods at this stage are as follows: sample area and survey content. When measuring yield in theory, take 1 square meter at each point to investigate the number of spikes per mu; randomly pick 20 spikes from each sampling point to investigate the number of grains per spike; the thousand-grain weight is calculated according to the annual thousand-grain weight of the variety.
理论产量根据以下公式计算:亩产量(公斤/亩)=亩穗数×穗粒数×千粒重×0.85。The theoretical yield is calculated according to the following formula: Yield per mu (kg/mu) = number of ears per mu × number of grains per ear × thousand grain weight × 0.85.
由此可知,对小麦穗部籽粒数是理论产量测量重要基本步骤之一,现阶段小麦穗部籽粒数都是通过人工计数方法获得,从而得到小麦的产量,这种方法计数费时,费力,在计数过程中同样存在一定的误差,不同的测产技术人员可能获得不同的结果,主观性影响较大,准确性差等缺点。It can be seen that the number of grains on the ear of wheat is one of the important basic steps in the measurement of theoretical yield. At present, the number of grains on the ear of wheat is obtained by manual counting, so as to obtain the yield of wheat. This method is time-consuming and laborious. There are also certain errors in the counting process, and different production measurement technicians may obtain different results, which is subject to greater influence and poor accuracy.
因此研制一种快速准确的机器计数小麦穗部籽粒数具有现实意义,而要达到机器计数小麦穗部籽粒数,首先需要确定小麦穗部籽粒数进行自动计数的方法,在准确获得小麦穗部籽粒数的基础上,根据小麦籽粒的千粒重和亩穗数获得小麦的亩产量。小麦穗部籽粒数与麦穗性状特征穗轴长度和穗部面积等特征参数有关,因此本发明通过数字图象处理计数获得小麦穗部籽粒数具有理论依据。Therefore it is of practical significance to develop a kind of fast and accurate machine counting wheat ear grain number, and to reach the machine counting wheat ear grain number, at first need to determine the method that wheat ear grain number carries out automatic counting, in obtaining wheat ear grain number accurately On the basis of the number of wheat grains, the yield per mu of wheat is obtained according to the thousand-grain weight of wheat grains and the number of ears per mu. The number of grains on the ears of wheat is related to characteristic parameters such as cob length and ear area, which are characteristic of wheat ears. Therefore, the present invention has a theoretical basis for obtaining the number of grains on ears of wheat through digital image processing and counting.
发明内容Contents of the invention
(一)要解决的技术问题(1) Technical problems to be solved
本发明要解决的技术问题是:提供一种利用数字图像处理技术计数出小麦穗部籽粒数的方法,通过数字图像处理的方法计算出麦穗籽粒所在区域的面积和穗轴长度,建立穗部籽粒区域面积和穗轴长度与其穗部籽粒数目之间的相关关系。The technical problem to be solved in the present invention is: provide a kind of method that utilizes digital image processing technology to count out the grain number of ear of wheat, calculate the area and cob length of the area where grain of wheat ear is located by the method of digital image processing, establish ear ear Correlation between grain area and cob length with its number of grains in the panicle.
(二)技术方案(2) Technical solution
为实现上述目的,本发明提供了一种小麦穗部籽粒数的计数方法,该方法包括步骤:To achieve the above object, the invention provides a method for counting the number of grains in ears of wheat, the method comprising steps:
S1.利用CCD摄像头采集小麦穗部的正视图,并对采集到的正视图进行预处理;S1. Utilize the CCD camera to collect the front view of the ear of wheat, and preprocess the collected front view;
S1的具体步骤包括:图像获取,灰度化处理,二值化处理,其中预处理包括灰度化处理和二值化处理两个步骤。The specific steps of S1 include: image acquisition, grayscale processing, and binarization processing, wherein the preprocessing includes two steps of grayscale processing and binarization processing.
S1.1图像获取主要是利用CCD摄像头采集小麦穗部的正视图,采集小麦穗部图像的装置有,CCD摄像头,载物台,计算机等,光照条件为自然光照。其中载物台台面为白色底板,CCD摄像头通过机架悬挂在载物台上方,从而机架把载物台和CCD摄像头连接成一体。在自然光照下,把单株小麦穗按照正面放置在载物台上,载物台台面为颜色均匀的白色底版,取同一角度CCD摄像头从上部拍照,采集图像时取同一光强、同一角度(垂直)、同一焦距、同一高度。S1.1 The image acquisition mainly uses the CCD camera to collect the front view of the ear of wheat. The devices for collecting the image of the ear of wheat include a CCD camera, a stage, a computer, etc., and the lighting conditions are natural light. Wherein the table top of the stage is a white bottom plate, and the CCD camera is suspended above the stage through the frame, so that the frame connects the stage and the CCD camera into one body. Under natural light, a single ear of wheat was placed on the stage according to the front side, and the table top of the stage was a white plate with uniform color, and the CCD camera was taken from the upper part at the same angle to take pictures, and the images were collected at the same light intensity and at the same angle ( Vertical), the same focal length, the same height.
S1.2灰度化处理:对彩色图像进行灰度化处理,获得麦穗的灰度图像,由灰度图像得到图像的直方图。S1.2 Grayscale processing: grayscale processing is performed on the color image to obtain a grayscale image of wheat ears, and a histogram of the image is obtained from the grayscale image.
S1.3二值化处理:通过直方图确定出背景区域和麦穗区域灰度分布的阈值,采用Otsu方法选择最大化类间方差的阈值,从而把麦穗区域与背景区域分开,获得把麦穗与背景区域完全分开的图像。S1.3 Binarization processing: Determine the threshold value of the gray distribution of the background area and the wheat ear area through the histogram, and use the Otsu method to select the threshold that maximizes the variance between classes, so as to separate the wheat ear area from the background area and obtain the wheat ear area. An image in which the spike is completely separated from the background area.
S2.数学形态学分析:对预处理后的正视图图像进行数学形态学处理,采用数学形态学分析中开运算处理合理地去除结构元素小的部分;对每个空洞进行填充操作,利用面积法将小于面积P的对象全部去杂;S2. Mathematical Morphological Analysis: Perform mathematical morphological processing on the preprocessed front view image, and use the open operation in the mathematical morphological analysis to reasonably remove the small parts of the structural elements; perform filling operations on each cavity, and use the area method Remove all objects smaller than the area P;
S2的具体步骤包括:膨胀和腐蚀的组合运算,图像填充和去杂处理The specific steps of S2 include: combined operations of dilation and erosion, image filling and desmearing
S2.1膨胀和腐蚀的组合运算:图像处理过程中采用了开运算(该运算首先对图像进行腐蚀,然后在对腐蚀后的图像进行膨胀,两次操作使用同样的结构元素)来处理图像。S2.1 Combination operation of dilation and erosion: The opening operation is used in the image processing process (the operation first erodes the image, and then dilates the eroded image, and the two operations use the same structural element) to process the image.
数学形态学处理后(开运算)的图像中的麦芒或杂点有明显的减少,比结构元素小的部分已合理地去除。After the mathematical morphology processing (opening operation), the awns or noise points in the image are significantly reduced, and the parts smaller than the structural elements have been reasonably removed.
S2.2图像填充和去杂处理:对二值图像进行填充操作。对于二值图像而言,将连接的背景像素0值改为前景像素1值,直到达到对象的边界。填充操作的一个重要的应用是对图像进行填洞操作,对每个洞进行填充操作。同时利用面积法去除多余的对象,将小于面积P的对象全部去杂。此次图像处理过程中是对开运算后的二值图像进行填充、去杂操作。S2.2 Image filling and decontamination processing: perform filling operation on the binary image. For binary images, change the connected background pixel 0 value to foreground pixel 1 value until the boundary of the object is reached. An important application of the filling operation is to perform a hole-filling operation on an image, and perform a filling operation on each hole. At the same time, use the area method to remove redundant objects, and remove all objects smaller than the area P. In this image processing process, the binary image after the opening operation is filled and decontaminated.
处理后的图像中清晰、明了。只剩下麦穗部分,即麦芒、杂点等已合理去除,为后续特征参数的提取提供了有利条件。The processed image is clear and clear. Only the part of the wheat ear, that is, the wheat awns and miscellaneous points, have been reasonably removed, which provides favorable conditions for the extraction of subsequent characteristic parameters.
S3.小麦穗部特征参数提取:小麦穗部图像特征参数是小麦穗部图像基本特性的基础性描述,是建立小麦穗部相关特征参数与籽粒数间的数学模型的理论基础,本发明仅仅对小麦穗部的面积特征和穗轴长度特征进行提取。S3. Wheat spike characteristic parameter extraction: Wheat spike image characteristic parameter is the basic description of the basic characteristics of wheat spike image, and is the theoretical basis for establishing a mathematical model between wheat spike-related characteristic parameters and grain number. The present invention is only for The area feature of wheat spike and the length feature of cob are extracted.
S3小麦穗部特征参数提取具体的步骤包括:小麦穗部面积特征参数提取和小麦穗部穗轴长度特征提取The specific steps for extracting characteristic parameters of wheat spikes in S3 include: extraction of characteristic parameters of wheat spike area and feature extraction of wheat spike cob length
S3.1面积特征参数提取:经填充和去杂的二值图像为仅剩麦穗部分为像素值1的区域,利用图像处理技术计算像素值为1部分的像素数目即为麦穗部分的面积。S3.1 Extraction of area feature parameters: the filled and de-impured binary image is the area where only the wheat ear part has a pixel value of 1, and the area of the wheat ear part is the number of pixels with a pixel value of 1 calculated by image processing technology .
S3.2穗轴长度特征提取:麦穗图像穗轴长度是通过连接椭圆上的两个点所能获得的最长线段。S3.2 Feature extraction of cob length: the cob length of the wheat ear image is the longest line segment that can be obtained by connecting two points on the ellipse.
S4.建立数学模型:利用最小二乘法建立小麦穗部特征参数与其籽粒数间数学模型。S4. Establishing a mathematical model: using the least square method to establish a mathematical model between the characteristic parameters of the ear of wheat and the number of grains.
S4建立小麦穗部特征参数与其籽粒数间数学模型包括步骤:小麦穗部面积特征参数与实际麦穗上籽粒数之间的数学模型,小麦穗部穗轴长度特征参数与实际麦穗上籽粒数之间的数学模型。S4 establishes the mathematical model between the characteristic parameters of wheat ears and the number of grains, including steps: the mathematical model between the characteristic parameters of wheat ear area and the number of grains on the actual ear, the characteristic parameter of the length of the cob of wheat ear and the number of grains on the actual ear between mathematical models.
S4.1建立面积特征参数与其籽粒数之间的相关关系:通过最小二乘法建立图像处理计算所获得的面积特征参数与实际麦穗上籽粒数之间的数学模型。S4.1 Establish the correlation between the area characteristic parameters and the number of grains: establish a mathematical model between the area characteristic parameters obtained by image processing calculation and the actual number of grains on the ears of wheat by the least square method.
S4.2建立穗轴长度参数与其籽粒数之间的相关关系:通过最小二乘法建立图像处理计算所获得的穗轴长度特征参数与实际麦穗上籽粒数之间的数学模型。S4.2 Establish the correlation between the cob length parameter and its grain number: establish a mathematical model between the cob length characteristic parameter obtained by image processing calculation and the actual number of grains on the ear by the least square method.
S5.数学模型检验:对小麦穗部面积特征和穗轴长度特征与其籽粒数之间的数学模型进行验证,确保了这两种模型的实用性。S5. Mathematical model test: verify the mathematical model between wheat ear area characteristics and cob length characteristics and its grain number, ensuring the practicability of these two models.
S5小麦穗部籽粒数与其特征之间的相关数学模型验证步骤包括:小麦穗部面积特征与其籽粒数之间的数学模型验证,小麦穗部穗轴长度特征与其籽粒数之间的数学模型验证。The verification steps of the correlation mathematical model between the number of grains on the ear of wheat and its characteristics of S5 include: the verification of the mathematical model between the characteristics of the ear area of wheat and its number of grains, and the verification of the mathematical model between the length of the cob length of the ear of wheat and its number of grains.
S5.1小麦穗部面积特征参数与籽粒数之间的模型进行检验:以检验样品的籽粒数量作为标准来衡量通过数学模型获得的小麦穗的籽粒数量。以实际获取的验证小麦样品集的籽粒数量作为实际值与通过数学模型获得的小麦穗部籽粒数量预测值之间建立相关关系曲线,并且比较两者差异程度。S5.1 Test the model between the wheat ear area characteristic parameters and the number of grains: use the number of grains of the test sample as a standard to measure the number of grains in the ear of wheat obtained through the mathematical model. A correlation curve was established between the actual number of grains in the verification wheat sample set obtained as the actual value and the predicted value of the number of grains in the ear of wheat obtained through the mathematical model, and the degree of difference between the two was compared.
S5.2小麦穗穗轴长度特征参数与籽粒数之间的模型进行检验:采用与S5.1中相同的方法对小麦穗穗轴长度与籽粒数之间的模型进行检验。S5.2 Test the model between the characteristic parameters of the cob length of wheat cobs and the number of grains: use the same method as in S5.1 to test the model between the cob length of wheat cobs and the number of grains.
(三)有益效果(3) Beneficial effects
本发明通过对小麦穗部正视图图像灰度化和二值化处理,运用数学形态学方法把麦芒与麦穗分割,从而获得仅有小麦穗部主部图像,从而可以继续利用图像处理方法提取穗部面积特征和穗轴长度特征。通过已提取的小麦穗部面积特征和穗轴长度特征参数建立其与人工计数得到的籽粒数之间的相关数学模型,进一步通过模型验证方法证明所得数学模型精度较高,能够有效地取代人工计数。The present invention grayscales and binarizes the front view image of the ear of wheat, and uses the mathematical morphology method to separate the awn and the ear of wheat, so as to obtain only the main part of the ear of wheat, so that it can continue to use the image processing method to extract Spike area characteristics and cob length characteristics. Through the extracted wheat ear area characteristics and cob length characteristic parameters, the correlation mathematical model between them and the number of grains obtained by manual counting was established, and the model verification method was further proved that the obtained mathematical model has high precision and can effectively replace manual counting .
附图说明Description of drawings
图1小麦穗籽粒数计数系统工作过程Figure 1 The working process of the counting system of wheat ears and grains
图2采集的小麦穗部正视图图像Figure 2 Collected front view image of wheat ears
图3彩色图像的灰度化处理Figure 3 Grayscale processing of color images
图4灰度直方图Figure 4 grayscale histogram
图5灰度图向二值化图Figure 5 Grayscale image to binary image
图6膨胀和腐蚀的组合运算后的二值图Figure 6 The binary image after the combined operation of dilation and erosion
图7填充和去杂后的图像Figure 7 The image after filling and descrambling
具体实施方式detailed description
本发明提出的小麦穗部籽粒计数方法,结合附图和实施例详细说明如下。The wheat panicle grain counting method that the present invention proposes is described in detail as follows in conjunction with accompanying drawing and embodiment.
为快速获取小麦穗部面积特征参数和穗轴长度特征参数,建立面积特征参数和穗轴长度特征参数与其籽粒数之间的相关关系,因此关键点有两个,一个是快速获取小麦穗部面积特征和穗轴长度特征参数,另一个是把这两个特征参数与其穗部籽粒数建立数学模型,从而为快速获取小麦穗部籽粒数建立了基础。In order to quickly obtain the characteristic parameters of wheat spike area and cob length, establish the correlation between the area characteristic parameters, cob length characteristic parameters and the number of grains, so there are two key points, one is to quickly obtain the wheat spike area The other is to establish a mathematical model for these two characteristic parameters and the number of grains in the ear, so as to establish a foundation for quickly obtaining the number of grains in the ear of wheat.
根据图1所示,依照本发明一种快速获取小麦穗部籽粒数计数的方法包括步骤:According to shown in Fig. 1, according to the method that a kind of fast acquisition wheat panicle grain number counting of the present invention comprises steps:
S1.利用CCD摄像头采集小麦穗部的正视图,并对采集到的正视图进行预处理;S1. Utilize the CCD camera to collect the front view of the ear of wheat, and preprocess the collected front view;
S1的具体步骤包括:图像获取,灰度化处理,二值化处理The specific steps of S1 include: image acquisition, grayscale processing, and binarization processing
S1.1图像获取:图像获取主要是利用CCD摄像头采集小麦穗部的正视图,采集小麦穗部图像的装置有,CCD摄像头,载物台,计算机等,光照条件为自然光照。其中载物台台面为白色底板,CCD摄像头通过机架悬挂在载物台上方,从而机架把载物台和CCD摄像头连接成一体。在自然光照下,把单株小麦穗按照正面放置在载物台上,载物台台面为颜色均匀的白色底版,取同一角度CCD摄像头从上部拍照,采集图像时取同一光强、同一角度(垂直)、同一焦距、同一高度。根据上述方法获得如图2所示为小麦穗部正视图图像。S1.1 Image acquisition: The image acquisition mainly uses the CCD camera to collect the front view of the ear of wheat. The devices for collecting the image of the ear of wheat include a CCD camera, a stage, a computer, etc., and the lighting conditions are natural light. Wherein the table top of the stage is a white bottom plate, and the CCD camera is suspended above the stage through the frame, so that the frame connects the stage and the CCD camera into one body. Under natural light, a single ear of wheat was placed on the stage according to the front side, and the table top of the stage was a white plate with uniform color, and the CCD camera was taken from the upper part at the same angle to take pictures, and the images were collected at the same light intensity and at the same angle ( Vertical), the same focal length, the same height. According to the above method, the front view image of wheat ear is obtained as shown in Fig. 2 .
小麦穗部正视图像的预处理包括灰度化处理和二值化处理两个步骤。The preprocessing of the front view image of wheat ears includes two steps of grayscale processing and binarization processing.
S1.2灰度化处理:对彩色图像进行灰度化处理,获得麦穗的灰度图像,小麦穗部正视图图像经灰度化处理得到如图3所示图像,从图中可以看出灰度图像有效地保存了麦穗区域的细节,边缘清晰。由灰度图像得到灰度图像的直方图。灰度化图像3的直方图如图4所示。直方图中麦穗区域与背景区域的灰度分布特征区分明显,易于分开。S1.2 Gray-scale processing: Gray-scale processing is performed on the color image to obtain a gray-scale image of wheat ears, and the front view image of wheat ears is processed by gray-scale processing to obtain the image shown in Figure 3, as can be seen from the figure The grayscale image effectively preserves the details of the ear area with clear edges. Get the histogram of the grayscale image from the grayscale image. The histogram of the grayscale image 3 is shown in Figure 4. In the histogram, the gray distribution characteristics of the wheat ear area and the background area are clearly distinguished and easy to separate.
S1.3二值化处理:通过直方图确定出背景区域和麦穗区域灰度分布的阈值,采用Otsu方法选择最大化类间方差的阈值,从而把麦穗区域与背景区域分开,获得把麦穗与背景区域完全分开的图像。经二值化处理所得二值化图像如图5所示。S1.3 Binarization processing: Determine the threshold value of the gray distribution of the background area and the wheat ear area through the histogram, and use the Otsu method to select the threshold that maximizes the variance between classes, so as to separate the wheat ear area from the background area and obtain the wheat ear area. An image in which the spike is completely separated from the background area. The binarized image obtained after binarization processing is shown in Figure 5.
S2.数学形态学分析:对预处理后的正视图图像进行数学形态学处理,采用数学形态学分析中开运算处理合理地去除结构元素小的部分;对每个空洞进行填充操作,利用面积法将小于面积P的对象全部去杂;基于数学形态学的边缘信息提取处理优于基于微分运算的边缘提取算法,对噪声敏感性低,同时提取的边缘比较光滑。基于数学形态学的形态滤波器可借助于先验的几何特征信息利用形态学算子有效地滤除噪声,又可以保留图像中的原有信息。S2. Mathematical Morphological Analysis: Perform mathematical morphological processing on the preprocessed front view image, and use the open operation in the mathematical morphological analysis to reasonably remove the small parts of the structural elements; perform filling operations on each cavity, and use the area method All objects smaller than the area P are decontaminated; the edge information extraction processing based on mathematical morphology is better than the edge extraction algorithm based on differential operation, and the sensitivity to noise is low, and the extracted edge is relatively smooth. The morphological filter based on mathematical morphology can effectively filter out noise by using morphological operators with the help of prior geometric feature information, and can also retain the original information in the image.
S2的具体步骤包括:膨胀和腐蚀的组合运算,图像填充和去杂The specific steps of S2 include: combined operations of dilation and erosion, image filling and decluttering
S2.1膨胀和腐蚀的组合运算S2.1 Combination operations of dilation and erosion
图像处理过程中采用了开运算(该运算首先对图像进行腐蚀,然后在对腐蚀后的图像进行膨胀,两次操作使用同样的结构元素)来处理图像。此次处理过程中采用的是圆形结构元素(disk),半径R取7,处理结果如图6所示。In the process of image processing, open operation is used (the operation first corrodes the image, and then expands the corroded image, and the two operations use the same structural element) to process the image. The circular structural element (disk) is used in this processing, and the radius R is 7. The processing result is shown in Figure 6.
数学形态学处理后(开运算)的图像中的麦芒或杂点有明显的减少,比结构元素小的部分已合理地去除,同时小麦穗部穗梗经过此运算亦去除。After the mathematical morphology processing (opening operation), the awns or miscellaneous points in the image are significantly reduced, and the parts smaller than the structural elements have been reasonably removed. At the same time, the ears and stalks of the ears of wheat are also removed after this operation.
S2.2图像填充和去杂S2.2 Image padding and decluttering
对二值图像进行填充操作。对于二值图像而言,将连接的背景像素0值改为前景像素1值,直到达到对象的边界。填充操作的一个重要的应用是对图像进行填洞操作,对每个洞进行填充操作。同时利用面积法去除多余的对象,将小于面积P的对象全部去杂。此次图像处理过程中是对开运算后的二值图像进行填充、去杂操作,处理结果如图7所示.Perform padding operations on binary images. For binary images, change the connected background pixel 0 value to foreground pixel 1 value until the boundary of the object is reached. An important application of the filling operation is to perform a hole-filling operation on an image, and perform a filling operation on each hole. At the same time, use the area method to remove redundant objects, and remove all objects smaller than the area P. In this image processing process, the binary image after the opening operation is filled and decontaminated, and the processing results are shown in Figure 7.
处理后的图像中清晰、明了。只剩下麦穗部分,即麦芒、杂点等已合理去除,为后续特征参数的提取提供了有利条件。The processed image is clear and clear. Only the part of the wheat ear, that is, the wheat awns and miscellaneous points, have been reasonably removed, which provides favorable conditions for the extraction of subsequent characteristic parameters.
S3.小麦穗部特征参数提取:小麦穗部图像特征参数是小麦穗部图像基本特性的基础性描述,是建立小麦穗部相关特征参数与籽粒数间的数学模型的理论基础,本发明仅仅对小麦穗部的面积特征和穗轴长度特征进行提取。S3. Wheat spike characteristic parameter extraction: Wheat spike image characteristic parameter is the basic description of the basic characteristics of wheat spike image, and is the theoretical basis for establishing a mathematical model between wheat spike-related characteristic parameters and grain number. The present invention is only for The area feature of wheat spike and the length feature of cob are extracted.
S3小麦穗部特征参数提取具体的步骤包括:小麦穗部面积特征量计算和小麦穗部穗轴长度特征提取The specific steps for extracting characteristic parameters of wheat spikes in S3 include: calculation of wheat spike area feature quantities and extraction of wheat spike cob length features
S3.1面积特征参数提取:经填充和去杂的二值图像为仅剩麦穗部分为像素值1的区域,利用图像处理技术计算像素值为1部分的像素数目即为麦穗部分的面积。计算边界内部像素数作为其图像籽粒部位的面积。S3.1 Extraction of area feature parameters: the filled and de-impured binary image is the area where only the wheat ear part has a pixel value of 1, and the area of the wheat ear part is the number of pixels with a pixel value of 1 calculated by image processing technology . Calculate the number of pixels inside the boundary as the area of the grain of its image.
S3.2穗轴长度特征参数提取:麦穗图像穗轴长度是通过连接椭圆上的两个点所能获得的最长线段。S3.2 Extraction of cob length feature parameters: the cob length of the wheat ear image is the longest line segment that can be obtained by connecting two points on the ellipse.
S4.建立数学模型:建立数学模型把小麦穗部图像特性参数与其时间籽粒数之间的相关关系,利用最小二乘法建立小麦穗部特征参数与其籽粒数间数学模型。S4. Establishing a mathematical model: establishing a mathematical model to establish a mathematical model between the characteristic parameters of the wheat ear image and the number of grains at the time using the least square method.
S4.1建立面积特征参数与其籽粒数之间的相关关系:通过最小二乘法建立图像处理计算获得的面积特征参数与实际麦穗上籽粒数之间的数学模型。S4.1 Establishing the correlation between the area characteristic parameters and the number of grains: establishing a mathematical model between the area characteristic parameters calculated by image processing and the actual number of grains on the ears of wheat by the least square method.
为了计数麦穗上的籽粒数目,本方法采用识别同一品种麦穗图像的面积大小,建立麦穗籽粒数目与其图像面积之间的关系,采用100株小麦穗头作为建立数学模型的样本。通过此方法建立麦穗图像面积特征参数与小麦穗籽粒数之间的相关线性模型为:y=-1.7871+0.0007x,R=0.9583。In order to count the number of grains on ears of wheat, this method recognizes the size of the image area of ears of wheat of the same variety, establishes the relationship between the number of ears of ears of wheat and the area of the image, and uses 100 wheat ears as samples for establishing a mathematical model. Through this method, the correlation linear model between the characteristic parameters of the wheat ear image area and the number of wheat grains is established as follows: y=-1.7871+0.0007x, R=0.9583.
S4.2建立穗轴长度参数与其籽粒数之间的相关关系:通过最小二乘法建立图像处理计算所获得的穗轴长度特征参数与实际麦穗上籽粒数之间的数学模型。S4.2 Establish the correlation between the cob length parameter and its grain number: establish a mathematical model between the cob length characteristic parameter obtained by image processing calculation and the actual number of grains on the ear by the least square method.
为了计数麦穗上的籽粒数目,本方法采用识别同一品种麦穗图像穗轴长度大小,建立麦穗籽粒数目与其图像穗轴长度之间的关系,采用100株小麦穗头作为建立数学模型的样本。通过此方法建立小麦穗穗轴长度特征参数与其籽粒数量的相关性系数R为0.9474,数学模型表达式为Y=0.1089X-24.958,则说明小麦穗穗轴长度与其籽粒数量有十分显著的线性关系。In order to count the number of grains on the ears of wheat, this method uses the identification of the cob length of the image of the same variety of wheat ears, and establishes the relationship between the number of grains of wheat ears and the length of the cob of the image, and uses 100 wheat ears as samples for establishing a mathematical model . Through this method, the correlation coefficient R between the characteristic parameters of the cob length of wheat cobs and the number of grains is 0.9474, and the mathematical model expression is Y=0.1089X-24.958, which shows that the length of the cob cobs of wheat has a very significant linear relationship with the number of grains .
S5.数学模型检验:对小麦穗部面积特征和穗轴长度特征与其籽粒数之间的数学模型进行验证,确保了这两种模型的实用性。S5. Mathematical model test: verify the mathematical model between wheat ear area characteristics and cob length characteristics and its grain number, ensuring the practicability of these two models.
S5.1小麦穗部籽粒数与其特征之间的相关数学模型验证步骤包括:小麦穗部面积特征与其籽粒数之间的数学模型验证,小麦穗部穗轴长度特征与其籽粒数之间的数学模型验证。该发明中采用了40个验证样品(超过试验样品的三分之一)对上述数学模型进行检验,40个样品与试验样品属于同一品种,且利用同一种图像采集系统,图像处理方法与建立数学模型时采用的方法一致。S5.1 The verification steps of the mathematical model of the correlation between the number of wheat spikes and its characteristics include: the verification of the mathematical model between the characteristics of the wheat spike area and its number of kernels, and the mathematical model between the characteristics of the cob length of the wheat spike and its number of kernels verify. In this invention, 40 verification samples (more than one-third of the test samples) are used to test the above mathematical model. The 40 samples and the test samples belong to the same variety, and the same image acquisition system is used. The method adopted for the model is the same.
S5.1对小麦穗面积与籽粒数之间的模型进行检验S5.1 Test the model between wheat ear area and grain number
小麦穗部籽粒数实际值与预测值之间的相关系数R为0.9781,接近于1,则说明该模型可以通过数字图像处理来获取小麦穗的籽粒数量。The correlation coefficient R between the actual value and the predicted value of wheat spikes is 0.9781, which is close to 1, indicating that the model can obtain the number of wheat spikes through digital image processing.
误差在12%-16%之间的小麦样品只占总验证样品的2.50%(即一个样品),40个验证样品的误差率大部分集中在0-4%、4%-8%、8%-12%,由图可得,误差率在12%以下的小麦样品占总验证样品的97.5%。Wheat samples with errors between 12% and 16% only accounted for 2.50% of the total verification samples (that is, one sample), and most of the error rates of the 40 verification samples were concentrated in 0-4%, 4%-8%, and 8%. -12%, it can be seen from the figure that the wheat samples with an error rate below 12% account for 97.5% of the total verification samples.
S4.2对小麦穗穗轴长度与籽粒数之间的模型进行检验S4.2 Test the model between the cob length of wheat ears and the number of grains
采用相同的方法对小麦穗穗轴长度与籽粒数之间的模型进行检验。The same method was used to test the model between cob length and grain number in wheat.
小麦穗部籽粒数实际值与预测值之间的相关系数R为0.9501,接近于1,则说明该模型可以通过数字图像处理来获取小麦穗的籽粒数量。The correlation coefficient R between the actual value and the predicted value of wheat spikes is 0.9501, which is close to 1, indicating that the model can obtain the number of wheat spikes through digital image processing.
误差在12%-16%之间的小麦样品占总验证样品的12.50%(即5个样品),40个验证样品的误差率大部分集中在0-4%、4%-8%、8%-12%,分析可得,误差率在12%以下的小麦样品占总验证样品的87.5%。相对于上一个模型检验出的百分比较低。Wheat samples with errors between 12% and 16% accounted for 12.50% of the total verification samples (that is, 5 samples), and most of the error rates of the 40 verification samples were concentrated in 0-4%, 4%-8%, and 8%. -12%, the analysis is available, and the wheat samples with an error rate below 12% account for 87.5% of the total verification samples. The percentage detected is lower relative to the previous model.
从上述两种模型检验结果看出,小麦穗部面积与籽粒数之间的模型检验结果优于小麦穗轴长度与籽粒数之间的模型检验结果。From the test results of the above two models, it can be seen that the model test results between wheat ear area and grain number are better than the model test results between wheat cob length and grain number.
以上小麦穗部籽粒数计数方法是针对有芒小麦穗部,而对于无芒小麦穗部籽粒数计数方法同样适用。The above method for counting the number of grains on spikes of wheat is aimed at the spikes of wheat with awns, and the method for counting the number of grains on spikes of wheat without awns is also applicable.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210304177.1A CN103632157B (en) | 2012-08-24 | 2012-08-24 | Individual plant wheat fringe portion kernal number method of counting |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210304177.1A CN103632157B (en) | 2012-08-24 | 2012-08-24 | Individual plant wheat fringe portion kernal number method of counting |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103632157A CN103632157A (en) | 2014-03-12 |
CN103632157B true CN103632157B (en) | 2018-01-05 |
Family
ID=50213185
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210304177.1A Active CN103632157B (en) | 2012-08-24 | 2012-08-24 | Individual plant wheat fringe portion kernal number method of counting |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103632157B (en) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104021369A (en) * | 2014-04-30 | 2014-09-03 | 南京农业大学 | Grain counting method for spike of single rice based on digital image processing technology |
CN105427275B (en) * | 2015-10-29 | 2017-11-24 | 中国农业大学 | Crop field environment wheat head method of counting and device |
CN105574853B (en) * | 2015-12-07 | 2018-05-15 | 中国科学院合肥物质科学研究院 | The method and system that a kind of wheat head grain number based on image recognition calculates |
BR112019007937A8 (en) * | 2016-10-19 | 2023-04-25 | Basf Agro Trademarks Gmbh | METHOD FOR DETERMINING THE WEIGHT OF ALL THE GRAINS ON AN Ear, SYSTEM FOR DETERMINING THE WEIGHT OF ALL THE GRAINS ON AN ECO AND COMPUTER PROGRAM PRODUCT |
CN107064146A (en) * | 2017-05-15 | 2017-08-18 | 柳州环山科技有限公司 | A kind of computer based wheat spike number measurement apparatus |
CN107590812B (en) * | 2017-09-01 | 2021-07-02 | 南京农业大学 | Identification and Counting of Spikelets in Wheat Ears |
CN109447945B (en) * | 2018-09-21 | 2021-11-30 | 河南农业大学 | Quick counting method for basic wheat seedlings based on machine vision and graphic processing |
CN113011296B (en) * | 2021-03-08 | 2024-09-24 | 中国农业科学院农产品加工研究所 | Method and system for rapidly identifying purity of wheat varieties |
CN113470104B (en) * | 2021-07-21 | 2025-01-10 | 浙江托普云农科技股份有限公司 | Wheat grain counting measurement method and system based on gray value comparison |
CN114067312A (en) * | 2021-09-22 | 2022-02-18 | 南京农业大学 | Rape grain number per pod image identification method |
CN113936056A (en) * | 2021-10-20 | 2022-01-14 | 广东皓行科技有限公司 | Image recognition method, yield estimation method and electronic device |
CN115375694A (en) * | 2022-10-27 | 2022-11-22 | 浙江托普云农科技股份有限公司 | Portable rice whole ear measuring method based on image recognition and application thereof |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE3276200D1 (en) * | 1981-08-11 | 1987-06-04 | De La Rue Syst | Apparatus for scanning a sheet |
JP3478329B2 (en) * | 1999-10-01 | 2003-12-15 | セイコーエプソン株式会社 | Image processing apparatus and image processing method |
CN101281112A (en) * | 2008-04-30 | 2008-10-08 | 浙江理工大学 | An image-based automatic analysis method for net-like sticky rice |
EP2344856A2 (en) * | 2008-08-22 | 2011-07-20 | Pioneer Hi-Bred International Inc. | Methods for counting corn silks or other plural elongated strands and use of the count for characterizing the strands or their origin |
CN101673414B (en) * | 2009-10-19 | 2012-04-11 | 北京农业信息技术研究中心 | Three-dimensional morphological virtual modeling method of corn silk |
CN102072883B (en) * | 2010-07-07 | 2013-03-13 | 北京农业智能装备技术研究中心 | Device and method for detecting comprehensive quality of crop seeds |
CN101944231B (en) * | 2010-08-19 | 2012-01-04 | 北京农业智能装备技术研究中心 | Method for extracting wheatear morphological parameters |
-
2012
- 2012-08-24 CN CN201210304177.1A patent/CN103632157B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN103632157A (en) | 2014-03-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103632157B (en) | Individual plant wheat fringe portion kernal number method of counting | |
CN104021369A (en) | Grain counting method for spike of single rice based on digital image processing technology | |
CN108717523B (en) | Sow oestrus behavior detection method based on machine vision | |
Tong et al. | Machine vision techniques for the evaluation of seedling quality based on leaf area | |
WO2019174572A1 (en) | Method for identifying frostbite status of cereal seeds using embryo spectrogram characteristic wavebands | |
CN101944231B (en) | Method for extracting wheatear morphological parameters | |
CN103065149B (en) | Muskmelon Fruit phenotype is extracted and quantization method | |
CN109447945B (en) | Quick counting method for basic wheat seedlings based on machine vision and graphic processing | |
CN105844534A (en) | Automatic cow body condition scoring method and scoring device | |
CN105180850B (en) | Calculate the method and device of Maize Leaf leaf blight lesion area ratio | |
Huang et al. | Rice panicle length measuring system based on dual-camera imaging | |
CN111462058B (en) | Method for rapidly detecting effective rice ears | |
CN110575973B (en) | Crop seed quality detection and screening system | |
CN101358905A (en) | Seedling tray seeding quality inspection system and its application in inspection | |
CN102750584B (en) | On-corncob corn niblet counting method | |
CN104408473B (en) | Cotton grade sorting technique and device based on learning distance metric | |
CN111932551B (en) | Missing transplanting rate detection method of rice transplanter | |
CN105005813A (en) | Insect pest analyzing and counting method and system | |
CN103745478A (en) | Machine vision determination method for wheat germination rate | |
CN107505325A (en) | The comprehensive quality detecting method of winter-jujube fruit | |
CN109934297B (en) | Rice seed test method based on deep learning convolutional neural network | |
CN102663396A (en) | Method for automatically detecting rice milky ripe stage | |
CN102680488B (en) | Device and method for identifying massive agricultural product on line on basis of PCA (Principal Component Analysis) | |
CN112577956A (en) | Corn seed test system and method based on intelligent device photographing function | |
CN104268890B (en) | A kind of Seed-Setting Percentage in Rice measuring method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |