CN103810522B - Counting method and device for corn ear grains - Google Patents

Counting method and device for corn ear grains Download PDF

Info

Publication number
CN103810522B
CN103810522B CN201410008628.6A CN201410008628A CN103810522B CN 103810522 B CN103810522 B CN 103810522B CN 201410008628 A CN201410008628 A CN 201410008628A CN 103810522 B CN103810522 B CN 103810522B
Authority
CN
China
Prior art keywords
image
corn
segmentation
threshold
sigma
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
CN201410008628.6A
Other languages
Chinese (zh)
Other versions
CN103810522A (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 CN201410008628.6A priority Critical patent/CN103810522B/en
Publication of CN103810522A publication Critical patent/CN103810522A/en
Application granted granted Critical
Publication of CN103810522B publication Critical patent/CN103810522B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

本发明提供了一种玉米果穗籽粒计数方法和装置,该方法包括:步骤S1,获取玉米果穗籽粒估算模型;其中所述玉米果穗籽粒估算模型用于表示玉米单面的果穗籽粒数与全部果穗籽粒数之间的函数关系;步骤S2,获取玉米的单面图像,并对所述单面图像进行图像预处理,得到相应的灰度图像;步骤S3,对步骤S2中得到的灰度图像进行多阈值分割,得到相应的二值图像;步骤S4,对具有相同灰度值的连通区域进行计数,获取具有用于表示玉米粒的灰度值对应的连通区域的个数;步骤S5,根据步骤S4中获取到的个数以及步骤S1中的玉米粒估算模型确定全部果穗籽粒数。采用本发明提供的玉米果穗籽粒计数方法,能够实现玉米果穗籽粒的快速简便计数。

The present invention provides a method and device for counting corn ear kernels, the method comprising: step S1, obtaining an estimation model of corn ear kernels; wherein the corn ear kernel estimation model is used to represent the number of corn ear kernels on one side and all the ear kernels The functional relation between numbers; Step S2, obtain the single-sided image of corn, and carry out image preprocessing to described single-sided image, obtain corresponding gray scale image; Threshold segmentation to obtain the corresponding binary image; step S4, count the connected regions with the same gray value, and obtain the number of connected regions corresponding to the gray value used to represent the corn grain; step S5, according to step S4 The number obtained in and the corn grain estimation model in step S1 determine the number of grains in all ears. By adopting the method for counting corn ear grains provided by the invention, the fast and simple counting of corn ear grains can be realized.

Description

一种玉米果穗籽粒计数方法和装置Method and device for counting corn ear kernels

技术领域technical field

本发明涉及图像处理技术,尤其涉及一种玉米果穗籽粒计数方法和装置。The invention relates to image processing technology, in particular to a method and device for counting corn ear kernels.

背景技术Background technique

玉米选育是利用玉米异花授粉与遗传基础的杂合性,对大量的自交系与杂配组合进行杂交试验,最终选出个别优异的杂交种投入生产使用。其中果穗的出籽率是评判玉米品种好坏的重要指标。Maize breeding is to use the heterozygosity of maize cross-pollination and genetic basis to carry out hybridization experiments on a large number of inbred lines and hybrid combinations, and finally select individual excellent hybrids for production. Among them, the seed yield rate of the ear is an important indicator for judging the quality of corn varieties.

目前我国玉米果穗籽粒计数工作主要以人工为主。这种方式不仅工作量十分庞大,读取数据误差大,且无法重复对已读取的数据进行再读取,出现问题难以验证其正误。欧美等发达国家研究使用考种仪器。然而此类仪器价格过高,体积重量大,不易流动使用,不适合在生产实际中推广和使用。At present, the work of counting corn ears and grains in my country is mainly manual. This method not only has a huge workload, but also has large errors in reading data, and it is impossible to re-read the read data repeatedly, and it is difficult to verify its correctness when a problem occurs. Developed countries such as Europe and the United States study and use test equipment. However, the price of this kind of instrument is too high, the volume and weight are large, and it is not easy to flow and use, so it is not suitable for promotion and use in actual production.

因此研制一种自动化计算机辅助来提高玉米果穗籽粒计数效率,改进计数方法,加速品种的考核和推广是十分必要的。Therefore, it is very necessary to develop an automatic computer aid to improve the counting efficiency of corn ear kernels, improve the counting method, and speed up the examination and promotion of varieties.

发明内容Contents of the invention

本发明提供了一种玉米果穗籽粒计数方法和装置,能够实现玉米果穗籽粒的快速简便计数,The invention provides a method and device for counting corn ear grains, which can realize fast and simple counting of corn ear grains,

本发明提供一种玉米果穗籽粒计数方法,该方法包括:The invention provides a method for counting corn ear grains, the method comprising:

一种玉米果穗籽粒计数方法,其特征在于,包括:A corn ear grain counting method is characterized in that, comprising:

步骤S1,获取玉米果穗籽粒估算模型;其中所述玉米果穗籽粒估算模型用于表示玉米单面的果穗籽粒数与全部果穗籽粒数之间的函数关系;Step S1, obtaining a corn ear grain estimation model; wherein the corn ear grain estimation model is used to represent the functional relationship between the number of corn ear grains on one side of the corn and the number of all ear grains;

步骤S2,获取玉米的单面图像,并对所述单面图像进行图像预处理,得到相应的灰度图像;Step S2, obtaining a single-sided image of corn, and performing image preprocessing on the single-sided image to obtain a corresponding grayscale image;

步骤S3,对步骤S2中得到的灰度图像进行多阈值分割,得到相应的二值图像;Step S3, performing multi-threshold segmentation on the grayscale image obtained in step S2 to obtain a corresponding binary image;

步骤S4,对具有相同灰度值的连通区域进行计数,获取具有用于表示玉米粒的灰度值对应的连通区域的个数;Step S4, count the connected regions with the same gray value, and obtain the number of connected regions corresponding to the gray value used to represent the corn grain;

步骤S5,根据步骤S4中获取到的个数以及步骤S1中的玉米粒估算模型确定全部果穗籽粒数。Step S5, determine the number of kernels in all ears according to the number obtained in step S4 and the corn kernel estimation model in step S1.

优选的,所述步骤S1具体包括:Preferably, the step S1 specifically includes:

获取如下公式作为玉米果穗籽粒估算模型:Obtain the following formula as the corn ear kernel estimation model:

y=ax+b;y=ax+b;

其中,x表示玉米果穗的单面图像中的玉米籽粒数,a、b为训练值,y为全部果穗籽粒数。Among them, x represents the number of corn kernels in the single-sided image of corn ears, a and b are training values, and y is the number of kernels in all ears.

优选的,所述步骤S2包括:Preferably, said step S2 includes:

步骤S21,对所述单面图像进行中值滤波处理;Step S21, performing median filtering processing on the single-sided image;

步骤S22,对步骤S21中得到的图像进行Wallis滤波处理;Step S22, carrying out Wallis filter processing to the image obtained in step S21;

步骤S23,对步骤S22中得到的图像进行直方图增强处理,得到所述单面图像对应的灰度图像。Step S23, performing histogram enhancement processing on the image obtained in step S22 to obtain a grayscale image corresponding to the single-sided image.

优选的,所述步骤S3,具体包括:Preferably, said step S3 specifically includes:

采取RBGM和OTSU相结合的多阈值分割方法对步骤S2中得到的灰度图像进行图像分割进而得到玉米籽粒的二值图像。A multi-threshold segmentation method combining RBGM and OTSU is used to segment the gray image obtained in step S2 to obtain a binary image of corn kernels.

优选的,所述采取RBGM和OTSU相结合的多阈值分割方法对玉米果穗籽粒灰度图像进行图像分割进而得到玉米籽粒的二值图像,具体包括:Preferably, the multi-threshold segmentation method combining RBGM and OTSU is used to perform image segmentation on the corn ear grain grayscale image and then obtain the binary image of the corn grain, which specifically includes:

步骤S31,选择初始迭代点ti和迭代步长ηm对如下多阈值分割迭代求解公式进行迭代求解,获取最佳分割阈值所述最佳分割阈值为使取最大值的分割阈值:Step S31, select the initial iteration point t i and the iteration step size η m to iteratively solve the following multi-threshold segmentation iterative solution formula, and obtain the optimal segmentation threshold The optimal segmentation threshold To make Take the maximum segmentation threshold:

xx ii mNn ++ jj ++ 11 == xx ii mNn ++ jj -- ηη mm ∂∂ σσ BB 22 ∂∂ tt ii ,, ii == 1,21,2 ,, .. .. .. ,, NN ;;

其中, in,

j=0,1,...,N-1;m=0,1,... j=0,1,...,N-1; m=0,1,...

σσ BB 22 == ΣΣ kk == 00 nno -- 11 ΣΣ jj == kk ++ 11 nno -- 11 ωω kk ωω jj (( μμ kk -- μμ jj )) 22 ;;

其中ωk、μk分别为表示对n类问题进行分割时第k类问题对应的概率和均差;Among them, ω k and μ k represent the probability and mean difference corresponding to the k-th type of problem when the n-type problem is divided;

步骤S32,使用步骤S31中得到的最佳分割阈值对步骤S2中得到的灰度图像进行多阈值分割。Step S32, using the optimal segmentation threshold obtained in step S31 Perform multi-threshold segmentation on the grayscale image obtained in step S2.

本发明提供了一种玉米果穗籽粒计数装置,包括:The invention provides a corn ear grain counting device, comprising:

建模模块,用于获取玉米果穗籽粒估算模型;其中所述玉米果穗籽粒估算模型用于表示玉米单面的果穗籽粒数与全部果穗籽粒数之间的函数关系;The modeling module is used to obtain an estimation model of corn ear grains; wherein the corn ear grain estimation model is used to represent the functional relationship between the number of ear grains on one side of corn and the number of all ear grains;

图像预处理模块,用于获取玉米的单面图像,并对所述单面图像进行图像预处理,得到相应的灰度图像;An image preprocessing module, used to obtain a single-sided image of corn, and perform image preprocessing on the single-sided image to obtain a corresponding grayscale image;

图像分割模块,用于对所述图像预处理模块得到的灰度图像进行多阈值分割,得到相应的二值图像;An image segmentation module, configured to perform multi-threshold segmentation on the grayscale image obtained by the image preprocessing module to obtain a corresponding binary image;

计数模块,用于对具有相同灰度值的连通区域进行计数,获取具有用于表示玉米粒的灰度值对应的连通区域的个数;The counting module is used to count the connected regions with the same gray value, and obtain the number of connected regions corresponding to the gray value used to represent the corn grain;

计算模块,根据所述计数模块中获取到的个数以及所述建模模块获取的玉米粒估算模型确定全部果穗籽粒数。The calculation module determines the number of grains in the entire ear according to the number obtained in the counting module and the corn kernel estimation model obtained by the modeling module.

优选的,所述建模模块具体用于获取如下公式作为玉米果穗籽粒估算模型:Preferably, the modeling module is specifically used to obtain the following formula as a corn ear grain estimation model:

y=ax+b;y=ax+b;

其中,x表示玉米果穗的单面图像中的玉米籽粒数,a、b为训练值,y为全部果穗籽粒数。Among them, x represents the number of corn kernels in the single-sided image of corn ears, a and b are training values, and y is the number of kernels in all ears.

优选的,所述图像预处理模块包括:Preferably, the image preprocessing module includes:

第一处理子模块,用于对所述单面图像进行中值滤波处理;The first processing submodule is used to perform median filtering processing on the single-sided image;

第二处理子模块,用于对第一处理子模块得到的图像进行Wallis滤波处理;The second processing submodule is used to perform Wallis filter processing on the image obtained by the first processing submodule;

第三处理子模块,用于对第二处理子模块得到的图像进行直方图增强处理,得到所述单面图像对应的灰度图像。The third processing submodule is configured to perform histogram enhancement processing on the image obtained by the second processing submodule to obtain a grayscale image corresponding to the single-sided image.

优选的,所述图像分割模块,具体用于采取RBGM和OTSU相结合的多阈值分割方法对所述图像预处理模块得到的灰度图像进行图像分割进而得到玉米籽粒的二值图像。Preferably, the image segmentation module is specifically used to perform image segmentation on the grayscale image obtained by the image preprocessing module by adopting a multi-threshold segmentation method combining RBGM and OTSU to obtain a binary image of corn kernels.

优选的,所述图像分割模块用于采取RBGM和OTSU相结合的多阈值分割方法对所述图像预处理模块得到的灰度图像进行图像分割进而得到玉米籽粒的二值图像时,具体用于执行:Preferably, when the image segmentation module is used to perform image segmentation on the grayscale image obtained by the image preprocessing module using a multi-threshold segmentation method combined with RBGM and OTSU to obtain a binary image of corn kernels, it is specifically used to perform :

步骤S31,选择初始迭代点ti和迭代步长ηm对如下多阈值分割迭代求解公式进行迭代求解,获取最佳分割阈值所述最佳分割阈值为使取最大值的分割阈值:Step S31, select the initial iteration point t i and the iteration step size η m to iteratively solve the following multi-threshold segmentation iterative solution formula, and obtain the optimal segmentation threshold The optimal segmentation threshold To make Take the maximum segmentation threshold:

xx ii mNn ++ jj ++ 11 == xx ii mNn ++ jj -- ηη mm ∂∂ σσ BB 22 ∂∂ tt ii ,, ii == 1,21,2 ,, .. .. .. ,, NN ;;

其中, in,

j=0,1,...,N-1;m=0,1,... j=0,1,...,N-1; m=0,1,...

σσ BB 22 == ΣΣ kk == 00 nno -- 11 ΣΣ jj == kk ++ 11 nno -- 11 ωω kk ωω jj (( μμ kk -- μμ jj )) 22 ;;

其中ωk、μk分别为表示对n类问题进行分割时第k类问题对应的概率和均差;Among them, ω k and μ k represent the probability and mean difference corresponding to the k-th type of problem when the n-type problem is divided;

步骤S32,使用步骤S31中得到的最佳分割阈值对步骤S2中得到的灰度图像进行多阈值分割。Step S32, using the optimal segmentation threshold obtained in step S31 Perform multi-threshold segmentation on the grayscale image obtained in step S2.

采用本发明提供的玉米果穗籽粒计数方法,能够实现玉米果穗籽粒的快速简便计数。By adopting the method for counting corn ear grains provided by the invention, the fast and simple counting of corn ear grains can be realized.

附图说明Description of drawings

图1为本发明实施例提供的一种玉米果穗籽粒计数方法的流程示意图;Fig. 1 is the schematic flow sheet of a kind of corn ear grain counting method that the embodiment of the present invention provides;

图2为本发明实施例提供的玉米果穗籽粒计数方法中灰度处理的流程示意图;Fig. 2 is the schematic flow sheet of the grayscale processing in the method for counting corn ear grains provided by the embodiment of the present invention;

图3为本发明实施例提供的玉米果穗籽粒计数方法中图像分割的流程示意图;Fig. 3 is the schematic flow chart of image segmentation in the method for counting corn ear grains provided by the embodiment of the present invention;

图4a为使用本发明实施例提供的玉米果穗籽粒计数方法对玉米果穗进行标识后的单面玉米图像;Fig. 4a is the single-sided corn image after the corn ear is marked using the corn ear grain counting method provided by the embodiment of the present invention;

图4b为使用本发明实施例提供的玉米果穗籽粒计数方法对玉米果穗进行标识后的局部单面玉米图像;Fig. 4b is a local single-sided corn image after the corn ear is marked using the corn ear grain counting method provided by the embodiment of the present invention;

图5为本发明实施例提供的玉米果穗籽粒计数装置的结构示意图。Fig. 5 is a schematic structural diagram of a corn ear kernel counting device provided by an embodiment of the present invention.

具体实施方式detailed description

下面结合附图和实施例,对本发明的具体实施方式作进一步描述。以下实施例仅用于更加清楚地说明本发明的技术方案,而不能以此来限制本发明的保护范围。The specific implementation manners of the present invention will be further described below in conjunction with the drawings and examples. The following examples are only used to illustrate the technical solution of the present invention more clearly, but not to limit the protection scope of the present invention.

下面结合附图,对本发明的具体实施方式作进一步详细描述。以下实施例用于说明本发明,但不是限制本发明的范围。The specific implementation manners of the present invention will be further described in detail below in conjunction with the accompanying drawings. The following examples serve to illustrate the present invention, but do not limit the scope of the present invention.

实施例一Embodiment one

提供了一种玉米果穗籽粒计数,如图1所示,该方法包括:A kind of corn ear grain counting is provided, as shown in Figure 1, the method comprises:

步骤S1,获取玉米果穗籽粒估算模型;其中所述玉米果穗籽粒估算模型用于表示玉米单面的果穗籽粒数与全部果穗籽粒数之间的函数关系;Step S1, obtaining a corn ear grain estimation model; wherein the corn ear grain estimation model is used to represent the functional relationship between the number of corn ear grains on one side of the corn and the number of all ear grains;

步骤S2,获取玉米的单面图像,并对所述单面图像进行图像预处理,得到相应的灰度图像;Step S2, obtaining a single-sided image of corn, and performing image preprocessing on the single-sided image to obtain a corresponding grayscale image;

步骤S3,对步骤S2中得到的灰度图像进行多阈值分割,得到相应的二值图像;Step S3, performing multi-threshold segmentation on the grayscale image obtained in step S2 to obtain a corresponding binary image;

步骤S4,对具有相同灰度值的连通区域进行计数,获取具有用于表示玉米粒的灰度值对应的连通区域的个数;Step S4, count the connected regions with the same gray value, and obtain the number of connected regions corresponding to the gray value used to represent the corn grain;

步骤S5,根据步骤S4中获取到的个数以及步骤S1中的玉米粒估算模型确定全部果穗籽粒数。Step S5, determine the number of kernels in all ears according to the number obtained in step S4 and the corn kernel estimation model in step S1.

采用本发明提供的玉米果穗籽粒计数方法,能够实现玉米果穗籽粒的快速简便计数。By adopting the method for counting corn ear grains provided by the invention, the fast and simple counting of corn ear grains can be realized.

在实现本发明的过程中,本申请发明人发现:(1)玉米果穗籽粒行数大体固定,通常为14行或16行;(2)玉米图像采样时,使用正像投影方法,玉米籽粒在图像可见部分占玉米籽粒区域固定,在此基础上,本发明优选的实施例中,所述步骤S1可以具体为:获取如下公式(1)作为玉米果穗籽粒估算模型:In the process of realizing the present invention, the inventors of the present application found that: (1) the number of rows of corn ears and kernels is generally fixed, usually 14 or 16 rows; (2) when sampling corn images, the corn kernels are The visible part of the image occupies a fixed area of corn kernels. On this basis, in a preferred embodiment of the present invention, the step S1 can be specifically: obtain the following formula (1) as a corn ear kernel estimation model:

y=ax+b; (1)y=ax+b; (1)

其中,x表示玉米果穗的单面图像中的玉米籽粒数,a、b为训练值,y为全部果穗籽粒数。Among them, x represents the number of corn kernels in the single-sided image of corn ears, a and b are training values, and y is the number of kernels in all ears.

这里的a、b可以通过训练得到,即通过对部分玉米果穗进行人工计数,并对a、b值进行赋值。需要指出的是,这里建立的训练模型可以供步骤S2-S5多次使用,便于实现对其他玉米果穗籽粒的快速计数。Here, a and b can be obtained through training, that is, by manually counting some corn ears and assigning values to a and b. It should be pointed out that the training model established here can be used for multiple times in steps S2-S5, so as to facilitate the rapid counting of other corn ears.

由于步骤S4是对玉米的单面图像的处理结果,因此得到的籽粒也是单面的,即相当于上述关系式中的x,此时将x带入到上述的关系式中,即可得到玉米果穗籽粒的总个数。Since step S4 is the processing result of the single-sided image of corn, the obtained grain is also one-sided, which is equivalent to x in the above relational expression. At this time, x is brought into the above-mentioned relational expression to obtain corn The total number of kernels in the ear.

当然实际应用中,本领域技术人员也可以使用其他的数学模型,具体使用何种模型并不影响本发明的保护范围。Of course, in practical applications, those skilled in the art can also use other mathematical models, and the specific model used does not affect the protection scope of the present invention.

优选的,上述的步骤S2中对单面图像进行图像预处理的方法可以包括如图2所示的:Preferably, the method for performing image preprocessing on the single-sided image in the above step S2 may include as shown in Figure 2:

步骤S21,对所述单面图像进行中值滤波处理;Step S21, performing median filtering processing on the single-sided image;

步骤S22,对步骤S21中得到的图像进行Wallis滤波处理;Step S22, carrying out Wallis filter processing to the image obtained in step S21;

步骤S23,对步骤S22中得到的图像进行直方图增强处理,得到所述单面图像对应的灰度图像。Step S23, performing histogram enhancement processing on the image obtained in step S22 to obtain a grayscale image corresponding to the single-sided image.

实际应用中,在步骤S21之前,还会取玉米果果穗籽粒灰度图像f(x,y),其中f(x,y)是(x,y)像素点对应的灰度值。In practical applications, before step S21, a grayscale image f(x, y) of corn ear grains is also obtained, where f(x, y) is the grayscale value corresponding to the (x, y) pixel.

其中,步骤S21中的中值滤波处理中所采用的公式为如下公式(2):Wherein, the formula used in the median filter processing in step S21 is the following formula (2):

ff '' (( xx 00 ,, ythe y 00 )) == [[ SortSort (( xx ii ,, ythe y ii )) ∈∈ SS ωω ijij ff (( xx ii ,, ythe y ii )) ]] || SS || ++ 11 22 -- -- -- (( 22 ))

其中S为像素(x0,y0)的邻域集合其中包含(x0,y0),(x,y)表示S中的任意元素,f(x,y)表示(x,y)点的灰度值,|S|表示集合S中元素的个数,Sort表示排序,ω表示计算中间像素值时加上的权值。Where S is the neighborhood set of pixel (x 0 , y 0 ), which contains (x 0 , y 0 ), (x, y) represents any element in S, and f(x, y) represents (x, y) point The gray value of , |S| indicates the number of elements in the set S, Sort indicates sorting, and ω indicates the weight added when calculating the intermediate pixel value.

步骤S22中Wallis滤波处理所采用的公式为如下公式(3):The formula used in the Wallis filter processing in step S22 is the following formula (3):

gg (( ii ,, jj )) == [[ αα mm dd ++ (( 11 -- αα )) ff ‾‾ (( ii ,, jj )) ]] ++ [[ ff (( ii ,, jj )) -- ff ‾‾ (( ii ,, jj )) ]] AA σσ dd AσAσ (( ii ,, jj )) ++ σσ dd -- -- -- (( 33 ))

其中[f(i,j)]M×N表示原始图像,[g(i,j)]M×N表示增强后的图像,表示局部均值,md表示平均值,σd表示标准偏差,A表示增益系数,α是控制增强图像中边缘和背景组成的比例常数。Where [f(i,j)] M×N represents the original image, [g(i,j)] M×N represents the enhanced image, Represents the local mean, m d represents the mean value, σ d represents the standard deviation, A represents the gain coefficient, and α is a proportionality constant that controls the composition of edges and backgrounds in the enhanced image.

步骤S23中直方图增强处理所采用的公式为如下公式(4)The formula used in the histogram enhancement processing in step S23 is the following formula (4)

z=G-1[T(r)] (4)z=G -1 [T(r)] (4)

r表示图像增强前的像素灰度级,变换函数s=T(r)表示增强后的像素灰度值,逆变换函数z=G-1(s)表示所期望的新灰度级。r represents the pixel gray level before image enhancement, the transformation function s=T(r) represents the pixel gray value after enhancement, and the inverse transformation function z=G −1 (s) represents the desired new gray level.

优选的,所述步骤S3,具体包括:Preferably, said step S3 specifically includes:

采取RBGM和OTSU相结合的多阈值分割方法对步骤S2中得到的灰度图像进行图像分割进而得到玉米籽粒的二值图像。A multi-threshold segmentation method combining RBGM and OTSU is used to segment the gray image obtained in step S2 to obtain a binary image of corn kernels.

具体的,步骤S3可以包括如图3所示的各个步骤:Specifically, step S3 may include various steps as shown in Figure 3:

步骤S31,选择初始迭代点ti和迭代步长ηm对如下多阈值分割迭代求解公式(5)进行迭代求解,获取最佳分割阈值所述最佳分割阈值为使取最大值的分割阈值:Step S31, select the initial iteration point t i and the iteration step size η m to iteratively solve the following multi-threshold segmentation iterative solution formula (5), and obtain the optimal segmentation threshold The optimal segmentation threshold To make Take the maximum segmentation threshold:

xx ii mNn ++ jj ++ 11 == xx ii mNn ++ jj -- ηη mm ∂∂ σσ BB 22 ∂∂ tt ii ,, ii == 1,21,2 ,, .. .. .. ,, NN ;; -- -- -- (( 55 ))

其中, in,

j=0,1,...,N-1;m=0,1,... j=0,1,...,N-1; m=0,1,...

σσ BB 22 == ΣΣ kk == 00 nno -- 11 ΣΣ jj == kk ++ 11 nno -- 11 ωω kk ωω jj (( μμ kk -- μμ jj )) 22 ;;

其中ωk、μk分别为表示对n类问题进行分割时第k类问题对应的概率和均差。Among them, ω k and μ k respectively represent the probability and mean difference corresponding to the k-th type of problem when n-type problems are divided.

步骤S32,使用步骤S31中得到的最佳分割阈值对步骤S2中得到的灰度图像进行多阈值分割。Step S32, using the optimal segmentation threshold obtained in step S31 Perform multi-threshold segmentation on the grayscale image obtained in step S2.

上述步骤S31的原理在于:The principle of the above step S31 is:

假设对于n类分割问题,总方差标记为σ2,各类的概率、均值、方差分别标记为ωk、μk(k=0,1,...,n-1),各分割阈值的组合标记为t={tk|k=1,2,...,n-1},则有:Assume that for the n-class segmentation problem, the total variance is marked as σ 2 , and the probability, mean and variance of each class are marked as ω k , μ k , (k=0,1,...,n-1), the combination of each segmentation threshold is marked as t={t k |k=1,2,...,n-1}, then:

其中k=0,1,....,n-1(6) where k=0,1,....,n-1 (6)

t0=0,tn=L为直方图边界(7) t 0 =0, t n =L is the histogram boundary (7)

其中1<tk<L(k=1,2,...,n-1)为各分割阈值,(8) Where 1<t k <L(k=1,2,...,n-1) is each segmentation threshold, (8)

则多阈值各个类内方差为:Then the intra-class variance of multiple thresholds is:

&sigma;&sigma; ww 22 == &Sigma;&Sigma; kk == 00 nno -- 11 &omega;&omega; kk &sigma;&sigma; kk 22 -- -- -- (( 99 ))

类似于单阈值问题,建立多阈值问题的约束方程:Similar to the single-threshold problem, the constraint equation for the multi-threshold problem is established:

&sigma;&sigma; 22 == &Sigma;&Sigma; ii == 11 LL (( ii -- &mu;&mu; )) 22 PP ii == &Sigma;&Sigma; ii == 11 LL ii 22 PP ii -- 22 &mu;&mu; &Sigma;&Sigma; ii == 11 LL ii PP ii ++ &mu;&mu; 22 &Sigma;&Sigma; ii == 11 LL PP ii == &Sigma;&Sigma; ii == 11 LL ii 22 PP ii -- &mu;&mu; 22 ;;

根据以上公式可以得出 &sigma; 2 - &sigma; w 2 = &Sigma; k = 0 n - 1 &omega; k &mu; k 2 + &Sigma; k = 0 n - 1 &omega; k &mu; k &Sigma; j &NotEqual; k &omega; j &mu; j ; According to the above formula, it can be concluded that &sigma; 2 - &sigma; w 2 = &Sigma; k = 0 no - 1 &omega; k &mu; k 2 + &Sigma; k = 0 no - 1 &omega; k &mu; k &Sigma; j &NotEqual; k &omega; j &mu; j ;

经过整理推导可以得出 &sigma; B 2 = &sigma; 2 - &sigma; w 2 = &Sigma; k = 0 n - 1 &Sigma; j = k + 1 n - 1 &omega; k &omega; j ( &mu; k - &mu; j ) 2 - - - ( 10 ) ; 显然为相对于自变量ti的函数。After derivation, it can be concluded that &sigma; B 2 = &sigma; 2 - &sigma; w 2 = &Sigma; k = 0 no - 1 &Sigma; j = k + 1 no - 1 &omega; k &omega; j ( &mu; k - &mu; j ) 2 - - - ( 10 ) ; obviously is a function relative to the independent variable t i .

之后将梯度下降法(RBGM)公式(11)中的xi替换为ti,将f(x)替换为可得跌代求解公式(12):Then replace xi in gradient descent method (RBGM) formula (11) with t i , and replace f(x) with The descendant solution formula (12) can be obtained:

其中,in,

j=0,1,...,N-1;m=0,1,...。 j=0,1,...,N-1; m=0,1,....

xx ii mNn ++ jj ++ 11 == xx ii mNn ++ jj -- &eta;&eta; mm &PartialD;&PartialD; &sigma;&sigma; BB 22 &PartialD;&PartialD; tt ii ,, ii == 1,21,2 ,, .. .. .. ,, NN ;; -- -- -- (( 1212 )) ..

采用RBGM和OTSU相结合的多阈值分割方法针对处理传统OSTU多阈值分割方法中随着分割阈值数从单阈值增加到多阈值,对最佳阈值求解的计算量将成几何式增长的问题,采用该方法可以在相同精度下大大减少分割计算量,进而缩短分割计算时间。The multi-threshold segmentation method combined with RBGM and OTSU aims to deal with the problem that in the traditional OSTU multi-threshold segmentation method, as the number of segmentation thresholds increases from single threshold to multi-threshold, the amount of calculation for the optimal threshold will increase geometrically. The method can greatly reduce the calculation amount of segmentation under the same precision, and then shorten the calculation time of segmentation.

经步骤S3之后可以得到的玉米果穗籽粒的二值图像,其中每个玉米籽粒都被分割成一个连通的区域,此时,对具有相同灰度值的连通区域进行计数,获取具有用于表示玉米粒的灰度值对应的连通区域的个数,之后根据预先建立的玉米果穗籽粒估算模型计算玉米果穗籽粒总数。如图4(a)(b)中所示,玉米果穗籽粒的二值图像中每个玉米籽粒都被分割成一个连通的区域,即在这个区域内相邻的像素都有同样的灰度值0或者1。标识之前先初始化一个计数器C,初始值为1,用来计数单面玉米籽粒个数,p(x,y)代表像素在(x,y)点的像素值。从图像任意一个初始点(x0,y0)出发逐行对每个像素进行扫描,当遇到p(x,y)不为1时说明是图像背景或已标识像素跳过此像素;当遇到p(x,y)为1的像素时将该像素标识为计数器C值,并扫描像素相邻所有像素值为1的像素并将其值标识为C,完成标识后将C值加1,继续下一个像素标识。逐个标识像素直至所有像素被扫描完毕位置,最终得到单面玉米籽粒数。The binary image of corn ear grains that can be obtained after step S3, wherein each corn grain is divided into a connected area, at this time, the connected areas with the same gray value are counted to obtain the The number of connected regions corresponding to the gray value of the grain, and then calculate the total number of corn ear grains according to the pre-established corn ear grain estimation model. As shown in Figure 4(a)(b), each corn kernel in the binary image of corn ear kernels is divided into a connected area, that is, adjacent pixels in this area have the same gray value 0 or 1. Before marking, initialize a counter C with an initial value of 1, which is used to count the number of corn kernels on one side, and p(x, y) represents the pixel value of the pixel at point (x, y). Starting from any initial point of the image (x 0 , y 0 ), scan each pixel line by line. When p(x, y) is not 1, it means that it is the image background or the identified pixel skips this pixel; when When encountering a pixel where p(x,y) is 1, identify the pixel as the counter C value, and scan all pixels adjacent to the pixel with a value of 1 and identify its value as C, and add 1 to the C value after the identification is completed , continue to the next pixel identification. Identify the pixels one by one until all the pixels have been scanned, and finally get the number of corn kernels on one side.

本发明的有益效果包括:(1)利用计算机图形处理技术代替了手工玉米果穗籽粒计数法,可以快速、简便、准确地得出玉米果穗籽粒总数,克服了现有技术方案中玉米果穗籽粒计数时间长,主观性强,读取数据误差大等不足;(2)本发明通过将采集到的部分单面玉米果穗籽粒图像作为样本,根据图像中单面玉米果穗籽粒数与实际玉米果穗籽粒总数作回归分析,得到玉米果穗籽粒估算模型y=ax+b,并根据玉米籽估算模型,可以由图像中单面玉米籽粒数估算出玉米果穗籽粒总数,准确率达到93%;(3)本发明采用RBGM和OTSU相结合的多阈值分割方法针对处理传统OSTU多阈值分割方法中随着分割阈值数从单阈值增加到多阈值,对最佳阈值求解的计算量将成几何式增长的问题,采用该方法可以在相同精度下大大减少分割计算量,进而缩短分割计算时间。The beneficial effects of the present invention include: (1) Using computer graphic processing technology to replace the manual counting method of corn ear grains, the total number of corn ear grains can be quickly, easily and accurately obtained, which overcomes the time required for counting corn ear grains in the prior art scheme long, subjectivity, large error in reading data, etc.; (2) The present invention uses the collected images of some single-sided corn cobs as samples, and compares the number of single-sided corn cobs in the image with the actual total number of corn cobs. Regression analysis obtains the corn ear grain estimation model y=ax+b, and according to the corn seed estimation model, the total number of corn ear grains can be estimated from the number of corn grains on one side in the image, and the accuracy rate reaches 93%; (3) the present invention adopts The multi-threshold segmentation method combining RBGM and OTSU aims to deal with the problem that in the traditional OSTU multi-threshold segmentation method, as the number of segmentation thresholds increases from single threshold to multi-threshold, the amount of calculation for the optimal threshold will increase geometrically. This method is adopted. With the same accuracy, the amount of segmentation calculation can be greatly reduced, thereby shortening the segmentation calculation time.

实施例二Embodiment two

基于相同的构思,本发明还提供了一种玉米果穗籽粒计数装置,如图5所示,该装置包括:Based on the same design, the present invention also provides a corn ear grain counting device, as shown in Figure 5, the device includes:

建模模块501,用于获取玉米果穗籽粒估算模型;其中所述玉米果穗籽粒估算模型用于表示玉米单面的果穗籽粒数与全部果穗籽粒数之间的函数关系;The modeling module 501 is used to obtain an estimation model of corn ear grains; wherein the corn ear grain estimation model is used to represent the functional relationship between the number of ear grains on one side of corn and the number of all ear grains;

图像预处理模块502,用于获取玉米的单面图像,并对所述单面图像进行图像预处理,得到相应的灰度图像;Image preprocessing module 502, is used for obtaining the single-sided image of corn, and carries out image preprocessing to described single-sided image, obtains corresponding grayscale image;

图像分割模块503,用于对图像预处理模块502得到的灰度图像进行多阈值分割,得到相应的二值图像;An image segmentation module 503, configured to perform multi-threshold segmentation on the grayscale image obtained by the image preprocessing module 502, to obtain a corresponding binary image;

计数模块504,用于对具有相同灰度值的连通区域进行计数,获取具有用于表示玉米粒的灰度值对应的连通区域的个数;The counting module 504 is used to count the connected regions with the same gray value, and obtain the number of connected regions corresponding to the gray value used to represent the corn grain;

计算模块505,根据计数模块504中获取到的个数以及建模模块501获取的玉米粒估算模型确定全部果穗籽粒数。The calculation module 505 determines the number of grains in all ears according to the number obtained in the counting module 504 and the corn kernel estimation model obtained by the modeling module 501 .

优选的,建模模块501具体用于获取如下公式作为玉米果穗籽粒估算模型:Preferably, the modeling module 501 is specifically used to obtain the following formula as a corn ear grain estimation model:

y=ax+b;y=ax+b;

其中,x表示玉米果穗的单面图像中的玉米籽粒数,a、b为训练值,y为全部果穗籽粒数。Among them, x represents the number of corn kernels in the single-sided image of corn ears, a and b are training values, and y is the number of kernels in all ears.

优选的,图像预处理模块502具体包括:Preferably, the image preprocessing module 502 specifically includes:

第一处理子模块,用于对所述单面图像进行中值滤波处理;The first processing submodule is used to perform median filtering processing on the single-sided image;

第二处理子模块,用于对第一处理子模块得到的图像进行Wallis滤波处理;The second processing submodule is used to perform Wallis filter processing on the image obtained by the first processing submodule;

第三处理子模块,用于对第二处理子模块得到的图像进行直方图增强处理,得到所述单面图像对应的灰度图像。The third processing submodule is configured to perform histogram enhancement processing on the image obtained by the second processing submodule to obtain a grayscale image corresponding to the single-sided image.

优选的,图像分割模块503,具体用于采取RBGM和OTSU相结合的多阈值分割方法对图像预处理模块502得到的灰度图像进行图像分割进而得到玉米籽粒的二值图像。Preferably, the image segmentation module 503 is specifically used to perform image segmentation on the grayscale image obtained by the image preprocessing module 502 by adopting a multi-threshold segmentation method combining RBGM and OTSU to obtain a binary image of corn kernels.

优选的,分割模块图像分割模块用于采取RBGM和OTSU相结合的多阈值分割方法对图像预处理模块502得到的灰度图像进行图像分割进而得到玉米籽粒的二值图像时,具体用于执行:Preferably, when the segmentation module image segmentation module is used to adopt the multi-threshold segmentation method combined with RBGM and OTSU to perform image segmentation on the grayscale image obtained by the image preprocessing module 502 and then obtain the binary image of corn kernels, it is specifically used to perform:

步骤S31,选择初始迭代点ti和迭代步长ηm对如下多阈值分割迭代求解公式进行迭代求解,获取最佳分割阈值所述最佳分割阈值为使取最大值的分割阈值:Step S31, select the initial iteration point t i and the iteration step size η m to iteratively solve the following multi-threshold segmentation iterative solution formula, and obtain the optimal segmentation threshold The optimal segmentation threshold To make Take the maximum segmentation threshold:

xx ii mNn ++ jj ++ 11 == xx ii mNn ++ jj -- &eta;&eta; mm &PartialD;&PartialD; &sigma;&sigma; BB 22 &PartialD;&PartialD; tt ii ,, ii == 1,21,2 ,, .. .. .. ,, NN ;;

其中, in,

j=0,1,...,N-1;m=0,1,... j=0,1,...,N-1; m=0,1,...

&sigma;&sigma; BB 22 == &Sigma;&Sigma; kk == 00 nno -- 11 &Sigma;&Sigma; jj == kk ++ 11 nno -- 11 &omega;&omega; kk &omega;&omega; jj (( &mu;&mu; kk -- &mu;&mu; jj )) 22 ;;

其中ωk、μk分别为表示对n类问题进行分割时第k类问题对应的概率和均差;Among them, ω k and μ k represent the probability and mean difference corresponding to the k-th type of problem when the n-type problem is divided;

步骤S32,使用步骤S31中得到的最佳分割阈值对步骤S2中得到的灰度图像进行多阈值分割。Step S32, using the optimal segmentation threshold obtained in step S31 Perform multi-threshold segmentation on the grayscale image obtained in step S2.

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明技术原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, it should be pointed out that for those of ordinary skill in the art, without departing from the technical principle of the present invention, some improvements and modifications can also be made. These improvements and modifications It should also be regarded as the protection scope of the present invention.

Claims (8)

1.一种玉米果穗籽粒计数方法,其特征在于,包括:1. A corn ear grain counting method is characterized in that, comprising: 步骤S1,获取玉米果穗籽粒估算模型;其中所述玉米果穗籽粒估算模型用于表示玉米单面的果穗籽粒数与全部果穗籽粒数之间的函数关系;Step S1, obtaining a corn ear grain estimation model; wherein the corn ear grain estimation model is used to represent the functional relationship between the number of corn ear grains on one side of the corn and the number of all ear grains; 步骤S2,获取玉米的单面图像,并对所述单面图像进行图像预处理,得到相应的灰度图像;Step S2, obtaining a single-sided image of corn, and performing image preprocessing on the single-sided image to obtain a corresponding grayscale image; 步骤S3,对步骤S2中得到的灰度图像进行多阈值分割,得到相应的二值图像;Step S3, performing multi-threshold segmentation on the grayscale image obtained in step S2 to obtain a corresponding binary image; 步骤S4,对具有相同灰度值的连通区域进行计数,获取具有用于表示玉米粒的灰度值的连通区域的个数;Step S4, count the connected regions with the same gray value, and obtain the number of connected regions with the gray value used to represent the corn grain; 步骤S5,根据步骤S4中获取到的个数以及步骤S1中的玉米粒估算模型确定全部果穗籽粒数;Step S5, according to the number obtained in step S4 and the corn kernel estimation model in step S1, determine the number of grains of all ears; 其中,所述步骤S1具体包括:Wherein, the step S1 specifically includes: 获取如下公式作为玉米果穗籽粒估算模型:Obtain the following formula as the corn ear kernel estimation model: y=ax+b;y=ax+b; 其中,x表示玉米果穗的单面图像中的玉米籽粒数,a、b为训练值,y为全部果穗籽粒数。Among them, x represents the number of corn kernels in the single-sided image of corn ears, a and b are training values, and y is the number of kernels in all ears. 2.如权利要求1所述的方法,其特征在于,所述步骤S2包括:2. The method according to claim 1, wherein said step S2 comprises: 步骤S21,对所述单面图像进行中值滤波处理;Step S21, performing median filtering processing on the single-sided image; 步骤S22,对步骤S21中得到的图像进行Wallis滤波处理;Step S22, carrying out Wallis filter processing to the image obtained in step S21; 步骤S23,对步骤S22中得到的图像进行直方图增强处理,得到所述单面图像对应的灰度图像。Step S23, performing histogram enhancement processing on the image obtained in step S22 to obtain a grayscale image corresponding to the single-sided image. 3.如权利要求1所述的方法,其特征在于,所述步骤S3,具体包括:3. The method according to claim 1, wherein said step S3 specifically comprises: 采取梯度下降法RBGM和最大类间方差法OTSU相结合的多阈值分割方法对步骤S2中得到的灰度图像进行图像分割进而得到玉米籽粒的二值图像。A multi-threshold segmentation method combining the gradient descent method RBGM and the maximum between-class variance method OTSU is used to segment the gray image obtained in step S2 to obtain a binary image of corn kernels. 4.如权利要求3所述的方法,其特征在于,所述采取RBGM和OTSU相结合的多阈值分割方法对玉米果穗籽粒灰度图像进行图像分割进而得到玉米籽粒的二值图像,具体包括:4. The method according to claim 3, wherein the multi-threshold segmentation method combining RBGM and OTSU is used to perform image segmentation on the corn ear grain grayscale image and then obtain the binary image of the corn grain, specifically comprising: 步骤S31,选择初始迭代点ti和迭代步长ηm对如下多阈值分割迭代求解公式进行迭代求解,获取最佳分割阈值所述最佳分割阈值为使取最大值的分割阈值:Step S31, select the initial iteration point t i and the iteration step size η m to iteratively solve the following multi-threshold segmentation iterative solution formula, and obtain the optimal segmentation threshold The optimal segmentation threshold To make Take the maximum segmentation threshold: xx ii mm NN ++ jj ++ 11 == xx ii mm NN ++ jj -- &eta;&eta; mm &part;&part; &sigma;&sigma; BB 22 &part;&part; tt ii ,, ii == 11 ,, 22 ,, ...... ,, NN ;; 其中,xi mN+j+1=xi mN+jmΔi(xi mN+j),i=1,2,...,NAmong them, x i mN+j+1 = x i mN+jm Δ i ( xi mN+j ), i=1,2,...,N &Delta;&Delta; ii (( xx mm nno ++ jj )) == &part;&part; ff (( xx mm nno ++ jj )) &part;&part; xx ii ,, jj == ii -- 11 00 ,, jj &NotEqual;&NotEqual; ii -- 11 ,, jj == 00 ,, 11 ,, ...... ,, NN -- 11 ;; mm == 00 ,, 11 ,, ...... &sigma;&sigma; BB 22 == &Sigma;&Sigma; kk == 00 nno -- 11 &Sigma;&Sigma; jj == kk ++ 11 nno -- 11 &omega;&omega; kk &omega;&omega; ii (( &mu;&mu; kk -- &mu;&mu; jj )) 22 ;; 其中ωk、μk分别为表示对n类问题进行分割时第k类问题对应的概率和均差;Among them, ω k and μ k represent the probability and mean difference corresponding to the k-th type of problem when the n-type problem is divided; 步骤S32,使用步骤S31中得到的最佳分割阈值对步骤S2中得到的灰度图像进行多阈值分割。Step S32, using the optimal segmentation threshold obtained in step S31 Perform multi-threshold segmentation on the grayscale image obtained in step S2. 5.一种玉米果穗籽粒计数装置,其特征在于,包括:5. A corn ear grain counting device is characterized in that, comprising: 建模模块,用于获取玉米果穗籽粒估算模型;其中所述玉米果穗籽粒估算模型用于表示玉米单面的果穗籽粒数与全部果穗籽粒数之间的函数关系;The modeling module is used to obtain an estimation model of corn ear grains; wherein the corn ear grain estimation model is used to represent the functional relationship between the number of ear grains on one side of corn and the number of all ear grains; 图像预处理模块,用于获取玉米的单面图像,并对所述单面图像进行图像预处理,得到相应的灰度图像;An image preprocessing module, used to obtain a single-sided image of corn, and perform image preprocessing on the single-sided image to obtain a corresponding grayscale image; 图像分割模块,用于对所述图像预处理模块得到的灰度图像进行多阈值分割,得到相应的二值图像;An image segmentation module, configured to perform multi-threshold segmentation on the grayscale image obtained by the image preprocessing module to obtain a corresponding binary image; 计数模块,用于对具有相同灰度值的连通区域进行计数,获取具有用于表示玉米粒的灰度值的连通区域的个数;The counting module is used to count the connected regions with the same gray value, and obtains the number of connected regions with the gray value used to represent corn grains; 计算模块,根据所述计数模块中获取到的个数以及所述建模模块获取的玉米粒估算模型确定全部果穗籽粒数;Calculation module, according to the number obtained in the counting module and the corn kernel estimation model obtained by the modeling module to determine the number of grains of all ears; 其中,所述建模模块具体用于获取如下公式作为玉米果穗籽粒估算模型:Wherein, the modeling module is specifically used to obtain the following formula as a corn ear grain estimation model: y=ax+b;y=ax+b; 其中,x表示玉米果穗的单面图像中的玉米籽粒数,a、b为训练值,y为全部果穗籽粒数。Among them, x represents the number of corn kernels in the single-sided image of corn ears, a and b are training values, and y is the number of kernels in all ears. 6.如权利要求5所述的装置,其特征在于,所述图像预处理模块包括:6. The device according to claim 5, wherein the image preprocessing module comprises: 第一处理子模块,用于对所述单面图像进行中值滤波处理;The first processing submodule is used to perform median filtering processing on the single-sided image; 第二处理子模块,用于对第一处理子模块得到的图像进行Wallis滤波处理;The second processing submodule is used to perform Wallis filter processing on the image obtained by the first processing submodule; 第三处理子模块,用于对第二处理子模块得到的图像进行直方图增强处理,得到所述单面图像对应的灰度图像。The third processing submodule is configured to perform histogram enhancement processing on the image obtained by the second processing submodule to obtain a grayscale image corresponding to the single-sided image. 7.如权利要求5所述的装置,其特征在于,所述图像分割模块,具体用于采取梯度下降法RBGM和最大类间方差法OTSU相结合的多阈值分割方法对所述图像预处理模块得到的灰度图像进行图像分割进而得到玉米籽粒的二值图像。7. The device according to claim 5, wherein the image segmentation module is specifically configured to use a multi-threshold segmentation method combining the gradient descent method RBGM and the maximum inter-class variance method OTSU to process the image preprocessing module The obtained grayscale image is segmented to obtain a binary image of corn kernels. 8.如权利要求7所述的装置,其特征在于,所述图像分割模块用于采取RBGM和OTSU相结合的多阈值分割方法对所述图像预处理模块得到的灰度图像进行图像分割进而得到玉米籽粒的二值图像时,具体用于执行:8. The device according to claim 7, wherein the image segmentation module is used to perform image segmentation on the grayscale image obtained by the image preprocessing module using a multi-threshold segmentation method combining RBGM and OTSU to obtain When the binary image of corn kernels is used, it is specifically used to execute: 步骤S31,选择初始迭代点ti和迭代步长ηm对如下多阈值分割迭代求解公式进行迭代求解,获取最佳分割阈值所述最佳分割阈值为使取最大值的分割阈值:Step S31, select the initial iteration point t i and the iteration step size η m to iteratively solve the following multi-threshold segmentation iterative solution formula, and obtain the optimal segmentation threshold The optimal segmentation threshold To make Take the maximum segmentation threshold: xx ii mm NN ++ jj ++ 11 == xx ii mm NN ++ jj -- &eta;&eta; mm &part;&part; &sigma;&sigma; BB 22 &part;&part; tt ii ,, ii == 11 ,, 22 ,, ...... ,, NN ;; 其中,xi mN+j+1=xi mN+jmΔi(xi mN+j),i=1,2,...,NAmong them, x i mN+j+1 = x i mN+jm Δ i ( xi mN+j ), i=1,2,...,N &Delta;&Delta; ii (( xx mm nno ++ jj )) == &part;&part; ff (( xx mm nno ++ jj )) &part;&part; xx ii ,, jj == ii -- 11 00 ,, jj &NotEqual;&NotEqual; ii -- 11 ,, jj == 00 ,, 11 ,, ...... ,, NN -- 11 ;; mm == 00 ,, 11 ,, ...... &sigma;&sigma; BB 22 == &Sigma;&Sigma; kk == 00 nno -- 11 &Sigma;&Sigma; jj == kk ++ 11 nno -- 11 &omega;&omega; kk &omega;&omega; ii (( &mu;&mu; kk -- &mu;&mu; jj )) 22 ;; 其中ωk、μk分别为表示对n类问题进行分割时第k类问题对应的概率和均差;Among them, ω k and μ k represent the probability and mean difference corresponding to the k-th type of problem when the n-type problem is divided; 步骤S32,使用步骤S31中得到的最佳分割阈值对步骤S2中得到的灰度图像进行多阈值分割。Step S32, using the optimal segmentation threshold obtained in step S31 Perform multi-threshold segmentation on the grayscale image obtained in step S2.
CN201410008628.6A 2014-01-08 2014-01-08 Counting method and device for corn ear grains Expired - Fee Related CN103810522B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410008628.6A CN103810522B (en) 2014-01-08 2014-01-08 Counting method and device for corn ear grains

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410008628.6A CN103810522B (en) 2014-01-08 2014-01-08 Counting method and device for corn ear grains

Publications (2)

Publication Number Publication Date
CN103810522A CN103810522A (en) 2014-05-21
CN103810522B true CN103810522B (en) 2017-02-08

Family

ID=50707261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410008628.6A Expired - Fee Related CN103810522B (en) 2014-01-08 2014-01-08 Counting method and device for corn ear grains

Country Status (1)

Country Link
CN (1) CN103810522B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN106485708B (en) * 2016-10-11 2018-12-28 南京航空航天大学 A kind of round log method of counting based on image recognition
CN109863530B (en) * 2016-10-19 2022-11-15 巴斯夫农化商标有限公司 Method, system and computer-readable storage medium for determining grain weight of ears
CN110490868B (en) * 2019-08-23 2023-05-30 陈�峰 Nondestructive counting method based on computer vision corn cob grain number
CN110806373B (en) * 2019-10-08 2022-05-10 郑州轻工业学院 Seed cotton lint rate testing equipment and seed cotton lint rate detection method
CN116129331B (en) * 2023-04-12 2023-07-04 成都航空职业技术学院 Method and device for counting number of through holes on surface of rotary part
CN117455912B (en) * 2023-12-23 2024-03-19 安徽农业大学 Corn cob and grain panoramic counting method and counting system based on three plane mirrors

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4900915A (en) * 1987-11-17 1990-02-13 Heineken Technisch Beheer B.V. Method of counting articles supplied on a conveyor track in a random pattern
CN102750584A (en) * 2012-04-18 2012-10-24 中国农业大学 On-corncob corn niblet counting method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4900915A (en) * 1987-11-17 1990-02-13 Heineken Technisch Beheer B.V. Method of counting articles supplied on a conveyor track in a random pattern
CN102750584A (en) * 2012-04-18 2012-10-24 中国农业大学 On-corncob corn niblet counting method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
一种新的二值图像连通区域准确标记算法;刘贤喜 等;《计算机工程与应用》;20071131;第43卷(第22期);第76页-78页、第98页 *
基于机器视觉的颗粒识别计数;王海燕 等;《长春工程学院学报》;20101231;第14卷(第4期);第101页-104页 *
采用全景技术的机器视觉测量玉米果穗考种指标;王传宇 等;《采用全景技术的机器视觉测量玉米果穗考种指标》;20131231;第29 卷(第24 期);第155页-162页 *

Also Published As

Publication number Publication date
CN103810522A (en) 2014-05-21

Similar Documents

Publication Publication Date Title
CN103810522B (en) Counting method and device for corn ear grains
CN106485251B (en) Classification of egg embryos based on deep learning
CN105957086B (en) A kind of method for detecting change of remote sensing image based on optimization neural network model
CN102722713B (en) Handwritten numeral recognition method based on lie group structure data and system thereof
CN105117734B (en) Corn seed classification hyperspectral imagery recognition methods based on model online updating
CN109766742B (en) Corn seed crack identification method, device, system, equipment and storage medium
CN108710907B (en) Handwritten data classification method, model training method, device, equipment and medium
CN109801308B (en) Segmentation method of adhesive circular target image
CN111143567B (en) Comment emotion analysis method based on improved neural network
CN108009567B (en) An Automatic Discrimination Method of Fecal Traits Combining Image Color and HOG and SVM
CN109215040B (en) Breast tumor segmentation method based on multi-scale weighted learning
CN113392875B (en) Method, system and equipment for classifying fine granularity of image
CN108805196A (en) Auto-increment learning method for image recognition
CN108960264A (en) The training method and device of disaggregated model
CN107315999A (en) A kind of tobacco plant recognition methods based on depth convolutional neural networks
CN107481218A (en) Image aesthetic feeling appraisal procedure and device
CN104750982A (en) Reliability interval estimation method based on proportion grouping re-sampling
CN102663410A (en) Method and system for detecting microcalcifications in mammogram
Shi et al. Barley variety identification by IPhone images and deep learning
CN113627522A (en) Image classification method, device, device and storage medium based on relational network
CN107578448B (en) A CNN-based method for identifying the number of spliced surfaces contained in uncalibrated surfaces
CN103903010A (en) Method for classifying hyperspectral images based on sparse characteristics and same neighborhood properties
CN109241869A (en) The recognition methods of answering card score, device and terminal device
CN108520261A (en) A method and device for identifying the number of peanut kernels
CN113780335A (en) A small sample commodity image classification method, device, equipment and storage medium

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

Granted publication date: 20170208

CF01 Termination of patent right due to non-payment of annual fee