CN113469276A - Fruit tree detection method and device - Google Patents

Fruit tree detection method and device Download PDF

Info

Publication number
CN113469276A
CN113469276A CN202110826512.3A CN202110826512A CN113469276A CN 113469276 A CN113469276 A CN 113469276A CN 202110826512 A CN202110826512 A CN 202110826512A CN 113469276 A CN113469276 A CN 113469276A
Authority
CN
China
Prior art keywords
clustering
center
centers
cluster
data
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.)
Pending
Application number
CN202110826512.3A
Other languages
Chinese (zh)
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.)
Suzhou University
Original Assignee
Suzhou 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 Suzhou University filed Critical Suzhou University
Priority to CN202110826512.3A priority Critical patent/CN113469276A/en
Publication of CN113469276A publication Critical patent/CN113469276A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering

Abstract

The application relates to a fruit tree detection method and a device, which belong to the technical field of computers, and the method comprises the following steps: acquiring environmental point cloud data in a orchard area; clustering the environmental point cloud data through LAPO to obtain an optimal clustering center set; comparing Euclidean distances between different clustering centers in the optimal clustering center set with the diameters of the fruit trees to update the clustering centers according to comparison results to obtain updated clustering centers; performing data clustering according to the DBSCAN and the updated clustering center to obtain a plurality of data clusters; comparing the Euclidean distance between the clustering centers of different data clusters with the diameter of the fruit tree, and updating the clustering centers of the data clusters according to the comparison result to obtain the final clustering center; dividing the fruit tree cluster and other target clusters according to the final cluster center to obtain a fruit tree detection result; the detection of the fruit trees can be realized without knowing the information such as the number of the fruit trees, the planting spacing and the like in advance.

Description

Fruit tree detection method and device
[ technical field ] A method for producing a semiconductor device
The application relates to a fruit tree detection method and device, and belongs to the technical field of computers.
[ background of the invention ]
With the development of smart devices, self-moving devices are supported for automatic movement in orchards. Such as: automatic mowers and the like. When the self-moving equipment moves in the orchard, the work strategies adopted when the fruit trees and other targets (such as people or other obstacles) meet may be different, and at the moment, the fruit trees need to be detected.
Therefore, when the self-moving equipment moves in an orchard, how to detect the fruit trees to distinguish the fruit trees from other targets is an urgent problem to be solved.
[ summary of the invention ]
The application provides a fruit tree detection method and device, which can solve the problem that fruit tree detection cannot be realized. The application provides the following technical scheme:
in a first aspect, a fruit tree detection method is provided, and the method includes:
acquiring environmental point cloud data in a orchard area acquired by mobile equipment;
clustering the environmental point cloud data through a lightning connection process optimization algorithm LAPO to obtain an optimal clustering center set, wherein the optimal clustering center set comprises a plurality of clustering centers;
comparing Euclidean distances between different clustering centers in the optimal clustering center set with the diameters of the fruit trees, and updating the clustering centers according to a comparison result to obtain updated clustering centers;
performing data clustering according to a density-based clustering algorithm DBSCAN and the updated clustering center to obtain a plurality of data clusters; the clustering center of the data cluster is the mean value of the data cluster;
comparing Euclidean distances between clustering centers of different data clusters with the diameters of fruit trees, and updating the clustering centers of the data clusters according to a comparison result to obtain a final clustering center;
and dividing the fruit tree cluster and other target clusters according to the final cluster center to obtain a fruit tree detection result.
Optionally, the comparing the euclidean distance between different clustering centers in the optimal clustering center set with the fruit tree diameter to update the multiple clustering centers according to the comparison result, so as to obtain updated clustering centers, includes:
and when the Euclidean distance between the different clustering centers is smaller than the diameter of the fruit tree, replacing the different clustering centers with the middle points between the different clustering centers to obtain the updated clustering centers.
Optionally, the method further comprises:
when the Euclidean distance between the different clustering centers is larger than or the diameter of the fruit tree, the clustering centers are kept unchanged, and the density-based clustering algorithm DBSCAN and the updated clustering centers are triggered to be executed for data clustering to obtain a plurality of data clusters; and the clustering center of the data cluster is the mean value of the data cluster.
Optionally, the environmental point cloud data is acquired from a laser radar sensor on the mobile device, and the fruit tree diameter is the fruit tree diameter corresponding to the installation height of the laser radar sensor.
Optionally, the clustering the environmental point cloud data through LAPO to obtain an optimal clustering center set includes:
randomly generating n groups of clustering centers from the environmental point cloud data; each cluster center group comprises k cluster centers; k is a positive integer, and n is an integer greater than 1;
calculating the mean value of the n groups of clustering centers;
inputting the average value into a preset objective function to obtain an objective function value of an average value point;
determining an optimal value point and a worst value point from each clustering center according to the objective function value of each clustering center;
replacing the worst value point with an average value point when the objective function value of the worst value point is greater than the objective function value of the average value point;
for each clustering center in the ith clustering center group in the n clustering center groups, randomly selecting a jth clustering center group from the n clustering center groups, wherein i is not equal to j, and both i and j are positive integers less than or equal to n;
when the objective function value of the mean value point is larger than the objective function value of the cluster center in the jth cluster center group, replacing the cluster center in the ith cluster center group according to the following formula:
Ci=Ci+rand×(Cave-rand×(Cj));
Cirepresents the cluster centers in the ith cluster center group, and rand represents [0, 1 ]]A random number in between, and a random number,
Caverepresents the mean value, the CjRepresenting the cluster centers in the jth cluster center group;
when the objective function value of the mean value point is smaller than the objective function value of the cluster center in the jth cluster center group, replacing the cluster center in the ith cluster center group according to the following formula:
Ci=Ci-rand×(Cave-rand×(Cj));
after the n groups of clustering center groups are updated to obtain the updated n groups of clustering center groups, calculating the optimal value point, the worst value point and the mean value point of the updated n groups of clustering center groups;
and (3) performing cluster center updating operation on each cluster center in the updated n groups of cluster center groups according to the following formula to obtain new n groups of cluster center groups:
Cnew=Cnew+rand×S×(Cnew_ave+rand×(Cnew_low-Ct_best))
Figure BDA0003173798510000031
where t denotes the current number of iterations, tmaxRepresenting a preset maximum number of iterations, Cnew_aveRepresenting mean points, C, in the updated n sets of cluster centersnew_lowRepresenting the worst point, C, in the updated n cluster-center groupst_bestRepresenting an optimal value point in the current iteration;
and after the new n groups of clustering center groups are obtained, the step of replacing the worst value point with the average value point when the objective function value of the worst value point is larger than the objective function value of the average value point is executed again until the optimal clustering center set is obtained when the cycle termination condition is reached.
Optionally, the performing data clustering according to the density-based clustering algorithm DBSCAN and the updated clustering center to obtain a plurality of data clusters includes:
calculating the distance from each point in the environmental point cloud data to the updated clustering center by the following formula;
Figure BDA0003173798510000032
wherein x isiRepresenting the ith point in the ambient point cloud data, cn_bestRepresenting an nth one of the updated cluster centers;
dividing each data point to a corresponding updated clustering center according to a confidence function to obtain a divided data set; the confidence function is represented by:
Figure BDA0003173798510000041
wherein, argminjdis(xi,cj) Denotes the variable value that minimizes the dis function, in this case, xiBelong to cj
Screening the clustering centers in the divided data set according to a preset neighborhood radius Eps condition and a neighborhood density threshold MinPts condition so as to discard the clustering centers which do not meet the Eps condition and the MinPts condition;
and clustering again by using the DBSCAN based on the screened clustering center to obtain the plurality of data clusters.
Optionally, the comparing the euclidean distance between the clustering centers of different data clusters with the fruit tree diameter to update the clustering centers of the data clusters according to the comparison result, so as to obtain a final clustering center, includes:
when the Euclidean distance between the clustering centers of different data clusters is smaller than the diameter of the fruit tree, replacing the different clustering centers by using the middle points between the different clustering centers, and triggering and executing the step of carrying out data clustering according to the density-based clustering algorithm DBSCAN and the updated clustering centers to obtain a plurality of data clusters;
and when the Euclidean distance between the clustering centers of different data clusters is larger than or equal to the diameter of the fruit tree, taking the different clustering centers as final clustering centers.
Optionally, the dividing the fruit tree cluster and other target clusters according to the final cluster center to obtain a fruit tree detection result includes:
comparing the distance between each point in the environmental point cloud data and the final clustering center with the dynamic radius of the fruit tree;
comparing a neighborhood density for each point in the ambient point cloud data to a dynamic neighborhood density threshold;
and when the distance is within the dynamic radius of the fruit tree and the neighborhood density is within the dynamic neighborhood density threshold, determining the corresponding point as the point of the fruit tree to obtain the detection result of the fruit tree.
In a second aspect, a fruit tree detection device is provided, the device includes:
the data acquisition module is used for acquiring environmental point cloud data in the orchard area acquired by the mobile equipment;
the first clustering module is used for clustering the environmental point cloud data through a lightning connection process optimization algorithm LAPO to obtain an optimal clustering center set, and the optimal clustering center set comprises a plurality of clustering centers;
the first comparison module is used for comparing Euclidean distances between different clustering centers in the optimal clustering center set with the diameters of the fruit trees so as to update the clustering centers according to comparison results to obtain updated clustering centers;
the second clustering module is used for clustering data according to a density-based clustering algorithm DBSCAN and the updated clustering center to obtain a plurality of data clusters; the clustering center of the data cluster is the mean value of the data cluster;
the second comparison module is used for comparing the Euclidean distance between the clustering centers of different data clusters with the diameter of the fruit tree so as to update the clustering centers of the data clusters according to the comparison result to obtain the final clustering center;
and the fruit tree detection module is used for dividing the fruit tree clusters and other target clusters according to the final cluster center to obtain fruit tree detection results.
Optionally, the first comparing module is configured to:
and when the Euclidean distance between the different clustering centers is smaller than the diameter of the fruit tree, replacing the different clustering centers with the middle points between the different clustering centers to obtain the updated clustering centers.
The beneficial effect of this application lies in: acquiring environmental point cloud data in a orchard area acquired by mobile equipment; clustering the environmental point cloud data through LAPO to obtain an optimal clustering center set; comparing Euclidean distances between different clustering centers in the optimal clustering center set with the diameters of the fruit trees to update the clustering centers according to comparison results to obtain updated clustering centers; performing data clustering according to the DBSCAN and the updated clustering center to obtain a plurality of data clusters; comparing the Euclidean distance between the clustering centers of different data clusters with the diameter of the fruit tree, and updating the clustering centers of the data clusters according to the comparison result to obtain the final clustering center; dividing the fruit tree cluster and other target clusters according to the final cluster center to obtain a fruit tree detection result; the detection of the fruit trees can be realized without knowing the information such as the number of the fruit trees, the planting spacing and the like in advance.
In addition, the fruit tree detection method of the embodiment can obtain the actual number of fruit trees right ahead.
In addition, the fruit tree detection method optimizes the local optimal condition of the traditional LAPO algorithm and the condition that the traditional DBSCAN clustering algorithm is influenced by Eps and MinPts, can accurately identify the common environmental characteristics in orchards such as trees, other agricultural machines, people and weeds, and eliminates the environmental characteristics such as other agricultural machines, people and weeds, only leaves the point set clustering information of the fruit trees, and realizes the detection of the fruit trees.
The foregoing description is only an overview of the technical solutions of the present application, and in order to make the technical solutions of the present application more clear and clear, and to implement the technical solutions according to the content of the description, the following detailed description is made with reference to the preferred embodiments of the present application and the accompanying drawings.
[ description of the drawings ]
Fig. 1 is a flowchart of a fruit tree detection method according to an embodiment of the present application;
fig. 2 is a flowchart of a fruit tree detection method according to another embodiment of the present application;
fig. 3 is a block diagram of a fruit tree detection apparatus according to an embodiment of the present application.
[ detailed description ] embodiments
The following detailed description of embodiments of the present application will be described in conjunction with the accompanying drawings and examples. The following examples are intended to illustrate the present application but are not intended to limit the scope of the present application.
First, several terms referred to in the present application will be described.
Lightning connection process optimization algorithm (LAPO): the method has excellent optimizing performance on the problem of cluster center acquisition. LAPO algorithm by optimizing JcThereby achieving the purpose of clustering.
Density-Based Clustering of Applications with Noise (DBSCAN): unlike the partitioning and hierarchical clustering method, which defines clusters as the largest set of density-connected points, it is possible to partition areas with sufficiently high density into clusters and find clusters of arbitrary shape in a spatial database of noise.
Optionally, the present application is described by taking the execution subject of each embodiment as a self-moving device, which supports automatic movement in an orchard area, for example: the self-moving device is an intelligent mower, an intelligent cleaning device and the like, and in practical implementation, the executing main body of each embodiment may also be an electronic device which is in communication connection with the self-moving device, such as: a computer, a notebook computer, a tablet computer, etc., and the present embodiment does not limit the type of the mobile device and the type of the electronic device.
In this application, install laser radar sensor from the mobile device on, be located orchard district during operation from the mobile device, this laser radar sensor is used for gathering the regional environmental point cloud data in this orchard, for example: the mobile equipment is used for collecting the environmental point cloud data within a certain distance from the front of the traveling direction of the mobile equipment, and/or collecting the environmental point cloud data on the left side of the traveling direction, and/or collecting the environmental point cloud data on the right side of the traveling direction, and/or collecting the environmental point cloud data on the rear side of the traveling direction, and the like.
Wherein, the lidar sensor can be 2D lidar, certainly, when actual implementation, the lidar sensor also can be other types of sensor, and this application does not do the restriction to the type of lidar sensor.
In the application, in order to solve the problem of navigation in an orchard from mobile equipment, the laser radar is used for scanning the surrounding environment, and point set information (shown in a coordinate point form) of 0-180 degrees of the 2D laser radar is taken. And according to the point set information, providing a fruit tree detection method based on an improved LAPO and DBSCAN clustering algorithm. The overall process comprises the following steps: firstly, clustering a point set by utilizing an LAPO algorithm to obtain a part of point set clustering centers; clustering the point sets which cannot be clustered in the first step by using the DBSCAN; according to the condition of point clustering, the dynamic DBSCAN is used for detecting fruit trees and obstacles (people and weeds), and finally the detection of the fruit trees is realized.
The fruit tree detection method provided by the application is introduced below.
Fig. 1 is a flowchart of a fruit tree detection method according to an embodiment of the present application. The method at least comprises the following steps:
step 101, acquiring environmental point cloud data in a orchard area acquired from mobile equipment.
The self-moving equipment controls the laser radar sensor to collect environmental point cloud data according to a preset working period in the working process. The preset duty cycle is usually short in duration, and the duration value of the preset duty cycle is not limited in this embodiment.
And 102, clustering the environmental point cloud data through LAPO to obtain an optimal clustering center set, wherein the optimal clustering center set comprises a plurality of clustering centers.
Before the environment point cloud data is clustered by using the LAPO, parameter setting work is required.
The parameter setting content comprises the following steps:
1. LAPO algorithm parameter setting: n groups of initial clustering centers as an initial clustering center group, wherein each group of k clustering centers (k is set randomly); t is the number of iterations, tmaxIs the maximum number of iterations. Wherein k is a positive integer and n is an integer greater than 1.
2. DBSCAN algorithm parameter setting: local DBSCAN algorithm (for cluster detection): setting (neighborhood radius) Eps and (neighborhood density threshold) MinPts according to actual conditions; secondly, a global dynamic DBSCAN algorithm (a stage of detecting fruit trees and obstacles): setting a dynamic fruit tree radius range according to the fruit tree radius: dyn _ rad ∈ (rad)min,radmax) The circle center is a clustering center; obtaining different neighborhood density thresholds according to different laser radar parameters and distances: dyn _ Pts ∈ [ Pts _ nummin,Pts_nummax];
After the parameter setting is completed, referring to fig. 2, clustering the environmental point cloud data by LAPO to obtain an optimal clustering center set, which at least comprises the following steps:
step 21, randomly generating n groups of clustering centers from the environmental point cloud data; each cluster center group includes k cluster centers.
Specifically, an initial cluster center group (n groups of cluster centers, each group of k clusters) is randomly selected to form a matrix of n rows and k columns, that is:
Figure BDA0003173798510000081
the ith row of clustering centers are expressed by the following formula, wherein i is a positive integer less than or equal to n:
Ci=Datamin+rand×(Datamax-Datamin)
wherein rand represents [0, 1 ]]Random number between, DatamaxRepresenting maximum values in ambient point cloud Data, DataminRepresenting the minimum in the ambient point cloud data.
Step 22, calculating the mean value of n groups of clustering center groups; inputting the average value into a preset objective function to obtain an objective function value of an average value point; and according to the objective function value of each clustering center, determining an optimal value point and a worst value point from each clustering center, and replacing the worst value point with the average value point when the objective function value of the worst value point is greater than the objective function value of the average value point.
Specifically, fitness calculation is performed on the clustering center group C by using an objective function to obtain an optimal value point, a worst value point and an average value point of the clustering center group as Cbest,Clow,Cave. According to the objective function, if Flow>FaveThen C will beaveValue of to Clow. Wherein, FlowRepresenting the value of the objective function corresponding to the worst point, FaveAnd representing the objective function value corresponding to the mean point.
The objective function is represented by:
Figure BDA0003173798510000091
Figure BDA0003173798510000092
wherein v isi,jRepresenting a confidence function, argminjdis(xi,cj) Denotes the variable value that minimizes the dis function, in this case, xiBelong to cj;xiRepresenting the ith point in the ambient point cloud data, cjRepresents the jth cluster center, i and j are positive integers.
Step 23, randomly selecting a jth cluster center group from the n cluster center groups for each cluster center in the ith cluster center group in the n cluster center groups; when the objective function value of the average value point is larger than the objective function value of the cluster center in the jth cluster center group, replacing the cluster center in the ith cluster center group according to the following formula: ci=Ci+rand×(Cave-rand×(Cj));CiRepresenting cluster centers in the ith cluster center group, CaveRepresents the mean value point, CjRepresenting the cluster centers in the jth cluster center group; when the objective function value of the average value point is less than the objective function value of the cluster center in the jth cluster center group, replacing the cluster center in the ith cluster center group according to the following formula: ci=Ci+rand×(Cave-rand×(Cj))。
Wherein i is not equal to j, and i and j are positive integers less than or equal to n.
Step 24, after the n groups of clustering center groups all execute the updating operation to obtain the updated n groups of clustering center groups, calculating the optimal value point, the worst value point and the mean value point C of the updated n groups of clustering center groupsnew_best,Cnew_low,Cnew_ave
Specifically, referring to fig. 2, the self-mobile device determines whether each of the n cluster centers in the cluster center group has been updated, and if yes, performs step 25; if not, executing step 23 again;
step 25, performing cluster center updating operation on each cluster center in the updated n groups of cluster center groups according to the following formula to obtain new n groups of cluster center groups:
Cnew=Cnew+rand×S×(Cnew_ave+rand×(Cnew_low-Ct_best))
Figure BDA0003173798510000101
where t denotes the current number of iterations, tmaxRepresenting a preset maximum number of iterations, Cnew_aveRepresenting mean points, C, in the updated n sets of cluster centersnew_lowRepresenting the worst point, C, in the updated n cluster-center groupst_bestRepresenting the optimum point in the current iteration.
Specifically, referring to fig. 2, the self-mobile device determines whether each cluster center in the updated n sets of cluster centers has been updated, and if yes, performs step 26; if not, executing step 25 again;
and 26, after new n groups of clustering center groups are obtained, executing the step 22 again until a cycle termination condition is reached, and obtaining an optimal clustering center set.
Specifically, the optimal cluster center group is obtained according to the steps 22-25, and fitness calculation is carried out according to the objective function to obtain a group of optimal cluster center sets, namely { c }1_best,c2_best,...ck-1_best,ck_best}。
And 103, comparing Euclidean distances between different clustering centers in the optimal clustering center set with the diameters of the fruit trees, and updating the clustering centers according to the comparison result to obtain updated clustering centers.
Optionally, the environmental point cloud data is acquired from a laser radar sensor on the mobile device, and the diameter of the fruit tree is the diameter of the fruit tree corresponding to the installation height of the laser radar sensor.
Optionally, each installation height corresponds to a fruit tree diameter, and the fruit tree diameter may be an average value of fruit tree diameters of respective fruit trees in the entire orchard corresponding to the installation height, or may also be a value set according to an empirical value, and the fruit tree diameter is not limited in this embodiment.
Point XiAnd point XjThe calculation formula of the euclidean distance between the two is as follows:
Figure BDA0003173798510000111
referring to step 27 in fig. 2, when comparing the euclidean distance between different cluster centers in the optimal cluster center set with the fruit tree diameter to update a plurality of cluster centers according to the comparison result, and obtaining an updated cluster center, the method specifically includes: when the Euclidean distance between different clustering centers is smaller than the diameter of the fruit tree, replacing different clustering centers by using midpoints between different clustering centers to obtain updated clustering centers; when the Euclidean distance between different clustering centers is larger than or equal to the diameter of a fruit tree, the clustering centers are kept unchanged, and data clustering is triggered and executed according to a density-based clustering algorithm DBSCAN and the updated clustering centers to obtain a plurality of data clusters; and the clustering center of the data cluster is the mean value of the data cluster.
In this embodiment, when a forked fruit tree is encountered, the processing is performed according to a method of replacing two points with a midpoint.
Step 104, performing data clustering according to the DBSCAN and the updated clustering center to obtain a plurality of data clusters; the clustering center of the data cluster is the mean value of the data cluster.
Referring to steps 28 and 29 in fig. 2, performing data clustering according to the density-based clustering algorithm DBSCAN and the updated clustering center to obtain a plurality of data clusters, including: calculating the distance from each point in the environmental point cloud data to the updated clustering center through the following formula;
Figure BDA0003173798510000112
wherein x isiRepresenting the ith point in the ambient point cloud data, cn_bestRepresenting an nth one of the updated cluster centers; dividing each data point to a corresponding updated clustering center according to a confidence function to obtain a divided data set; screening the clustering centers in the divided data set according to a preset neighborhood radius Eps condition and a neighborhood density threshold MinPts condition so as to discard the clustering centers which do not meet the Eps condition and the MinPts condition; and clustering again by using the DBSCAN based on the screened clustering center to obtain a plurality of data clusters.
And 105, comparing the Euclidean distance between the clustering centers of different data clusters with the diameter of the fruit tree, and updating the clustering centers of the data clusters according to the comparison result to obtain the final clustering center.
Referring to step 210 in fig. 2, when the euclidean distance between the cluster centers of different data clusters is smaller than the diameter of a fruit tree, replacing different cluster centers with a midpoint between the different cluster centers, and triggering to perform data clustering according to a density-based clustering algorithm DBSCAN and the updated cluster centers to obtain a plurality of data clusters; and when the Euclidean distance between the clustering centers of different data clusters is larger than or equal to the diameter of the fruit tree, taking the different clustering centers as final clustering centers.
Specifically, when two cluster center distances are encountered, the step returns to the step 27 when the distance is smaller than the diameter of the fruit tree (the diameter of the fruit tree at the radar installation position); otherwise, obtaining a final clustering center to form a cluster;
and 106, dividing the fruit tree cluster and other target clusters according to the final cluster center to obtain a fruit tree detection result.
Referring to step 211 in fig. 2, dividing the fruit tree cluster and other target clusters according to the final cluster center to obtain a fruit tree detection result, including: comparing the distance between each point in the environmental point cloud data and the final clustering center with the dynamic radius of the fruit tree; comparing the neighborhood density of each point in the environmental point cloud data with a dynamic neighborhood density threshold; and when the distance is within the dynamic radius of the fruit tree and the neighborhood density is within the dynamic neighborhood density threshold, determining the corresponding point as the point of the fruit tree to obtain the detection result of the fruit tree.
Specifically, fruit trees are distinguished from obstacles (mainly other agricultural machinery, people and weeds) in a clustering way, and the following two conditions are met: (1) if the dynamic radius Dyn _ rad of the fruit tree is satisfied, namely radmin≤Dist(Xi,Cn_best)≤radmaxThen the fruit tree is obtained; (2) if the dynamic neighborhood density threshold Dyn _ Pts belongs to [ Pts _ num ] is satisfiedmin,Pts_nummax]Then the fruit tree is obtained; and finally, the fruit trees are detected by using the laser radar.
In summary, in the fruit tree detection method provided by this embodiment, the environmental point cloud data in the orchard area collected by the mobile device is acquired; clustering the environmental point cloud data through LAPO to obtain an optimal clustering center set; comparing Euclidean distances between different clustering centers in the optimal clustering center set with the diameters of the fruit trees to update the clustering centers according to comparison results to obtain updated clustering centers; performing data clustering according to the DBSCAN and the updated clustering center to obtain a plurality of data clusters; comparing the Euclidean distance between the clustering centers of different data clusters with the diameter of the fruit tree, and updating the clustering centers of the data clusters according to the comparison result to obtain the final clustering center; dividing the fruit tree cluster and other target clusters according to the final cluster center to obtain a fruit tree detection result; the detection of the fruit trees can be realized without knowing the information such as the number of the fruit trees, the planting spacing and the like in advance.
In addition, the fruit tree detection method of the embodiment can obtain the actual number of fruit trees right ahead.
In addition, the fruit tree detection method optimizes the local optimal condition of the traditional LAPO algorithm and the condition that the traditional DBSCAN clustering algorithm is influenced by Eps and MinPts, can accurately identify the common environmental characteristics in orchards such as trees, other agricultural machines, people and weeds, and eliminates the environmental characteristics such as other agricultural machines, people and weeds, only leaves the point set clustering information of the fruit trees, and realizes the detection of the fruit trees.
Fig. 3 is a block diagram of a fruit tree detection apparatus according to an embodiment of the present application. The device at least comprises the following modules: the fruit tree detection system comprises a data acquisition module 310, a first clustering module 320, a first comparison module 330, a second clustering module 340, a second comparison module 350 and a fruit tree detection module 360.
A data acquisition module 310, configured to acquire environmental point cloud data in a orchard area acquired by a mobile device;
the first clustering module 320 is configured to cluster the environmental point cloud data through a lightning connection process optimization algorithm LAPO to obtain an optimal clustering center set, where the optimal clustering center set includes multiple clustering centers;
a first comparing module 330, configured to compare euclidean distances between different clustering centers in the optimal clustering center set with the diameters of the fruit trees, so as to update the multiple clustering centers according to a comparison result, and obtain updated clustering centers;
the second clustering module 340 is configured to perform data clustering according to a density-based clustering algorithm DBSCAN and the updated clustering center to obtain a plurality of data clusters; the clustering center of the data cluster is the mean value of the data cluster;
the second comparison module 350 is configured to compare the euclidean distance between the clustering centers of different data clusters with the diameter of the fruit tree, so as to update the clustering centers of the data clusters according to the comparison result, and obtain a final clustering center;
and the fruit tree detection module 360 is used for dividing the fruit tree clusters and other target clusters according to the final cluster center to obtain fruit tree detection results.
For relevant details reference is made to the above-described method embodiments.
It should be noted that: in the fruit tree detection device provided in the above embodiment, when performing fruit tree detection, only the division of the above function modules is taken as an example, in practical application, the function distribution may be completed by different function modules as required, that is, the internal structure of the fruit tree detection device is divided into different function modules to complete all or part of the above described functions. In addition, the fruit tree detection device provided by the above embodiment and the fruit tree detection method embodiment belong to the same concept, and the specific implementation process thereof is described in the method embodiment in detail and is not described herein again.
Optionally, the present application further provides a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the fruit tree detection method of the foregoing method embodiment.
Optionally, the present application further provides a computer product, which includes a computer-readable storage medium, where a program is stored in the computer-readable storage medium, and the program is loaded and executed by a processor to implement the fruit tree detection method of the foregoing method embodiment.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
The above is only one specific embodiment of the present application, and any other modifications based on the concept of the present application are considered as the protection scope of the present application.

Claims (10)

1. A fruit tree detection method is characterized by comprising the following steps:
acquiring environmental point cloud data in a orchard area acquired by mobile equipment;
clustering the environmental point cloud data through a lightning connection process optimization algorithm LAPO to obtain an optimal clustering center set, wherein the optimal clustering center set comprises a plurality of clustering centers;
comparing Euclidean distances between different clustering centers in the optimal clustering center set with the diameters of the fruit trees, and updating the clustering centers according to a comparison result to obtain updated clustering centers;
performing data clustering according to a density-based clustering algorithm DBSCAN and the updated clustering center to obtain a plurality of data clusters; the clustering center of the data cluster is the mean value of the data cluster;
comparing Euclidean distances between clustering centers of different data clusters with the diameters of fruit trees, and updating the clustering centers of the data clusters according to a comparison result to obtain a final clustering center;
and dividing the fruit tree cluster and other target clusters according to the final cluster center to obtain a fruit tree detection result.
2. The method of claim 1, wherein comparing Euclidean distances between different cluster centers in the optimal cluster center set with the fruit tree diameter to update the plurality of cluster centers according to the comparison result to obtain updated cluster centers comprises:
and when the Euclidean distance between the different clustering centers is smaller than the diameter of the fruit tree, replacing the different clustering centers with the middle points between the different clustering centers to obtain the updated clustering centers.
3. The method of claim 2, further comprising:
when the Euclidean distance between the different clustering centers is larger than or the diameter of the fruit tree, the clustering centers are kept unchanged, and the density-based clustering algorithm DBSCAN and the updated clustering centers are triggered to be executed for data clustering to obtain a plurality of data clusters; and the clustering center of the data cluster is the mean value of the data cluster.
4. The method of claim 1, wherein the environmental point cloud data is collected from a lidar sensor on the mobile device, and the fruit tree diameter is a corresponding fruit tree diameter of an installation height of the lidar sensor.
5. The method of claim 1, wherein the clustering the environmental point cloud data by LAPO to obtain an optimal cluster center set comprises:
randomly generating n groups of clustering centers from the environmental point cloud data; each cluster center group comprises k cluster centers; k is a positive integer, and n is an integer greater than 1;
calculating the mean value of the n groups of clustering centers;
inputting the average value into a preset objective function to obtain an objective function value of an average value point;
determining an optimal value point and a worst value point from each clustering center according to the objective function value of each clustering center;
replacing the worst value point with an average value point when the objective function value of the worst value point is greater than the objective function value of the average value point;
for each clustering center in the ith clustering center group in the n clustering center groups, randomly selecting a jth clustering center group from the n clustering center groups, wherein i is not equal to j, and both i and j are positive integers less than or equal to n;
when the objective function value of the mean value point is larger than the objective function value of the cluster center in the jth cluster center group, replacing the cluster center in the ith cluster center group according to the following formula:
Ci=Ci+rand×(Cave-rand×(Cj));
Cirepresents the cluster centers in the ith cluster center group, and rand represents [0, 1 ]]Random number in between, CaveRepresents the mean value, the CjRepresenting the cluster centers in the jth cluster center group;
when the objective function value of the mean value point is smaller than the objective function value of the cluster center in the jth cluster center group, replacing the cluster center in the ith cluster center group according to the following formula:
Ci=Ci-rand×(Cave-rand×(Cj));
after the n groups of clustering center groups are updated to obtain the updated n groups of clustering center groups, calculating the optimal value point, the worst value point and the mean value point of the updated n groups of clustering center groups;
and (3) performing cluster center updating operation on each cluster center in the updated n groups of cluster center groups according to the following formula to obtain new n groups of cluster center groups:
Cnew=Cnew+rand×S×(Cnew_ave+rand×(Cnew_low-Ct_best))
Figure FDA0003173798500000031
where t denotes the current number of iterations, tmaxRepresenting a preset maximum number of iterations, Cnew_aveRepresenting mean points, C, in the updated n sets of cluster centersnew_lowRepresenting the worst point, C, in the updated n cluster-center groupst_bestRepresenting an optimal value point in the current iteration;
and after the new n groups of clustering center groups are obtained, the step of replacing the worst value point with the average value point when the objective function value of the worst value point is larger than the objective function value of the average value point is executed again until the optimal clustering center set is obtained when the cycle termination condition is reached.
6. The method according to claim 1, wherein the clustering data according to the density-based clustering algorithm DBSCAN and the updated clustering center to obtain a plurality of data clusters comprises:
calculating the distance from each point in the environmental point cloud data to the updated clustering center by the following formula;
Figure FDA0003173798500000032
wherein x isiRepresenting the ith point in the ambient point cloud data, cn_bestRepresenting an nth one of the updated cluster centers;
dividing each data point to a corresponding updated clustering center according to a confidence function to obtain a divided data set; the confidence function is represented by:
Figure FDA0003173798500000033
wherein, argminjdis(xi,cj) Denotes the variable value that minimizes the dis function, in this case, xiBelong to cj;xiRepresenting the ith point in the ambient point cloud data, cjRepresenting the jth clustering center, wherein i and j are positive integers;
screening the clustering centers in the divided data set according to a preset neighborhood radius Eps condition and a neighborhood density threshold MinPts condition so as to discard the clustering centers which do not meet the Eps condition and the MinPts condition;
and clustering again by using the DBSCAN based on the screened clustering center to obtain the plurality of data clusters.
7. The method of claim 1, wherein comparing the Euclidean distance between the cluster centers of different data clusters with the fruit tree diameter to update the cluster centers of the data clusters according to the comparison result to obtain a final cluster center comprises:
when the Euclidean distance between the clustering centers of different data clusters is smaller than the diameter of the fruit tree, replacing the different clustering centers by using the middle points between the different clustering centers, and triggering and executing the step of carrying out data clustering according to the density-based clustering algorithm DBSCAN and the updated clustering centers to obtain a plurality of data clusters;
and when the Euclidean distance between the clustering centers of different data clusters is larger than or equal to the diameter of the fruit tree, taking the different clustering centers as final clustering centers.
8. The method of claim 1, wherein the dividing the fruit tree cluster from other target clusters according to the final cluster center to obtain the fruit tree detection result comprises:
comparing the distance between each point in the environmental point cloud data and the final clustering center with the dynamic radius of the fruit tree;
comparing a neighborhood density for each point in the ambient point cloud data to a dynamic neighborhood density threshold;
and when the distance is within the dynamic radius of the fruit tree and the neighborhood density is within the dynamic neighborhood density threshold, determining the corresponding point as the point of the fruit tree to obtain the detection result of the fruit tree.
9. The utility model provides a fruit tree detection device which characterized in that, the device includes:
the data acquisition module is used for acquiring environmental point cloud data in the orchard area acquired by the mobile equipment;
the first clustering module is used for clustering the environmental point cloud data through a lightning connection process optimization algorithm LAPO to obtain an optimal clustering center set, and the optimal clustering center set comprises a plurality of clustering centers;
the first comparison module is used for comparing Euclidean distances between different clustering centers in the optimal clustering center set with the diameters of the fruit trees so as to update the clustering centers according to comparison results to obtain updated clustering centers;
the second clustering module is used for clustering data according to a density-based clustering algorithm DBSCAN and the updated clustering center to obtain a plurality of data clusters; the clustering center of the data cluster is the mean value of the data cluster;
the second comparison module is used for comparing the Euclidean distance between the clustering centers of different data clusters with the diameter of the fruit tree so as to update the clustering centers of the data clusters according to the comparison result to obtain the final clustering center;
and the fruit tree detection module is used for dividing the fruit tree clusters and other target clusters according to the final cluster center to obtain fruit tree detection results.
10. The apparatus of claim 9, wherein the first comparing module is configured to:
and when the Euclidean distance between the different clustering centers is smaller than the diameter of the fruit tree, replacing the different clustering centers with the middle points between the different clustering centers to obtain the updated clustering centers.
CN202110826512.3A 2021-07-21 2021-07-21 Fruit tree detection method and device Pending CN113469276A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110826512.3A CN113469276A (en) 2021-07-21 2021-07-21 Fruit tree detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110826512.3A CN113469276A (en) 2021-07-21 2021-07-21 Fruit tree detection method and device

Publications (1)

Publication Number Publication Date
CN113469276A true CN113469276A (en) 2021-10-01

Family

ID=77881633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110826512.3A Pending CN113469276A (en) 2021-07-21 2021-07-21 Fruit tree detection method and device

Country Status (1)

Country Link
CN (1) CN113469276A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104885202A (en) * 2013-03-04 2015-09-02 琳得科株式会社 Dicing sheet substrate film, and dicing sheet provided with said substrate film
CN109166145A (en) * 2018-08-10 2019-01-08 中国农业大学 A kind of fruit tree leaf growth parameter(s) extracting method and system based on cluster segmentation
CN110097060A (en) * 2019-03-28 2019-08-06 浙江工业大学 A kind of opener recognition methods towards trunk image
CN110210575A (en) * 2019-06-13 2019-09-06 重庆亿创西北工业技术研究院有限公司 A kind of three clustering methods and system based on improvement DBSCAN

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104885202A (en) * 2013-03-04 2015-09-02 琳得科株式会社 Dicing sheet substrate film, and dicing sheet provided with said substrate film
CN109166145A (en) * 2018-08-10 2019-01-08 中国农业大学 A kind of fruit tree leaf growth parameter(s) extracting method and system based on cluster segmentation
CN110097060A (en) * 2019-03-28 2019-08-06 浙江工业大学 A kind of opener recognition methods towards trunk image
CN110210575A (en) * 2019-06-13 2019-09-06 重庆亿创西北工业技术研究院有限公司 A kind of three clustering methods and system based on improvement DBSCAN

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
刘燕: ""基于Spark平台的改进DBSCAN算法研究"", 《信息科技辑》 *
张莹莹 等: ""基于激光雷达的果园树干检测"", 《中国农业大学学报》 *
牛润新 等: ""基于激光雷达的农业机器人果园树干检测算法"", 《农业机械学报》 *

Similar Documents

Publication Publication Date Title
Issad et al. A comprehensive review of Data Mining techniques in smart agriculture
CN108846832B (en) Multi-temporal remote sensing image and GIS data based change detection method and system
CN111598915B (en) Point cloud single wood segmentation method, device, equipment and computer readable medium
CN110363861B (en) Laser radar point cloud-based field crop three-dimensional reconstruction method
Wang et al. YOLOv3-Litchi detection method of densely distributed litchi in large vision scenes
KR101912233B1 (en) Target positioning method and system
US20200110173A1 (en) Obstacle detection method and device
CN111932943B (en) Dynamic target detection method and device, storage medium and roadbed monitoring equipment
Li et al. Evolutionary clustering of moving objects
CN106093946A (en) A kind of target condensing method being applicable to scene surveillance radar and device
CN111289998A (en) Obstacle detection method, obstacle detection device, storage medium, and vehicle
Kianmehr et al. Fuzzy clustering-based discretization for gene expression classification
CN112291734A (en) Method for optimizing coverage of mobile sensor network area
CN103336970B (en) Distributed images based on many subtrees training and search method
Janrao et al. Management zone delineation in Precision agriculture using data mining: A review
CN113469276A (en) Fruit tree detection method and device
CN115442887B (en) Indoor positioning method based on RSSI of cellular network
CN106249241B (en) A kind of self-adapting clutter power statistic algorithm
CN115100613A (en) Lane line detection method based on laser radar point cloud information
CN114372611A (en) Water resource optimal allocation method and device
CN115001394A (en) Solar cell state monitoring method and system based on artificial intelligence
Vardhan et al. Density based clustering technique on crop yield prediction
Bao et al. Trajectory outlier detection based on partition-and-detection framework
CN113807254A (en) Intelligent clustering method based on hierarchical self-organizing mapping digital signal modulation mode
CN108646235B (en) Method for identifying space scattering fixed clutter based on point trace position aggregation

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