CN107220647A - Crop location of the core method and system under a kind of blade crossing condition - Google Patents
Crop location of the core method and system under a kind of blade crossing condition Download PDFInfo
- Publication number
- CN107220647A CN107220647A CN201710415434.1A CN201710415434A CN107220647A CN 107220647 A CN107220647 A CN 107220647A CN 201710415434 A CN201710415434 A CN 201710415434A CN 107220647 A CN107220647 A CN 107220647A
- Authority
- CN
- China
- Prior art keywords
- image
- target crop
- crop
- grayscale image
- coordinates
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 74
- 238000004422 calculation algorithm Methods 0.000 claims description 14
- 230000000877 morphologic effect Effects 0.000 claims description 10
- 241000196324 Embryophyta Species 0.000 claims description 7
- 241001270131 Agaricus moelleri Species 0.000 claims description 5
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 240000008042 Zea mays Species 0.000 description 34
- 235000005824 Zea mays ssp. parviglumis Nutrition 0.000 description 34
- 235000002017 Zea mays subsp mays Nutrition 0.000 description 34
- 235000005822 corn Nutrition 0.000 description 34
- 238000010586 diagram Methods 0.000 description 24
- 238000004590 computer program Methods 0.000 description 4
- 230000006399 behavior Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000001788 irregular Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000010191 image analysis Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/25—Determination of region of interest [ROI] or a volume of interest [VOI]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/28—Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/30—Noise filtering
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
本发明提供一种叶片交叉条件下作物中心点定位方法及系统,所述方法包括:基于目标作物的原始灰度图像,获取目标作物的灰度图像和二值图像;基于所述目标作物的灰度图像和二值图像,获得目标作物的中心点坐标。本发明所述方案具有如下有益效果:能够有效排除作物交叉叶片的干扰,提高作物中心点定位的精度和速度。
The present invention provides a method and system for locating the center point of a crop under the condition of leaves crossing. The method includes: acquiring a grayscale image and a binary image of the target crop based on the original grayscale image of the target crop; Degree image and binary image to obtain the coordinates of the center point of the target crop. The solution of the present invention has the following beneficial effects: the interference of crossing leaves of crops can be effectively eliminated, and the accuracy and speed of positioning the center point of crops can be improved.
Description
技术领域technical field
本发明涉及作物自动识别定位技术领域,更具体地,涉及一种叶片交叉条件下作物中心点定位方法及系统。The present invention relates to the technical field of automatic identification and positioning of crops, and more particularly, to a method and system for locating the center point of crops under the condition of leaves crossing.
背景技术Background technique
基于机器视觉的作物自动识别和定位技术可以快速获取作物的分布情况,为作物的田间机械化管理提供参考,有助于减少劳动者的工作强度,提高作业效率和精度。作物的自动识别和定位通常可通过采集作物的二维彩色图像或三维位置信息来实现。二维彩色图像利用彩色相机获得,包含作物的颜色信息,应用灵活,使用成本较低;三维位置数据需要通过深度相机、立体相机或激光传感器获得,可生成作物的点云数据,成本较高,计算数据量大。因而基于彩色图像的作物识别和定位一直是科研的热点。The crop automatic identification and positioning technology based on machine vision can quickly obtain the distribution of crops, provide reference for mechanized management of crops in the field, help reduce labor intensity, and improve work efficiency and precision. The automatic identification and location of crops can usually be realized by collecting two-dimensional color images or three-dimensional position information of crops. The two-dimensional color image is obtained by a color camera, which contains the color information of the crop, and has flexible application and low cost of use; the three-dimensional position data needs to be obtained by a depth camera, a stereo camera or a laser sensor, which can generate point cloud data of the crop, and the cost is relatively high. The amount of calculation data is large. Therefore, crop identification and positioning based on color images has always been a research hotspot.
基于彩色图像的作物识别和定位方法是利用彩色相机获取作物的图像信息,通过对图像进行分析处理,提取作物并定位其中心点。一般应用作物的绿色信息将作物从复杂的背景中分割出来,提取出作物的轮廓及联通区域,然后计算联通区域的质心获得作物的中心点。但是该方法在探测形状不规则的作物时,作物中心点的定位容易出现偏差。The method of crop identification and location based on color images is to use color cameras to obtain image information of crops, and through image analysis and processing, crops are extracted and their center points are located. Generally, the green information of the crop is used to segment the crop from the complex background, extract the outline of the crop and the connected area, and then calculate the centroid of the connected area to obtain the center point of the crop. However, when this method detects crops with irregular shapes, the location of the crop center point is prone to deviation.
现有技术对提取出的目标作物,首先通过像素行的直方图统计确定待测作物行,然后对待测作物行进行像素列的直方图统计,确定作物的中心点,这种方法可以克服作物形状不规则对定位造成的影响,但在作物叶片出现交叉时,会造成作物中心点定位的失败。叶片出现交叉情况时,通常对作物图像进行骨架化处理。在图像的骨架中,叶片的末端位置会出现末端点,叶片的交叉及作物中心点位置会存在交叉点,检索骨架中的末端点和交叉点,对交叉点进行分类和逻辑判断,从而实现对作物中心点的定位,但是这种方法计算量较大,且准确率较低。In the prior art, for the extracted target crops, firstly, the crop row to be tested is determined through the histogram statistics of the pixel rows, and then the histogram statistics of the pixel columns are performed on the crop row to be tested to determine the center point of the crop. This method can overcome the crop shape The impact of irregularities on positioning, but when crop leaves cross, it will cause the failure of crop center point positioning. Crop images are usually skeletonized when leaves cross. In the skeleton of the image, there will be an end point at the end position of the leaf, and there will be an intersection point at the intersection of the leaf and the center point of the crop. Retrieve the end point and intersection point in the skeleton, and classify and logically judge the intersection point, so as to realize the The location of the crop center point, but this method has a large amount of calculation and low accuracy.
发明内容Contents of the invention
本发明为克服上述问题或者至少部分地解决上述问题,提供一种叶片交叉条件下作物中心点定位方法及系统。In order to overcome the above problems or at least partly solve the above problems, the present invention provides a method and system for locating the center point of crops under the condition of leaves crossing.
根据本发明的一个方面,提出一种叶片交叉条件下作物中心点定位方法,包括:According to one aspect of the present invention, a kind of crop center point location method under the condition of crossing leaves is proposed, comprising:
步骤1,基于目标作物的原始灰度图像,获取目标作物的灰度图像和二值图像;Step 1, based on the original grayscale image of the target crop, obtain the grayscale image and binary image of the target crop;
步骤2,基于所述目标作物的灰度图像和二值图像,获得目标作物的中心点坐标。Step 2, based on the grayscale image and the binary image of the target crop, the coordinates of the center point of the target crop are obtained.
进一步,所述步骤1进一步包括:Further, said step 1 further includes:
S11,基于目标作物的原始灰度图像,获得所述目标作物原始灰度图像的二值图像;S11. Obtain a binary image of the original grayscale image of the target crop based on the original grayscale image of the target crop;
S12,对所述目标作物原始灰度图像的二值图像进行形态学去噪处理,确定所述目标作物的图像兴趣区;S12, performing morphological denoising processing on the binary image of the original grayscale image of the target crop, and determining an image interest area of the target crop;
S13,基于所述目标作物的图像兴趣区,获取所述目标作物图像兴趣区的二值图像。S13. Based on the ROI of the image of the target crop, acquire a binary image of the ROI of the image of the target crop.
进一步,所述步骤2进一步包括:Further, said step 2 further includes:
S21,将所述目标作物的原始灰度图像与所述目标作物的图像兴趣区的二值图像融合,获得目标作物的图像兴趣区的灰度图像;S21. Fusing the original grayscale image of the target crop with the binary image of the image region of interest of the target crop to obtain a grayscale image of the image region of interest of the target crop;
S22,获得所述目标作物的图像兴趣区的灰度图像的极小值点;获得所述目标作物的图像兴趣区的灰度图像中与周围像素点落差大于阈值的极小值点;S22. Obtain the minimum value point of the grayscale image of the image region of interest of the target crop; obtain the minimum value point in the grayscale image of the image region of interest of the target crop with a difference from surrounding pixel points greater than a threshold;
S23,基于所述目标作物的图像兴趣区的灰度图像和所述S22获得的极小值点,利用分水岭算法,获得目标作物的中心点坐标。S23, based on the grayscale image of the image region of interest of the target crop and the minimum point obtained in S22, using the watershed algorithm to obtain the coordinates of the center point of the target crop.
进一步,所述步骤1前还包括:Further, before the step 1, it also includes:
将目标作物的初始图像进行灰度化处理,所述灰度化处理包括以下步骤,The initial image of the target crop is subjected to grayscale processing, and the grayscale processing includes the following steps,
Igray(i,j)=G(i,j)*1.262-R(i,j)*0.884-B(i,j)*0.311,I gray (i,j)=G(i,j)*1.262-R(i,j)*0.884-B(i,j)*0.311,
其中i、j为像素的行列坐标,G(i,j)、R(i,j)和B(i,j)分别为图像(i,j)处像素G、R、B颜色分量的灰度值,Igray(i,j)为转换后图像(i,j)处像素的灰度值。Where i and j are the row and column coordinates of the pixel, and G(i,j), R(i,j) and B(i,j) are the grayscales of the G, R and B color components of the pixel at image (i,j) respectively value, Igray(i,j) is the gray value of the pixel at (i,j) in the transformed image.
进一步,所述S12进一步包括:Further, said S12 further includes:
基于目标作物的原始灰度图像,获得所述目标作物原始灰度图像的二值图像的转换阈值利用最大类间方差法求得。Based on the original grayscale image of the target crop, the conversion threshold for obtaining the binary image of the original grayscale image of the target crop is obtained by using the maximum inter-class variance method.
进一步,所述S12进一步包括:Further, said S12 further includes:
利用形态学开操作去除对所述目标作物原始灰度图像的二值图像中杂草噪声的干扰;Using the morphological opening operation to remove the interference of weed noise in the binary image of the original grayscale image of the target crop;
对去噪后所述目标作物原始灰度图像的二值图像的像素值进行水平投影,获得以像素行坐标为横坐标的投影曲线;以中间像素行为分界,将投影曲线分成两部分,寻找每条曲线最小值位置对应的像素行坐标,两个像素行之间区域为所述目标作物的图像兴趣区。Horizontally project the pixel values of the binary image of the original grayscale image of the target crop after denoising to obtain a projection curve with the pixel row coordinates as the abscissa; divide the projection curve into two parts with the intermediate pixel behavior, and find each The coordinates of the pixel row corresponding to the position of the minimum value of the curve, and the area between two pixel rows is the image interest area of the target crop.
进一步,所述S22进一步包括:Further, said S22 further includes:
计算所述目标作物的图像兴趣区的灰度图像中八邻域内的极小值点和极大值点,并分别计算极小值点和极大值点的平均值,二者的差值,作为阈值,保留与周围像素点落差大于阈值的极小值点,获得最终的局部极小值。Calculate the minimum value point and the maximum value point in the eight neighbors in the grayscale image of the image interest area of the target crop, and calculate the average value of the minimum value point and the maximum value point, the difference between the two, As a threshold, keep the minimum value points whose drop from the surrounding pixels is greater than the threshold value, and obtain the final local minimum value.
进一步,所述S23进一步包括:Further, said S23 further includes:
利用所述S22获得的极小值点对所述目标作物的图像兴趣区的灰度图像进行前景标记;利用分水岭算法对标记后的灰度图像为输入图像,获得目标作物的中心区域;Using the minimum value point obtained in S22 to carry out foreground marking on the grayscale image of the image interest area of the target crop; using the watershed algorithm to use the marked grayscale image as an input image to obtain the central area of the target crop;
基于目标作物的中心区域,分别对中心区域内像素点的x坐标、y坐标相加求和,并统计中心区域内像素点的个数,x坐标和、y坐标和与像素点个数的比值即为最终的作物中心点坐标。Based on the central area of the target crop, add and sum the x-coordinates and y-coordinates of the pixels in the central area, and count the number of pixels in the central area, the ratio of the x-coordinate sum, y-coordinate sum to the number of pixel points That is, the coordinates of the final crop center point.
根据本发明另一方面,提供一种叶片交叉条件下作物中心点定位系统,包括:According to another aspect of the present invention, there is provided a crop center point positioning system under leaf crossing conditions, comprising:
获取模块,用于基于目标作物的原始灰度图像,获取目标作物的灰度图像和二值图像;The obtaining module is used to obtain the grayscale image and the binary image of the target crop based on the original grayscale image of the target crop;
定位模块,用于基于所述目标作物的灰度图像和二值图像,获得目标作物的中心点坐标。The positioning module is used to obtain the coordinates of the center point of the target crop based on the grayscale image and the binary image of the target crop.
根据本发明又一方面,提供一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行如上述任一所述的方法。According to yet another aspect of the present invention, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to perform any one of the above-mentioned the method described.
本申请提出一种叶片交叉条件下作物中心点定位方法及系统,本发明所述方案具有如下有益效果:能够有效排除作物交叉叶片的干扰,提高作物中心点定位的精度和速度。The present application proposes a method and system for locating the center point of crops under the condition of intersecting leaves. The scheme of the invention has the following beneficial effects: it can effectively eliminate the interference of intersecting leaves of crops, and improve the accuracy and speed of locating the center point of crops.
附图说明Description of drawings
图1为根据本发明实施例一种叶片交叉条件下作物中心点定位方法的整体流程示意图;1 is a schematic diagram of the overall flow of a method for locating the center point of a crop under the condition of crossing leaves according to an embodiment of the present invention;
图2为根据本发明实施例一种叶片交叉条件下作物中心点定位方法的流程示意图;2 is a schematic flow diagram of a method for locating the center point of a crop under the condition of crossing leaves according to an embodiment of the present invention;
图3为根据本发明实施例一种叶片交叉条件下作物中心点定位方法的目标作物的原始灰度图像示意图;3 is a schematic diagram of an original grayscale image of a target crop according to a method for locating the center point of a crop under the condition of crossing leaves according to an embodiment of the present invention;
图4为根据本发明实施例一种叶片交叉条件下作物中心点定位方法的目标作物的原始二值图像示意图;4 is a schematic diagram of an original binary image of a target crop according to a method for locating the center point of a crop under the condition of crossing leaves according to an embodiment of the present invention;
图5为根据本发明实施例一种叶片交叉条件下作物中心点定位方法中所述目标作物原始灰度图像的二值图像水平投影示意图;5 is a schematic diagram of a binary image horizontal projection of the original grayscale image of the target crop in a method for locating the center point of the crop under the leaf crossing condition according to an embodiment of the present invention;
图6为根据本发明实施例一种叶片交叉条件下玉米中心点定位方法中所述目标玉米图像兴趣区示意图;6 is a schematic diagram of the interest area of the target corn image in a method for locating the center point of corn under the condition of crossing leaves according to an embodiment of the present invention;
图7为根据本发明实施例一种叶片交叉条件下玉米中心点定位方法中所述目标玉米的原始灰度图像示意图;7 is a schematic diagram of the original grayscale image of the target corn in a method for locating the center point of the corn under the condition of crossing leaves according to an embodiment of the present invention;
图8为根据本发明实施例一种叶片交叉条件下玉米中心点定位方法中所述目标玉米的二值图像示意图。Fig. 8 is a schematic diagram of a binary image of the target corn in a method for locating the center point of corn under the condition of crossing leaves according to an embodiment of the present invention.
图9为根据本发明实施例一种叶片交叉条件下玉米中心点定位方法中所述目标玉米的原始灰度图像的极小值区域示意图;9 is a schematic diagram of the minimum value region of the original grayscale image of the target corn in a method for locating the center point of the corn under the leaf crossing condition according to an embodiment of the present invention;
图10为根据本发明实施例一种叶片交叉条件下玉米中心点定位方法中利用分水岭算法分割处理得到的作物中心区域示意图;Fig. 10 is a schematic diagram of the crop center area obtained by segmentation processing using the watershed algorithm in a method for locating the center point of corn under the condition of crossing leaves according to an embodiment of the present invention;
图11为根据本发明实施例一种叶片交叉条件下玉米中心点定位方法中利用分水岭算法分割处理得到的玉米中心点坐标示意图;11 is a schematic diagram of the coordinates of the corn center point obtained by using the watershed algorithm in a method for locating the center point of corn under the condition of crossing leaves according to an embodiment of the present invention;
图12为根据本发明实施例一种叶片交叉条件下玉米中心点定位系统的整体框架示意图;12 is a schematic diagram of the overall framework of a corn center point positioning system under the condition of crossing leaves according to an embodiment of the present invention;
图13为根据本发明实施例一种叶片交叉条件下玉米中心点定位方法的设备的结构框架示意图。Fig. 13 is a schematic structural frame diagram of a device for a method for locating the center point of corn under the condition of crossing leaves according to an embodiment of the present invention.
具体实施方式detailed description
下面结合附图和实施例,对本发明的具体实施方式作进一步详细描述。以下实施例用于说明本发明,但不用来限制本发明的范围。The specific implementation manners of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
如图1,本发明一个具体实施例中,示出一种叶片交叉条件下作物中心点定位方法整体流程示意图。总体上,包括:步骤1,基于目标作物的原始灰度图像,获取目标作物的灰度图像和二值图像;步骤2,基于所述目标作物的灰度图像和二值图像,获得目标作物的中心点坐标。As shown in FIG. 1 , in a specific embodiment of the present invention, it shows a schematic diagram of the overall flow of a method for locating the center point of a crop under the condition of leaves crossing. Generally, it includes: Step 1, based on the original grayscale image of the target crop, obtain the grayscale image and binary image of the target crop; Step 2, based on the grayscale image and binary image of the target crop, obtain the Center point coordinates.
在本发明另一个具体实施例中,一种叶片交叉条件下作物中心点定位方法,所述步骤1进一步包括:S11,基于目标作物的原始灰度图像,获得所述目标作物原始灰度图像的二值图像;S12,对所述目标作物原始灰度图像的二值图像进行形态学去噪处理,确定所述目标作物的图像兴趣区;S13,基于所述目标作物的图像兴趣区,获取所述目标作物图像兴趣区的二值图像。In another specific embodiment of the present invention, a method for locating the center point of a crop under the condition of crossing leaves, the step 1 further includes: S11, based on the original grayscale image of the target crop, obtaining the original grayscale image of the target crop Binary image; S12, perform morphological denoising processing on the binary image of the original grayscale image of the target crop, and determine the image interest area of the target crop; S13, obtain the image interest area based on the target crop image The binary image of the ROI of the target crop image.
在本发明另一个具体实施例中,一种叶片交叉条件下作物中心点定位方法,所述步骤2进一步包括:In another specific embodiment of the present invention, a method for locating the center point of a crop under the condition of crossing leaves, the step 2 further includes:
S21,将所述目标作物的原始灰度图像与所述目标作物的图像兴趣区的二值图像融合,获得目标作物的图像兴趣区的灰度图像;S21. Fusing the original grayscale image of the target crop with the binary image of the image region of interest of the target crop to obtain a grayscale image of the image region of interest of the target crop;
S22,获得所述目标作物的图像兴趣区的灰度图像的极小值点;获得所述目标作物的图像兴趣区的灰度图像中与周围像素点落差大于阈值的极小值点;S22. Obtain the minimum value point of the grayscale image of the image region of interest of the target crop; obtain the minimum value point in the grayscale image of the image region of interest of the target crop with a difference from surrounding pixel points greater than a threshold;
S23,基于所述目标作物的图像兴趣区的灰度图像和所述S22获得的极小值点,利用分水岭算法,获得目标作物的中心点坐标。S23, based on the grayscale image of the image region of interest of the target crop and the minimum point obtained in S22, using the watershed algorithm to obtain the coordinates of the center point of the target crop.
在本发明另一个具体实施例中,一种叶片交叉条件下作物中心点定位方法,所述步骤1前还包括:In another specific embodiment of the present invention, a method for locating the center point of crops under the condition of leaves crossing, the step 1 also includes:
将目标作物的初始图像进行灰度化处理,所述灰度化处理包括以下步骤,The initial image of the target crop is subjected to grayscale processing, and the grayscale processing includes the following steps,
Igray(i,j)=G(i,j)*1.262-R(i,j)*0.884-B(i,j)*0.311,I gray (i,j)=G(i,j)*1.262-R(i,j)*0.884-B(i,j)*0.311,
其中i、j为像素的行列坐标,G(i,j)、R(i,j)和B(i,j)分别为图像(i,j)处像素G、R、B颜色分量的灰度值,Igray(i,j)为转换后图像(i,j)处像素的灰度值。Where i and j are the row and column coordinates of the pixel, and G(i,j), R(i,j) and B(i,j) are the grayscales of the G, R and B color components of the pixel at image (i,j) respectively value, Igray(i,j) is the gray value of the pixel at (i,j) in the converted image.
在本发明另一个具体实施例中,一种叶片交叉条件下作物中心点定位方法,所述S12进一步包括:In another specific embodiment of the present invention, a method for locating the center point of a crop under the condition of crossing leaves, the S12 further includes:
利用形态学开操作去除对所述目标作物原始灰度图像的二值图像中杂草噪声的干扰;Using the morphological opening operation to remove the interference of weed noise in the binary image of the original grayscale image of the target crop;
对去噪后所述目标作物原始灰度图像的二值图像的像素值进行水平投影,获得以像素行坐标为横坐标的投影曲线;以中间像素行为分界,将投影曲线分成两部分,寻找每条曲线最小值位置对应的像素行坐标,两个像素行之间区域为所述目标作物的图像兴趣区。Horizontally project the pixel values of the binary image of the original grayscale image of the target crop after denoising to obtain a projection curve with the pixel row coordinates as the abscissa; divide the projection curve into two parts with the intermediate pixel behavior, and find each The coordinates of the pixel row corresponding to the position of the minimum value of the curve, and the area between two pixel rows is the image interest area of the target crop.
在本发明另一个具体实施例中,一种叶片交叉条件下作物中心点定位方法,所述S22进一步包括:In another specific embodiment of the present invention, a method for locating the center point of a crop under the condition of crossing leaves, the S22 further includes:
计算所述目标作物的图像兴趣区的灰度图像中八邻域内的极小值点和极大值点,并分别计算极小值点和极大值点的平均值,二者的差值,作为阈值,保留与周围像素点落差大于阈值的极小值点,获得最终的局部极小值。Calculate the minimum value point and the maximum value point in the eight neighbors in the grayscale image of the image interest area of the target crop, and calculate the average value of the minimum value point and the maximum value point, the difference between the two, As a threshold, keep the minimum value points whose drop from the surrounding pixels is greater than the threshold value, and obtain the final local minimum value.
在本发明另一个具体实施例中,一种叶片交叉条件下作物中心点定位方法,所述S23进一步包括:In another specific embodiment of the present invention, a method for locating the center point of a crop under the condition of crossing leaves, said S23 further includes:
利用所述S22获得的极小值点对所述目标作物的图像兴趣区的灰度图像进行前景标记;利用分水岭算法对标记后的灰度图像为输入图像,获得目标作物的中心区域;Using the minimum value point obtained in S22 to carry out foreground marking on the grayscale image of the image interest area of the target crop; using the watershed algorithm to use the marked grayscale image as an input image to obtain the central area of the target crop;
基于目标作物的中心区域,分别对中心区域内像素点的x坐标、y坐标相加求和,并统计中心区域内像素点的个数,x坐标和、y坐标和与像素点个数的比值即为最终的作物中心点坐标。Based on the central area of the target crop, add and sum the x-coordinates and y-coordinates of the pixels in the central area, and count the number of pixels in the central area, the ratio of the x-coordinate sum, y-coordinate sum to the number of pixel points That is, the coordinates of the final crop center point.
如图2,本发明实施例一种叶片交叉条件下作物中心点定位方法的流程示意图。本具体实施例提供一种叶片交叉情况下的作物中心点定位方法。该方法充分考虑杂草、叶片交叉等因素对作物中心点定位的影响,提高了作物中心点定位的速度和准确度。所述方法具体包括以下步骤。FIG. 2 is a schematic flowchart of a method for locating the center point of a crop under the condition of crossing leaves according to an embodiment of the present invention. This specific embodiment provides a method for locating the center point of a crop in the case of leaves crossing. The method fully considers the influence of factors such as weeds and crossing leaves on the location of the crop center point, and improves the speed and accuracy of the location of the crop center point. The method specifically includes the following steps.
调整安装摄像头的高度和角度,使摄像头垂直拍摄作物行,确保采集的图像中作物行近似平行于水平方向,且待测作物位于图像的中间位置,其所在作物行称为特定作物行。Adjust the height and angle of the installed camera so that the camera shoots the crop row vertically to ensure that the crop row in the collected image is approximately parallel to the horizontal direction, and the crop to be tested is located in the middle of the image, and the crop row where it is located is called a specific crop row.
对图像按如下方法在进行转换:The image is converted as follows:
Igray(i,j)=G(i,j)*1.262-R(i,j)*0.884-B(i,j)*0.311,I gray (i,j)=G(i,j)*1.262-R(i,j)*0.884-B(i,j)*0.311,
其中i、j为像素的行列坐标,G(i,j)、R(i,j)和B(i,j)分别为图像(i,j)处像素G、R、B颜色分量的灰度值,Igray(i,j)为转换后图像(i,j)处像素的灰度值。Where i and j are the row and column coordinates of the pixel, and G(i,j), R(i,j) and B(i,j) are the grayscales of the G, R and B color components of the pixel at image (i,j) respectively value, Igray(i,j) is the gray value of the pixel at (i,j) in the transformed image.
所述的二值图像,白色像素点(灰度值为1)为作物,黑色像素点(灰度值为0)为背景。用正方形结构元素对二值图像进行形态学开运算,去除二值图像中面积微小的白色区域噪声。In the binary image, white pixels (with a gray value of 1) are crops, and black pixels (with a gray value of 0) are backgrounds. The binary image is morphologically opened with square structural elements to remove the tiny white area noise in the binary image.
根据去噪处理获得的二值图像按照如下方法确定兴趣区:对二值图像的像素灰度值进行水平投影,获得以像素行坐标为横坐标的投影曲线,以中间像素行Midrow为分界将投影曲线分成两部分,每条曲线各有一个最小值min1、min2,各个最小值可能对应一个或多个像素行坐标,记录距离中间像素行Midrow最近的像素行坐标为Rowmin1、Rowmin2,确定Rowmin1和Rowmin2之间的区域为兴趣区。According to the binary image obtained by the denoising process, the region of interest is determined according to the following method: horizontally project the pixel gray value of the binary image, obtain the projection curve with the pixel row coordinate as the abscissa, and use the middle pixel row Midrow as the boundary to project The curve is divided into two parts, each curve has a minimum value min1, min2, each minimum value may correspond to one or more pixel row coordinates, record the pixel row coordinates closest to the middle pixel row Midrow as Rowmin1, Rowmin2, determine Rowmin1 and Rowmin2 The area in between is the region of interest.
计算二值图像兴趣区内各连通区域的面积,保留面积最大的区域,获得包含待测作物的二值图像。Calculate the area of each connected region in the region of interest of the binary image, retain the region with the largest area, and obtain a binary image containing the crop to be tested.
将包含待测作物的二值图像和灰度图像按照如下方法进行融合,提取新的灰度图像Inew:检测包含待测作物二值图像的白色像素点坐标(i,j),白色像素点处的灰度值为灰度图像中对应的灰度值Igray(i,j),黑色像素点处的灰度值设置为0。The binary image containing the crop to be tested and the grayscale image are fused according to the following method to extract a new grayscale image Inew: Detect the coordinates (i, j) of the white pixel point containing the binary image of the crop to be tested, and the white pixel point The gray value of is the corresponding gray value Igray(i,j) in the gray image, and the gray value at the black pixel is set to 0.
作物中心区域为新生叶片,在灰度图像Inew中,该区域的灰度值要高于周围成熟叶片,像素灰度值的落差较大,可通过检测灰度图像中像素八邻域内灰度的极小值来确定作物的中心区域。但是灰度图像中通常存在大量的局部极小值点,容易造成误检测。应用如下公式对其进行扩展极小运算,对图像中与邻域像素灰度值落差小于阈值h的极小值点进行消隐处理,获得局部极小值:The center area of the crop is the new leaf. In the grayscale image Inew, the grayscale value of this area is higher than that of the surrounding mature leaves, and the pixel grayscale value has a large drop. By detecting the grayscale value in the eight neighborhoods of the pixel in the grayscale image Minimum value to determine the central area of the crop. However, there are usually a large number of local minimum points in the grayscale image, which is easy to cause false detection. Apply the following formula to perform the extended minimum operation on it, and perform blanking processing on the minimum point in the image whose gray value difference with the neighboring pixels is smaller than the threshold h, and obtain the local minimum value:
BW1=EM(Inew,h),BW1=EM(Inew,h),
其中,BW1表示扩展极小运算获得的灰度图像,其对图像的极小值进行了标记;EM表示扩展极小运算;h表示落差阈值。落差阈值通过计算图像极大值点平均值和极小值点平均值的差值获得。Among them, BW1 represents the grayscale image obtained by the extended minimum operation, which marks the minimum value of the image; EM represents the extended minimum operation; h represents the drop threshold. The drop threshold is obtained by calculating the difference between the average value of the maximum point and the average value of the minimum point in the image.
应用如下公式对图像进行形态学强制最小运算,以标记图像极小值,消除指定区域外的所有其他极小值:Apply the following formula to perform a morphologically enforced minimum operation on the image to mark the image minimum and eliminate all other minimum values outside the specified area:
BW2=Imposemin(Inew,BW1),BW2 = Imposemin(Inew, BW1),
其中,BW2表示标记后的灰度图像,Imposemin表示形态学强制最小运算。Among them, BW2 represents the grayscale image after marking, and Imposemin represents the minimum operation of morphological enforcement.
以标记的图像BW2为输入图像,采用分水岭算法对图像进行分割获得作物的中心区域。Taking the marked image BW2 as the input image, the watershed algorithm is used to segment the image to obtain the central area of the crop.
按照如下方法计算作物中心区域的质心坐标,定位作物中心点。首先对得到的作物中心区域进行提取,得到中心区域的二值图像,白色像素点(灰度值为1)为中心区域,黑色像素点(灰度值为0)为背景。对中心区域二值图像的白色像素点进行扫描统计,获得中心区域像素点的个数N,并将所有白色像素点的像素行坐标x相加求和得到X,像素列坐标y相加求和得到Y,根据下列公式计算得到作物中心区域的质心坐标(Xcenter,Ycenter),Calculate the center of mass coordinates of the crop center area according to the following method, and locate the crop center point. Firstly, the center area of the obtained crop is extracted to obtain the binary image of the center area, the white pixels (gray value 1) are the center area, and the black pixels (gray value 0) are the background. Scan and count the white pixels of the binary image in the central area to obtain the number N of pixels in the central area, and add and sum the pixel row coordinates x of all white pixels to obtain X, and add and sum the pixel column coordinates y To get Y, calculate the center of mass coordinates (Xcenter, Ycenter) of the crop center area according to the following formula,
其中,ceil表示取整操作,则在原图像中作物的中心点坐标为(Xcenter+Rowmin1,Ycenter)。Among them, ceil represents the rounding operation, and the coordinates of the center point of the crop in the original image are (Xcenter+Rowmin1, Ycenter).
本发明又一具体实施例,提供一种叶片交叉条件下作物中心点定位方法。以玉米图像为例,在自然条件下,实现对玉米中心点的快速定位。Yet another specific embodiment of the present invention provides a method for locating the center point of a crop under the condition of leaves crossing. Taking the corn image as an example, under natural conditions, the rapid positioning of the center point of the corn is realized.
本实施例原始采集到的图像中中间一行作物近似为水平方向,该行作物为特定作物行,待测玉米位于特定作物行中部。In the image originally collected in this embodiment, the middle row of crops is approximately horizontal, and this row of crops is a specific crop row, and the corn to be tested is located in the middle of the specific crop row.
图3为本发明实施例的目标玉米的原始灰度图像示意图。对采集的图像进行灰度转换,应用最大类间方差法计算灰度阈值为138,将灰度图像转换为二值图像,如图4所示,白色像素点(灰度值为1)为植物(玉米或杂草),黑色像素点(灰度值为0)为背景。Fig. 3 is a schematic diagram of the original grayscale image of the target corn according to the embodiment of the present invention. The collected image is converted to grayscale, and the maximum between-class variance method is used to calculate the grayscale threshold value of 138, and the grayscale image is converted into a binary image. As shown in Figure 4, the white pixels (with a grayscale value of 1) are plants (corn or weed), black pixels (gray value 0) are the background.
图5为本发明实施例一种叶片交叉条件下玉米中心点定位方法中所述目标玉米原始灰度图像的二值图像水平投影示意图。图6为根据本发明实施例一种叶片交叉条件下玉米中心点定位方法中所述目标玉米图像兴趣区示意图。首先,本实施例中选择像素大小为4像素的正方形结构元素对所述二值图像进行开运算,消除二值图像面积微小的白色区域;然后,对去噪后的二值图像进行水平投影,获得投影曲线;以中间像素行Midrow为分界将投影曲线分为两部分,本实施例中Midrow=360;确定每条曲线的最小值min1、min2及其对应的像素行坐标,选取距离中间像素行Midrow最近的像素行坐标为Rowmin1、Rowmin2,本实施例中min1=0,min2=0,对应的像素行坐标为Rowmin1=299,Rowmin2=631,则Rowmin1和Rowmin2之间的区域确定为图像的兴趣区。5 is a schematic diagram of the horizontal projection of the binary image of the original grayscale image of the target corn in a method for locating the center point of the corn under the condition of crossing leaves according to an embodiment of the present invention. 6 is a schematic diagram of the ROI of the target corn image in a method for locating the center point of corn under the condition of crossing leaves according to an embodiment of the present invention. First, in this embodiment, a square structural element with a pixel size of 4 pixels is selected to perform an opening operation on the binary image to eliminate the small white area of the binary image; then, the denoised binary image is horizontally projected, Obtain the projection curve; divide the projection curve into two parts with the middle pixel line Midrow as the boundary, Midrow=360 in the present embodiment; determine the minimum value min1, min2 and the corresponding pixel row coordinates of each curve, select the distance from the middle pixel row The nearest pixel row coordinates of Midrow are Rowmin1 and Rowmin2. In this embodiment, min1=0, min2=0, the corresponding pixel row coordinates are Rowmin1=299, Rowmin2=631, then the area between Rowmin1 and Rowmin2 is determined to be the interest of the image Area.
图7为根据本发明实施例一种叶片交叉条件下玉米中心点定位方法中所述目标玉米的原始灰度图像示意图。图8为根据本发明实施例一种叶片交叉条件下玉米中心点定位方法中所述目标玉米的二值图像示意图。统计兴趣区内各区域的面积,待测玉米位于兴趣区内,由于和其他叶片出现交叉,所以其所在区域面积最大。保留面积最大的区域,去除零散叶片的干扰。本实施例中待测玉米所在区域面积为23048。检测包含待测玉米二值图像的白色像素点,其坐标为(i,j),该白色像素点在新的灰度图像Inew中的灰度值为图3灰色图像(i,j)处的值。待测玉米区域的黑色像素点在新的灰度图像Inew中的灰度值为0。Fig. 7 is a schematic diagram of the original grayscale image of the target corn in a method for locating the center point of the corn under the condition of crossing leaves according to an embodiment of the present invention. Fig. 8 is a schematic diagram of a binary image of the target corn in a method for locating the center point of corn under the condition of crossing leaves according to an embodiment of the present invention. The area of each area in the area of interest is counted. The corn to be tested is located in the area of interest. Since it intersects with other leaves, its area is the largest. Keep the area with the largest area and remove the interference of scattered leaves. In this embodiment, the area where the corn to be tested is located is 23048 square meters. Detect the white pixel point containing the binary image of the corn to be tested, its coordinates are (i, j), and the gray value of the white pixel point in the new gray image Inew is that of the gray image (i, j) in Figure 3 value. The gray value of the black pixels in the corn area to be tested in the new gray image Inew is 0.
图9为根据本发明实施例一种叶片交叉条件下玉米中心点定位方法中所述目标玉米的原始灰度图像的极小值区域示意图;为对实施例的灰度图像Inew进行扩展极小运算获得的BW1,BW1的玉米中心点附近的灰度值要高于周边像素点。本实施例中极小值点的平均值为147.09,极大值点的平均值为150.47,设置落差阈值h为3.38,消除微小区域的极小值。9 is a schematic diagram of the minimum value region of the original grayscale image of the target corn in a method for locating the center point of corn under the condition of leaf crossing according to an embodiment of the present invention; it is to perform an extended minimum operation on the grayscale image Inew of the embodiment The obtained BW1, the gray value near the corn center point of BW1 is higher than the surrounding pixels. In this embodiment, the average value of the minimum value point is 147.09, the average value of the maximum value point is 150.47, and the drop threshold h is set to 3.38 to eliminate the minimum value in the micro region.
图10为根据本发明实施例一种叶片交叉条件下玉米中心点定位方法中利用分水岭算法分割处理得到的作物中心区域示意图。应用形态学强制最小运算标记实施例的灰度图像Inew,以标记图像为输入图像,采用分水岭算法对图像进行分割处理,获得实施例的中心区域,如图10所示。Fig. 10 is a schematic diagram of a crop center area obtained by segmentation processing using a watershed algorithm in a method for locating a center point of corn under the condition of crossing leaves according to an embodiment of the present invention. The gray-scale image Inew of the embodiment is marked by the morphological forced minimum operation, and the marked image is used as the input image, and the image is segmented by using the watershed algorithm to obtain the central area of the embodiment, as shown in FIG. 10 .
图11为根据本发明实施例一种叶片交叉条件下玉米中心点定位方法中利用分水岭算法分割处理得到的玉米中心点坐标示意图。11 is a schematic diagram of the coordinates of the corn center point obtained by using the watershed algorithm in a method for locating the center point of corn under the cross-leaf condition according to an embodiment of the present invention.
图10获得的玉米中心区域形状并不规则,计算该区域的质心作为玉米的中心点。对中心区域的像素点进行扫描统计,按照公式(4)计算质心坐标。本实施例中,中心区域的像素点N=557,像素的x坐标之和X=89017,y坐标之和Y=152204,获得质心坐标(160,270),则玉米的中心点坐标为(459,270),结果如图11十字标所示。The shape of the corn center area obtained in Figure 10 is irregular, and the centroid of this area is calculated as the center point of the corn. Scanning statistics are performed on the pixels in the central area, and the centroid coordinates are calculated according to formula (4). In this embodiment, the pixel point N=557 in the central area, the sum of the x coordinates of the pixels X=89017, the sum of the y coordinates Y=152204, and the centroid coordinates (160,270) are obtained, then the coordinates of the center point of the corn are (459,270), The results are shown in Figure 11 with cross marks.
如图12,在本发明另一个具体实施例中,示出一种叶片交叉条件下作物中心点定位系统总体框架示意图。整体上,包括:获取模块A1,用于基于目标作物的原始灰度图像,获取目标作物的灰度图像和二值图像;定位模块A2,用于基于所述目标作物的灰度图像和二值图像,获得目标作物的中心点坐标。As shown in FIG. 12 , in another specific embodiment of the present invention, it shows a schematic diagram of the overall framework of a crop center point positioning system under the condition of leaves crossing. On the whole, it includes: acquisition module A1, used to acquire the grayscale image and binary image of the target crop based on the original grayscale image of the target crop; positioning module A2, used to obtain the grayscale image and binary image of the target crop Image, get the coordinates of the center point of the target crop.
在本发明另一个具体实施例中,一种叶片交叉条件下作物中心点定位系统,所述获取模块还用于:基于目标作物的原始灰度图像,获得所述目标作物原始灰度图像的二值图像;对所述目标作物原始灰度图像的二值图像进行形态学去噪处理,确定所述目标作物的图像兴趣区;基于所述目标作物的图像兴趣区,获取所述目标作物图像兴趣区的二值图像。In another specific embodiment of the present invention, a system for locating the center point of a crop under the condition of crossing leaves, the acquisition module is further configured to: based on the original grayscale image of the target crop, obtain a binary image of the original grayscale image of the target crop value image; perform morphological denoising processing on the binary image of the original grayscale image of the target crop to determine the image interest area of the target crop; based on the image interest area of the target crop, obtain the image interest area of the target crop Binary image of the region.
在本发明另一个具体实施例中,一种叶片交叉条件下作物中心点定位系统,所述定位模块还用于:In another specific embodiment of the present invention, a crop center point positioning system under the condition of crossing leaves, the positioning module is also used for:
S21,将所述目标作物的原始灰度图像与所述目标作物的图像兴趣区的二值图像融合,获得目标作物的图像兴趣区的灰度图像;S21. Fusing the original grayscale image of the target crop with the binary image of the image region of interest of the target crop to obtain a grayscale image of the image region of interest of the target crop;
S22,获得所述目标作物的图像兴趣区的灰度图像的极小值点;获得所述目标作物的图像兴趣区的灰度图像中与周围像素点落差大于阈值的极小值点;S22. Obtain the minimum value point of the grayscale image of the image region of interest of the target crop; obtain the minimum value point in the grayscale image of the image region of interest of the target crop with a difference from surrounding pixel points greater than a threshold;
S23,基于所述目标作物的图像兴趣区的灰度图像和所述S22获得的极小值点,利用分水岭算法,获得目标作物的中心点坐标。S23, based on the grayscale image of the image region of interest of the target crop and the minimum point obtained in S22, using the watershed algorithm to obtain the coordinates of the center point of the target crop.
在本发明另一个具体实施例中,一种叶片交叉条件下作物中心点定位系统,所述获取模块,还用于将目标作物的初始图像进行灰度化处理,所述灰度化处理包括以下步骤,In another specific embodiment of the present invention, a crop center point positioning system under leaf crossing conditions, the acquisition module is also used to grayscale the initial image of the target crop, and the grayscale processing includes the following step,
Igray(i,j)=G(i,j)*1.262-R(i,j)*0.884-B(i,j)*0.311,I gray (i,j)=G(i,j)*1.262-R(i,j)*0.884-B(i,j)*0.311,
其中i、j为像素的行列坐标,G(i,j)、R(i,j)和B(i,j)分别为图像(i,j)处像素G、R、B颜色分量的灰度值,Igray(i,j)为转换后图像(i,j)处像素的灰度值。Where i and j are the row and column coordinates of the pixel, and G(i,j), R(i,j) and B(i,j) are the grayscales of the G, R and B color components of the pixel at image (i,j) respectively value, Igray(i,j) is the gray value of the pixel at (i,j) in the transformed image.
在本发明另一个具体实施例中,一种叶片交叉条件下作物中心点定位系统,所述获取模块,还用于基于目标作物的原始灰度图像,获得所述目标作物原始灰度图像的二值图像的转换阈值利用最大类间方差法求得。In another specific embodiment of the present invention, a crop center point positioning system under leaf crossing conditions, the acquisition module is also used to obtain a binary image of the original grayscale image of the target crop based on the original grayscale image of the target crop. The conversion threshold of the value image is obtained by the method of maximum between-class variance.
在本发明另一个具体实施例中,一种叶片交叉条件下作物中心点定位系统,所述获取模块,还用于:In another specific embodiment of the present invention, a crop center point positioning system under the condition of crossing leaves, the acquisition module is also used for:
利用形态学开操作去除对所述目标作物原始灰度图像的二值图像中杂草噪声的干扰;Using the morphological opening operation to remove the interference of weed noise in the binary image of the original grayscale image of the target crop;
对去噪后所述目标作物原始灰度图像的二值图像的像素值进行水平投影,获得以像素行坐标为横坐标的投影曲线;以中间像素行为分界,将投影曲线分成两部分,寻找每条曲线最小值位置对应的像素行坐标,两个像素行之间区域为所述目标作物的图像兴趣区。Horizontally project the pixel values of the binary image of the original grayscale image of the target crop after denoising to obtain a projection curve with the pixel row coordinates as the abscissa; divide the projection curve into two parts with the intermediate pixel behavior, and find each The coordinates of the pixel row corresponding to the position of the minimum value of the curve, and the area between two pixel rows is the image interest area of the target crop.
在本发明另一个具体实施例中,一种叶片交叉条件下作物中心点定位系统,所述定位模块,还用于:In another specific embodiment of the present invention, a crop center point positioning system under the condition of crossing leaves, the positioning module is also used for:
计算所述目标作物的图像兴趣区的灰度图像中八邻域内的极小值点和极大值点,并分别计算极小值点和极大值点的平均值,二者的差值,作为阈值,保留与周围像素点落差大于阈值的极小值点,获得最终的局部极小值。Calculate the minimum value point and the maximum value point in the eight neighbors in the grayscale image of the image interest area of the target crop, and calculate the average value of the minimum value point and the maximum value point, the difference between the two, As a threshold, keep the minimum value points whose drop from the surrounding pixels is greater than the threshold value, and obtain the final local minimum value.
在本发明另一个具体实施例中,一种叶片交叉条件下作物中心点定位系统,所述定位模块,还用于:In another specific embodiment of the present invention, a crop center point positioning system under the condition of crossing leaves, the positioning module is also used for:
利用所述S22获得的极小值点对所述目标作物的图像兴趣区的灰度图像进行前景标记;利用分水岭算法对标记后的灰度图像为输入图像,获得目标作物的中心区域;Using the minimum value point obtained in S22 to carry out foreground marking on the grayscale image of the image interest area of the target crop; using the watershed algorithm to use the marked grayscale image as an input image to obtain the central area of the target crop;
基于目标作物的中心区域,分别对中心区域内像素点的x坐标、y坐标相加求和,并统计中心区域内像素点的个数,x坐标和、y坐标和与像素点个数的比值即为最终的作物中心点坐标。Based on the central area of the target crop, add and sum the x-coordinates and y-coordinates of the pixels in the central area, and count the number of pixels in the central area, the ratio of the x-coordinate sum, y-coordinate sum to the number of pixel points That is, the coordinates of the final crop center point.
图13示出本申请实施例的叶片交叉条件下作物中心点定位方法的设备的结构框图。Fig. 13 shows a structural block diagram of equipment for a method for locating a crop center point under the condition of crossing leaves according to an embodiment of the present application.
参照图13,所述叶片交叉条件下作物中心点定位方法的设备,包括:处理器(processor)1301、存储器(memory)1302和总线1303;Referring to Fig. 13, the equipment of the crop center point positioning method under the leaf crossing condition includes: a processor (processor) 1301, a memory (memory) 1302 and a bus 1303;
其中,in,
所述处理器1301和存储器1302通过所述总线1303完成相互间的通信;The processor 1301 and the memory 1302 communicate with each other through the bus 1303;
所述处理器1301用于调用所述存储器1302中的程序指令,以执行上述各方法实施例所提供的方法,例如包括:步骤1,基于目标作物的原始灰度图像,获取目标作物的灰度图像和二值图像;步骤2,基于所述目标作物的灰度图像和二值图像,获得目标作物的中心点坐标。The processor 1301 is used to call the program instructions in the memory 1302 to execute the methods provided by the above method embodiments, for example, including: step 1, based on the original grayscale image of the target crop, acquiring the grayscale of the target crop Image and binary image; step 2, based on the grayscale image and binary image of the target crop, obtain the coordinates of the center point of the target crop.
本实施例公开一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法实施例所提供的方法,例如包括:步骤1,基于目标作物的原始灰度图像,获取目标作物的灰度图像和二值图像;步骤2,基于所述目标作物的灰度图像和二值图像,获得目标作物的中心点坐标。This embodiment discloses a computer program product, the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by the computer, the computer The methods provided by the above method embodiments can be executed, for example, including: step 1, based on the original grayscale image of the target crop, acquiring the grayscale image and binary image of the target crop; step 2, based on the grayscale image of the target crop Image and binary image to obtain the coordinates of the center point of the target crop.
本实施例提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行上述各方法实施例所提供的方法,例如包括:步骤1,基于目标作物的原始灰度图像,获取目标作物的灰度图像和二值图像;步骤2,基于所述目标作物的灰度图像和二值图像,获得目标作物的中心点坐标。This embodiment provides a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the methods provided in the above method embodiments, for example, including : Step 1, based on the original gray image of the target crop, obtain the gray image and binary image of the target crop; Step 2, based on the gray image and binary image of the target crop, obtain the coordinates of the center point of the target crop.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for realizing the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the It includes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.
以上所描述的叶片交叉条件下作物中心点定位方法的设备等实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The above-described embodiments of the equipment and other embodiments of the crop center point positioning method under the condition of leaf crossing are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may be It may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative efforts.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the implementations, those skilled in the art can clearly understand that each implementation can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.
最后,本申请的方法仅为较佳的实施方案,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。Finally, the method of the present application is only a preferred embodiment, and is not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710415434.1A CN107220647B (en) | 2017-06-05 | 2017-06-05 | Crop center point positioning method and system under blade crossing condition |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710415434.1A CN107220647B (en) | 2017-06-05 | 2017-06-05 | Crop center point positioning method and system under blade crossing condition |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107220647A true CN107220647A (en) | 2017-09-29 |
CN107220647B CN107220647B (en) | 2020-03-31 |
Family
ID=59947183
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710415434.1A Active CN107220647B (en) | 2017-06-05 | 2017-06-05 | Crop center point positioning method and system under blade crossing condition |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107220647B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111627059A (en) * | 2020-05-28 | 2020-09-04 | 桂林市思奇通信设备有限公司 | Method for positioning center point position of cotton blade |
CN111738159A (en) * | 2020-06-23 | 2020-10-02 | 桂林市思奇通信设备有限公司 | A method for locating cotton terminal buds based on vector calibration |
CN111753688A (en) * | 2020-06-12 | 2020-10-09 | 广州极飞科技有限公司 | Planting line center line determining method and device, electronic equipment and storage medium |
CN112541383A (en) * | 2020-06-12 | 2021-03-23 | 广州极飞科技有限公司 | Method and device for identifying weed area |
CN113298768A (en) * | 2021-05-20 | 2021-08-24 | 山东大学 | Cotton detection, segmentation and counting method and system |
CN113421301A (en) * | 2021-07-08 | 2021-09-21 | 浙江大学 | Method and system for positioning central area of field crop |
CN113469112A (en) * | 2021-07-19 | 2021-10-01 | 三门峡市扶贫开发办公室 | Crop growth condition image identification method and system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103488991A (en) * | 2013-09-30 | 2014-01-01 | 中国农业大学 | Method for extracting leading line of farmland weeding machine |
CN104392460A (en) * | 2014-12-12 | 2015-03-04 | 山东大学 | Adherent white blood cell segmentation method based on nucleus-marked watershed transformation |
CN104484877A (en) * | 2014-12-12 | 2015-04-01 | 山东大学 | AML cell segmentation method based on Meanshift cluster and morphological operations |
-
2017
- 2017-06-05 CN CN201710415434.1A patent/CN107220647B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103488991A (en) * | 2013-09-30 | 2014-01-01 | 中国农业大学 | Method for extracting leading line of farmland weeding machine |
CN104392460A (en) * | 2014-12-12 | 2015-03-04 | 山东大学 | Adherent white blood cell segmentation method based on nucleus-marked watershed transformation |
CN104484877A (en) * | 2014-12-12 | 2015-04-01 | 山东大学 | AML cell segmentation method based on Meanshift cluster and morphological operations |
Non-Patent Citations (2)
Title |
---|
张春龙: "自然环境下农业机器人作业目标信息获取与视觉伺服策略研究", 《中国博士学位论文全文数据库-信息科技辑》 * |
高静: "基于形态学分水岭算法的细胞图像分割", 《中国优秀硕士学位论文全文数据库-信息科技辑》 * |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111627059A (en) * | 2020-05-28 | 2020-09-04 | 桂林市思奇通信设备有限公司 | Method for positioning center point position of cotton blade |
CN111627059B (en) * | 2020-05-28 | 2023-05-30 | 桂林市思奇通信设备有限公司 | Cotton leaf center point positioning method |
CN111753688A (en) * | 2020-06-12 | 2020-10-09 | 广州极飞科技有限公司 | Planting line center line determining method and device, electronic equipment and storage medium |
CN112541383A (en) * | 2020-06-12 | 2021-03-23 | 广州极飞科技有限公司 | Method and device for identifying weed area |
CN112541383B (en) * | 2020-06-12 | 2021-12-28 | 广州极飞科技股份有限公司 | Method and device for identifying weed area |
CN111753688B (en) * | 2020-06-12 | 2022-03-18 | 广州极飞科技股份有限公司 | Planting line center line determining method and device, electronic equipment and storage medium |
CN111738159A (en) * | 2020-06-23 | 2020-10-02 | 桂林市思奇通信设备有限公司 | A method for locating cotton terminal buds based on vector calibration |
CN113298768A (en) * | 2021-05-20 | 2021-08-24 | 山东大学 | Cotton detection, segmentation and counting method and system |
CN113298768B (en) * | 2021-05-20 | 2022-11-08 | 山东大学 | Cotton detection, segmentation and counting method and system |
CN113421301A (en) * | 2021-07-08 | 2021-09-21 | 浙江大学 | Method and system for positioning central area of field crop |
CN113469112A (en) * | 2021-07-19 | 2021-10-01 | 三门峡市扶贫开发办公室 | Crop growth condition image identification method and system |
CN113469112B (en) * | 2021-07-19 | 2022-06-21 | 三门峡市乡村振兴局 | Crop growth condition image identification method and system |
Also Published As
Publication number | Publication date |
---|---|
CN107220647B (en) | 2020-03-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107220647B (en) | Crop center point positioning method and system under blade crossing condition | |
CN109961049B (en) | Cigarette brand identification method under complex scene | |
CN107633516B (en) | Method and device for identifying road surface deformation diseases | |
CN109636732B (en) | Hole repairing method of depth image and image processing device | |
JP6259928B2 (en) | Lane data processing method, apparatus, storage medium and equipment | |
CN113109368B (en) | Glass crack detection method, device, equipment and medium | |
CN108986152B (en) | A foreign object detection method and device based on differential image | |
CN102663760B (en) | Location and segmentation method for windshield area of vehicle in images | |
EP3563345B1 (en) | Automatic detection, counting, and measurement of lumber boards using a handheld device | |
CN113449606B (en) | Target object identification method and device, computer equipment and storage medium | |
CN104200193A (en) | Fruit tree yield estimation method and device | |
CN105303153A (en) | Vehicle license plate identification method and apparatus | |
CN112652015A (en) | BIM-based pavement disease marking method and device | |
US11216905B2 (en) | Automatic detection, counting, and measurement of lumber boards using a handheld device | |
EP2813973A1 (en) | Method and system for processing video image | |
CN118506115B (en) | Multi-focal-length embryo image prokaryotic detection method and system based on optimal arc fusion | |
CN113313692B (en) | Automatic banana young plant identification and counting method based on aerial visible light image | |
CN112801111B (en) | Image straight line edge point classification method and device based on gradient direction | |
CN108961262B (en) | Bar code positioning method in complex scene | |
CN117372498A (en) | Multi-pose bolt size measurement method based on three-dimensional point cloud | |
CN114724119A (en) | Lane line extraction method, lane line detection apparatus, and storage medium | |
CN111079752A (en) | Method and device for identifying circuit breaker in infrared image and readable storage medium | |
CN111738310B (en) | Material classification method, device, electronic equipment and storage medium | |
Peng et al. | Weed recognition using image blur information | |
CN110276260B (en) | A product detection method based on depth camera |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |