CN111798459A - Unmanned aerial vehicle aerial photography tree self-adaptive segmentation method and system based on switching thought - Google Patents

Unmanned aerial vehicle aerial photography tree self-adaptive segmentation method and system based on switching thought Download PDF

Info

Publication number
CN111798459A
CN111798459A CN202010548394.XA CN202010548394A CN111798459A CN 111798459 A CN111798459 A CN 111798459A CN 202010548394 A CN202010548394 A CN 202010548394A CN 111798459 A CN111798459 A CN 111798459A
Authority
CN
China
Prior art keywords
image
segmentation
color
tree
switching
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
CN202010548394.XA
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.)
Beijing Forestry University
Original Assignee
Beijing Forestry 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 Beijing Forestry University filed Critical Beijing Forestry University
Priority to CN202010548394.XA priority Critical patent/CN111798459A/en
Publication of CN111798459A publication Critical patent/CN111798459A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30181Earth observation
    • G06T2207/30188Vegetation; Agriculture

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Probability & Statistics with Applications (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the invention discloses a switching thought-based self-adaptive segmentation method and system for an unmanned aerial vehicle aerial tree, wherein the method comprises the following steps: calculating the color complexity of the image, wherein the image is an aerial tree image; determining a switching factor according to the color complexity, and classifying the images according to the switching factor; segmenting the image by adopting a corresponding segmentation method according to the classification result to obtain a segmented image for separating the tree and the background; carrying out binarization processing on the segmentation image; and calculating the area information of each area in the image after the binarization processing, determining a target area meeting the preset requirement, and calculating the number of connected domains of the target area. The unmanned aerial vehicle aerial tree self-adaptive segmentation method based on the switching thought has universality for processing aerial tree images, is high in segmentation and quantization efficiency, gives consideration to various characteristics to more accurate segmentation and quantization, and has the advantage of good segmentation effect.

Description

Unmanned aerial vehicle aerial photography tree self-adaptive segmentation method and system based on switching thought
Technical Field
The invention relates to the technical field of image processing, in particular to an unmanned aerial vehicle aerial photographing tree self-adaptive segmentation method and system based on a switching idea.
Background
In the process of tree segmentation of an aerial image of an unmanned aerial vehicle, a single tree is generally identified and segmented, for example, segmentation is performed based on a detection algorithm of colors or clustering, and the influence of a complex environment in the aerial image is not considered, so that the segmentation mode has poor universality and low segmentation efficiency, and more accurate segmentation and quantification can not be performed by considering various characteristics. Moreover, the method is only based on a detection algorithm of color or clustering, cannot adaptively perform quantitative segmentation on aerial tree images of different types, and is large in limitation.
Disclosure of Invention
Based on the problems in the prior art, the embodiment of the invention provides an unmanned aerial vehicle aerial photography tree self-adaptive segmentation method and system based on a switching idea.
In a first aspect, an embodiment of the present invention provides an unmanned aerial vehicle aerial photography tree self-adaptive segmentation method based on a switching concept, including: calculating the color complexity of an image, wherein the image is an aerial tree image; determining a switching factor according to the color complexity, and classifying the images according to the switching factor; segmenting the image by adopting a corresponding segmentation method according to the classification result to obtain a segmented image for separating the tree and the background; carrying out binarization processing on the segmentation image; and calculating the area information of each area in the image after the binarization processing, determining a target area meeting a preset requirement, and calculating the number of connected domains of the target area.
In some examples, the calculating the color complexity of the image includes:
converting the color representation of all pixels in the image from an RGB color space to an HSV color space according to a conversion formula of RGB and HSV color space color representation, marking the pixels meeting preset conditions as achromatic pixels, and marking the rest pixels as chromatic pixels;
if the current pixel is marked as a color pixel, the current pixel is taken as a seed pixel to calculate the connected domain where the current pixel is located, and the | L is satisfiedcyl(s,i)|<Tc|,|Lcyl(s, i) | denotes the color distance between the seed pixel s and the pixel under investigation v, TcRepresents a given threshold;
if the current pixel is marked as an achromatic pixel, the current pixel is taken as a seed pixel to calculate the connected domain where the current pixel is located, and the | V is satisfieds-Vv|<TacVs denotes the brightness, T, of the seed pixel s and the pixel under investigation vacRepresents a given threshold;
and calculating the complexity of the image color feature according to the pixel number information of all colors and each connected domain of each color of the image in the HSV color space.
In some examples, the switching factor a is:
Figure BDA0002541569880000021
classifying the image according to the switching factor, including:
when the color complexity C of the image is less than 0.5, the image is classified into a type of using standard deviation + HSV color segmentation, and when the color complexity C of the image is more than 0.5, the image is classified into a type of using Canopy + Kmeans clustering segmentation, wherein C is the color complexity of the image.
In some examples, when the image is classified into a type using standard deviation + HSV color segmentation, the segmenting the image by using a corresponding segmentation method according to the classification result to obtain a segmented image with trees and a background separated, including:
converting the color representation of all pixels of the image from an RGB color space to an HSV color space according to a conversion formula of RGB and HSV color space color representation;
any pixel points of a plurality of target trees are locked on an image in an HSV (hue, saturation and value) color space, the hue H, the saturation S and the brightness V of each pixel point are determined, and the standard difference of the hue H and the average difference of the saturation S and the brightness V between the pixel points are calculated;
and establishing a white image, copying the separated required pixels into the white image, performing mask operation on the white image, and converting the white image into an RGB image.
In some examples, when the image is classified into a type segmented by using Canopy + Kmeans clustering, the segmenting the image by using a corresponding segmentation method according to the classification result to obtain a segmented image with trees and background separated, including:
arranging a plurality of aerial tree images into a sample list L [ x1, x 2., xm ], setting initial distance thresholds T1 and T2 according to prior knowledge or cross validation parameters, wherein T1 is more than T2;
randomly selecting a sample P from the sample list L as a centroid of a first sphere, and deleting the P from the sample list L;
randomly selecting a sample Q from the sample list L, calculating the distances from Q to all centroids, and determining the minimum distance D: if D is less than or equal to T1, giving Q a weak mark to indicate that Q belongs to the corresponding canty and adding Q to the corresponding canty; if D is less than or equal to T2, giving Q a strong mark, indicating that Q belongs to the corresponding canty and is close to the centroid, setting the centroid of the canty as the center position of all strong mark samples, and deleting Q from the sample list L; if D > T1, Q forms a new cluster and Q is removed from the sample list L;
and taking k points obtained by the initial clustering of canty as initial clustering center points of kmeans, assigning the nearest cluster to each residual object according to the distance between the k points and the centers of the clusters, and then recalculating the average value of each cluster until convergence.
In some examples, before the binarizing processing on the segmented image, the method further includes: and denoising the segmentation image.
In some examples, after the binarizing processing on the segmented image, the method further includes: and performing morphology correction on the segmentation image after the binarization processing by using a watershed method.
In a second aspect, an embodiment of the present invention further provides an unmanned aerial vehicle aerial photography tree self-adaptive segmentation system based on a switching concept, including:
the color complexity calculating module is used for calculating the color complexity of an image, wherein the image is an aerial tree image;
the classification module is used for determining a switching factor according to the color complexity and classifying the images according to the switching factor;
the segmentation module is used for segmenting the image by adopting a corresponding segmentation method according to the classification result so as to obtain a segmented image for separating the tree and the background;
and the processing module is used for carrying out binarization processing on the segmented image, calculating the area information of each area in the image after binarization processing, determining a target area meeting a preset requirement, and calculating the number of connected areas of the target area.
In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor, when executing the computer program, implements the unmanned aerial vehicle aerial photography tree adaptive segmentation method based on the switching concept according to the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the unmanned aerial vehicle aerial tree adaptive segmentation method based on the switching concept according to the first aspect.
According to the technical scheme, the unmanned aerial vehicle aerial tree self-adaptive segmentation method and system based on the switching thought, provided by the embodiment of the invention, have the advantages that the color complexity of the aerial tree image is obtained, the image is classified through the switching factor according to the color complexity, the tree and the background are separated by using different segmentation modes for the classification result, the binarization processing is carried out on the segmentation image, the area, the perimeter and the roundness of each region are calculated, and the region meeting the requirements is marked. Compared with the prior art, the method has the advantages of universality in processing of aerial tree images, high segmentation and quantization efficiency, more accurate segmentation and quantization considering various characteristics, and good segmentation effect.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of an unmanned aerial vehicle aerial tree adaptive segmentation method based on a switching concept according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an image 1 of aerial photography in an unmanned aerial vehicle aerial photography tree adaptive segmentation method based on a switching concept according to an embodiment of the present invention;
FIG. 3 is a schematic illustration of the hvs distribution of image 1 in FIG. 2;
fig. 4 is a schematic diagram of an image 2 of aerial photography in the unmanned aerial vehicle aerial tree adaptive segmentation method based on the switching concept according to an embodiment of the present invention;
FIG. 5 is a schematic illustration of the hvs distribution of image 2 in FIG. 4;
fig. 6 is an M1-type diagram in the unmanned aerial vehicle aerial tree adaptive segmentation method based on the switching concept according to an embodiment of the present invention;
fig. 7 is an M2-type diagram in the unmanned aerial vehicle aerial tree adaptive segmentation method based on the switching concept according to an embodiment of the present invention;
FIG. 8 is a segmentation graph of the M1-type graph of FIG. 6 after applying standard deviation + HSV color segmentation;
FIG. 9 is a graph of the segmentation of the M2 graph of FIG. 7 after applying the canty + kmeans clustering segmentation;
FIG. 10 is a diagram showing the effect of labeling the M1 type graph shown in FIG. 6 after binarization processing;
FIG. 11 is a diagram showing the effect of labeling the M2 graph of FIG. 7 after binarization;
fig. 12 is a schematic structural diagram of an unmanned aerial vehicle aerial tree adaptive segmentation system based on a switching concept according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following further describes embodiments of the present invention with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
The following describes an unmanned aerial vehicle aerial photography tree self-adaptive segmentation method and system based on a switching idea according to an embodiment of the invention with reference to the accompanying drawings.
Fig. 1 shows a flowchart of an unmanned aerial vehicle aerial tree adaptive segmentation method based on a switching concept according to an embodiment of the present invention, and as shown in fig. 1, the unmanned aerial vehicle aerial tree adaptive segmentation method based on a switching concept according to an embodiment of the present invention specifically includes the following contents:
s101: and calculating the color complexity of the image, wherein the image is an aerial tree image.
In one or more examples, calculating a color complexity of an image includes: converting the color representation of all pixels in the image from the RGB color space to the HSV color space according to a conversion formula of the color representation of the RGB color space and the HSV color space, and filling the color spaceThe pixels which meet the preset condition are marked as achromatic pixels, and the rest pixels are marked as chromatic pixels; if the current pixel is marked as a color pixel, the current pixel is taken as a seed pixel to calculate the connected domain where the current pixel is located, and the | L is satisfiedcyl(s,i)|<Tc|,|Lcyl(s, i) | denotes the color distance between the seed pixel s and the pixel under investigation v, TcRepresents a given threshold; if the current pixel is marked as an achromatic pixel, the current pixel is taken as a seed pixel to calculate the connected domain where the current pixel is located, and the | V is satisfieds-Vv|<TacVs denotes the brightness, T, of the seed pixel s and the pixel under investigation vacRepresents a given threshold; and calculating the complexity of the image color feature according to the pixel number information of all colors and each connected domain of each color of the image in the HSV color space.
Specifically, according to a conversion formula of RGB and HSV color space color expression, converting color expression of all pixels from RGB color space to HSV color space, marking pixels (V > 90) or (V <10) or (S <10) as achromatic pixels and marking the rest pixels as chromatic pixels while converting, and dividing each pixel in an image into two types of chromatic and achromatic colors; establishing a color linked list, wherein each record in the linked list corresponds to one color identified in the image; aiming at each record in the linked list, establishing a linked list of a color area to record the number of connected domains in which the pixels of each color are distributed and the number of pixels in each connected domain;
if the pixel is marked as a colored pixel, then the pixel is used as a seed pixel to calculate the connected domain where the pixel is located, and the | L is required to be satisfiedcyl(s,i)|<Tc|,|Lcyl(s, i) | denotes the color distance between the seed pixel s and the pixel under investigation v, TcDenotes a given threshold value, TcFor example, a value of 50; the color distance between pixel s and pixel v is defined as:
Figure BDA0002541569880000071
Lv=|VS-Vv|,
Figure BDA0002541569880000072
α=|Hs-Hvi, when | Hs-Hv|<180°,
α=360°-|Hs-HvI, when isv|>180°;
Where Vs, Ss, Hs and Vv, Sv, Hv represent the brightness, saturation and hue of the seed pixel s and the pixel v under investigation, respectively. The connected component in which the current pixel is located is calculated. Modifying the states of all pixels in the connected domain into marked states, simultaneously changing the color values of all pixels in the connected domain into the average color value of the connected domain, and returning the number of the pixels in the connected domain and the average color value of the connected domain;
if the pixel is marked as a neutral pixel, and then used as a seed pixel to calculate the connected domain where the pixel is located, the requirement of | V is satisfieds-Vv|<TacVs denotes the brightness, T, of the seed pixel s and the pixel under investigation vacDenotes a given threshold value, TacTaking 50; and calculating the connected domain where the current pixel is located. Modifying the states of all pixels in the connected domain into marked states, simultaneously changing the color values of all pixels in the connected domain into average color values of the connected domain, and returning the number of the pixels in the connected domain and the average color values of the connected domain;
according to the information of the number of pixels of the image in all colors and each connected domain of each color in the HSV color space obtained by statistics, according to the information of the number of the pixels in each connected domain of each color
Figure BDA0002541569880000073
Calculating the complexity of the color features of the image, wherein
Figure BDA0002541569880000074
Representing the complexity of the color space distribution of the image, k representing the number of different colors in the image, CiComplexity of spatial distribution characteristics, n, representing ith coloriIndicating the number of pixels of the ith color, and N indicating the total number of pixels of the image;
Figure BDA0002541569880000075
Representing the complexity of the features of the image color types, m representing the number of different colors of the image, N representing the total number of image pixels, NiIndicating the number of pixels of the ith color.
As shown in FIG. 2, an image 1 is shown, the distribution of hvs of which is shown in FIG. 3, where Cs=0.1192CdNormalized (C) 0.0012s+Cd) 0.0612. As shown in fig. 4, another image 2 is shown, whose hvs distribution is shown in fig. 5. Cs=0.9602Cd0.3067, C is normalized (C)s+Cd)=0.6335。
S102: and determining a switching factor according to the color complexity, and classifying the images according to the switching factor.
The switching factor a is, for example:
Figure BDA0002541569880000081
classifying the image according to a switching factor, including: when the color complexity C of the image is less than 0.5, the image is classified into a type of using standard deviation + HSV color segmentation, and when the color complexity C of the image is more than 0.5, the image is classified into a type of using Canopy + Kmeans clustering segmentation, wherein C is the color complexity of the image.
For example: when color complexity results C<At 0.5, the standard deviation + HSV color segmentation method is used; when the color complexity result C is more than 0.5, using a Canopy + Kmeans clustering method; defining a switching strategy M ═ (1-A) × M1+A*M2,M1Representing an HSV segmentation improved by the standard deviation of the colour, M2Representing the Canopy + Kmeans cluster.
As shown in fig. 6, a graph of type M1 is shown, where C-0.5447 and M-M1. As shown in fig. 7, a graph of type M2 is shown, where C is 0.2112 and M is M2
S103: and segmenting the image by adopting a corresponding segmentation method according to the classification result to obtain a segmented image for separating the tree and the background.
Example 1: when the tree is classified into a type of using standard deviation plus HSV color segmentation, segmenting the image by adopting a corresponding segmentation method according to a classification result to obtain a segmented image for separating the tree and the background, wherein the method comprises the following steps of: converting the color representation of all pixels of the image from an RGB color space to an HSV color space according to a conversion formula of RGB and HSV color space color representation; any pixel points of a plurality of target trees are locked on an image in an HSV (hue, saturation and value) color space, the hue H, the saturation S and the brightness V of each pixel point are determined, and the standard difference of the hue H and the average difference of the saturation S and the brightness V between the pixel points are calculated; and establishing a white image, copying the separated required pixels into the white image, performing mask operation on the white image, and converting the white image into an RGB image.
Specifically, S30 converts the color representations of all pixels from the RGB color space to the HSV color space according to the conversion formula for RGB to HSV color space color representations. S31, locking any pixel points of a plurality of target trees (counted as x) on the HSV space image, returning the hue H, saturation S and brightness V values of each pixel point according to the existing index function, and calculating the standard deviation difference of H and the average difference of S and brightness V between the pixel points, wherein the standard deviation difference of H and the average difference of S and brightness V are calculated
Figure BDA0002541569880000091
Traverse the image to find at Hi±SH,Si±SS,Vi±SvPixel points within the range;
establishing a white image, and copying the separated required pixels to the white image;
and performing mask operation on the newly-built image, and simultaneously converting the newly-built image into an RGB image again.
For the M1 type graph shown in fig. 6, the segmentation graph after the standard deviation + HSV color segmentation is applied is shown in fig. 8.
Example 2: when the tree is classified into a type of clustering segmentation by using Canopy + Kmeans, segmenting the image by adopting a corresponding segmentation method according to a classification result to obtain a segmented image for separating the tree and the background, wherein the segmentation method comprises the following steps of: arranging a plurality of aerial tree images into a sample list L [ x1, x 2., xm ], setting initial distance thresholds T1 and T2 according to prior knowledge or cross validation parameters, wherein T1 is more than T2; randomly selecting a sample P from the sample list L as a centroid of a first sphere, and deleting the P from the sample list L; randomly selecting a sample Q from the sample list L, calculating the distances from Q to all centroids, and determining the minimum distance D: if D is less than or equal to T1, giving Q a weak mark to indicate that Q belongs to the corresponding canty and adding Q to the corresponding canty; if D is less than or equal to T2, giving Q a strong mark, indicating that Q belongs to the corresponding canty and is close to the centroid, setting the centroid of the canty as the center position of all strong mark samples, and deleting Q from the sample list L; if D > T1, Q forms a new cluster and Q is removed from the sample list L; and taking k points obtained by the initial clustering of canty as initial clustering center points of kmeans, assigning the nearest cluster to each residual object according to the distance between the k points and the centers of the clusters, and then recalculating the average value of each cluster until convergence.
Specifically, the original sample sets are randomly arranged into a sample list L ═ x1, x2,. and xm ], initial distance thresholds T1 and T2 are set according to prior knowledge or cross-validation parameters, and T1 > T2;
randomly selecting a sample P from the list L as a centroid of a first sphere, and deleting P from the list;
randomly selecting a sample Q from the list L, calculating the distances from Q to all centroids, and considering the minimum distance D: if D is less than or equal to T1, giving Q a weak mark, indicating that Q belongs to the canty, and adding Q into the canty; if D ≦ T2, then give Q a strong label, meaning that Q belongs to the canty and is very close to the centroid, so set the centroid of the canty to the center position of all strong labeled samples and remove Q from the list L; if D > T1, Q forms a new cluster and Q is removed from the list L. Repeatedly traversing all samples until the end;
and (3) initially clustering k points obtained by Canopy to obtain an initial clustering center point of kmeans, assigning each object to the nearest cluster according to the distance between each object and each cluster center, and then recalculating the average value of each cluster. This process is repeated until the criterion function converges.
The graph of M2 type shown in FIG. 7 is divided into several partitions by the canopy + kmeans cluster, as shown in FIG. 9.
S104: and carrying out binarization processing on the segmentation images.
In a specific example, before the binarizing processing is performed on the divided images, the method further includes: denoising the segmentation image, and after performing binarization processing on the segmentation image, the method further comprises the following steps: and performing morphology correction on the segmentation image after the binarization processing by using a watershed method.
That is, the segmentation image is denoised by a self-adaptive filtering method;
calculating d, wherein d is an absolute value of a difference between T and TT, an initial value of T is an average value of a maximum gray value z0 and a minimum gray value z1 in the image, TT is an average value of T0 and T1, the initial value is 0, T0 is an average value of gray values of pixels of which the gray values are not less than T in the image, and T1 is an average value of gray values of pixels of which the gray values are less than T in the image;
and judging whether d is smaller than a preset new and old threshold allowable approach value allow, if not, binarizing the image under the optimal threshold, or if so, calculating TT, and repeatedly and sequentially executing the operations of S40, updating the value of T to be the value of TT and executing the step S41, wherein the threshold used for binarization is T/255, and the value of allow is 50.
Further, calculating a Euclidean matrix of the binary image, namely calculating the distance of the nearest non-zero pixel for each pixel of the binary image, wherein D has the same size as the binary image BW;
obtaining the position of the nearest non-zero element close to the element, namely a mark matrix L, by using a watershed algorithm;
the marking matrix L is converted to an RGB image.
S105: and calculating the area information of each area in the image after the binarization processing, determining a target area meeting the preset requirement, and calculating the number of connected domains of the target area. Namely: and performing morphological closing operation on the image, solving the number of connected domains by using the thought of the connected domains, calculating the area, the perimeter and the roundness of each region by using the conventional formula and function, marking the connected domains meeting the requirements, and calculating the number of the connected domains.
As shown in fig. 10, the effect diagram is obtained by labeling the M1 type diagram shown in fig. 6 after binarization processing. As shown in fig. 11, the effect diagram is obtained by labeling the M2 type diagram shown in fig. 7 after binarization processing.
According to the unmanned aerial vehicle aerial tree self-adaptive segmentation method based on the switching thought, the color complexity of an aerial tree image is obtained, the image is classified through the switching factors according to the color complexity, the tree and the background are separated by using different segmentation modes for the classification result, the binaryzation processing is carried out on the segmentation image, the area, the perimeter and the roundness of each region are calculated, and the region meeting the requirements is marked. Compared with the prior art, the method has the advantages of universality in processing of aerial tree images, high segmentation and quantization efficiency, more accurate segmentation and quantization considering various characteristics, and good segmentation effect.
Fig. 12 is a schematic structural diagram illustrating an unmanned aerial vehicle aerial tree adaptive segmentation system based on a switching concept according to an embodiment of the present invention, and as shown in fig. 12, the unmanned aerial vehicle aerial tree adaptive segmentation system based on a switching concept according to an embodiment of the present invention includes: a color complexity calculation module 1210, a classification module 1220, a segmentation module 1230, and a processing module 1240.
The color complexity calculation module 1210 is configured to calculate a color complexity of an image, where the image is an aerial tree image; the classification module 1220 is configured to determine a switching factor according to the color complexity, and classify the image according to the switching factor; the segmentation module 1230 is configured to segment the image according to the classification result by using a corresponding segmentation method to obtain a segmented image in which the tree and the background are separated; the processing module 1240 is configured to perform binarization processing on the segmented image, calculate area information of each area in the binarized image, determine a target area meeting a preset requirement, and calculate the number of connected domains in the target area.
According to the unmanned aerial vehicle aerial tree self-adaptive segmentation system based on the switching thought, the color complexity of an aerial tree image is obtained, the image is classified through the switching factors according to the color complexity, the tree and the background are separated by using different segmentation modes for the classification result, the binaryzation processing is carried out on the segmentation image, the area, the perimeter and the roundness of each region are calculated, and the region meeting the requirements is marked. Compared with the prior art, the method has the advantages of universality in processing of aerial tree images, high segmentation and quantization efficiency, more accurate segmentation and quantization considering various characteristics, and good segmentation effect.
It should be noted that, a specific implementation manner of the unmanned aerial vehicle aerial tree self-adaptive segmentation system based on the switching idea in the embodiment of the present invention is similar to a specific implementation manner of the unmanned aerial vehicle aerial tree self-adaptive segmentation method based on the switching idea in the embodiment of the present invention, and please refer to the description of the method part specifically, and details are not described here specifically in order to reduce redundancy.
Based on the same inventive concept, another embodiment of the present invention provides an electronic device, which specifically includes the following components, with reference to fig. 13: a processor 1301, a memory 1302, a communication interface 1303, and a communication bus 1304;
the processor 1301, the memory 1302 and the communication interface 1303 complete communication with each other through the communication bus 1304; the communication interface 1303 is used for realizing information transmission among the devices;
the processor 1301 is configured to invoke a computer program in the memory 1302, and when the processor executes the computer program, the processor implements all the steps of the unmanned aerial vehicle aerial tree adaptive segmentation method based on the switching concept, for example, when the processor executes the computer program, the processor implements the following steps: calculating the color complexity of an image, wherein the image is an aerial tree image; determining a switching factor according to the color complexity, and classifying the images according to the switching factor; segmenting the image by adopting a corresponding segmentation method according to the classification result to obtain a segmented image for separating the tree and the background; carrying out binarization processing on the segmentation image; and calculating the area information of each area in the image after the binarization processing, determining a target area meeting a preset requirement, and calculating the number of connected domains of the target area.
In addition, other structures and functions of the electronic device according to the embodiment of the present invention are known to those skilled in the art, and are not described herein.
Based on the same inventive concept, a further embodiment of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements all the steps of the above unmanned aerial vehicle aerial tree adaptive segmentation method based on the switching concept, for example, when the processor executes the computer program, the processor implements the following steps: calculating the color complexity of an image, wherein the image is an aerial tree image; determining a switching factor according to the color complexity, and classifying the images according to the switching factor; segmenting the image by adopting a corresponding segmentation method according to the classification result to obtain a segmented image for separating the tree and the background; carrying out binarization processing on the segmentation image; and calculating the area information of each area in the image after the binarization processing, determining a target area meeting a preset requirement, and calculating the number of connected domains of the target area.
In addition, the logic instructions in the memory may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on such understanding, the above technical solutions may be essentially or partially implemented in the form of software products, which may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and include instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the index monitoring method according to the embodiments or some parts of the embodiments.
In addition, in the present invention, terms such as "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Moreover, in the present invention, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Furthermore, in the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. The utility model provides an unmanned aerial vehicle tree self-adaptation segmentation method of taking photo by plane based on switching thought which characterized in that includes:
calculating the color complexity of an image, wherein the image is an aerial tree image;
determining a switching factor according to the color complexity, and classifying the images according to the switching factor;
segmenting the image by adopting a corresponding segmentation method according to the classification result to obtain a segmented image for separating the tree and the background;
carrying out binarization processing on the segmentation image;
and calculating the area information of each area in the image after the binarization processing, determining a target area meeting a preset requirement, and calculating the number of connected domains of the target area.
2. The unmanned aerial vehicle aerial photography tree self-adaptive segmentation method based on switching thought of claim 1, wherein the calculating of the color complexity of the image comprises:
converting the color representation of all pixels in the image from an RGB color space to an HSV color space according to a conversion formula of RGB and HSV color space color representation, marking the pixels meeting preset conditions as achromatic pixels, and marking the rest pixels as chromatic pixels;
if the current pixel is marked as a color pixel, the current pixel is taken as a seed pixel to calculate the connected domain where the current pixel is located, and the | L is satisfiedcyl(s,i)|<Tc|,|Lcyl(s, i) | denotes the color distance between the seed pixel s and the pixel under investigation v, TcRepresents a given threshold;
if the current pixel is marked as an achromatic pixel, the current pixel is taken as a seed pixel to calculate the connected domain where the current pixel is located, and the | V is satisfieds-Vv|<TacVs denotes the brightness, T, of the seed pixel s and the pixel under investigation vacRepresents a given threshold;
and calculating the complexity of the image color feature according to the pixel number information of all colors and each connected domain of each color of the image in the HSV color space.
3. The unmanned aerial vehicle aerial photography tree self-adaptive segmentation method based on switching thought according to claim 1 or 2, wherein the switching factor A is:
Figure FDA0002541569870000011
classifying the image according to the switching factor, including:
when the color complexity C of the image is less than 0.5, the image is classified into a type of using standard deviation + HSV color segmentation, and when the color complexity C of the image is more than 0.5, the image is classified into a type of using Canopy + Kmeans clustering segmentation, wherein C is the color complexity of the image.
4. The unmanned aerial vehicle aerial photography tree self-adaptive segmentation method based on switching thought as claimed in claim 3, wherein when the image is classified into a type using standard deviation + HSV color segmentation, the image is segmented by adopting a corresponding segmentation method according to the classification result to obtain a segmented image with a tree and a background separated, comprising:
converting the color representation of all pixels of the image from an RGB color space to an HSV color space according to a conversion formula of RGB and HSV color space color representation;
any pixel points of a plurality of target trees are locked on an image in an HSV (hue, saturation and value) color space, the hue H, the saturation S and the brightness V of each pixel point are determined, and the standard difference of the hue H and the average difference of the saturation S and the brightness V between the pixel points are calculated;
and establishing a white image, copying the separated required pixels into the white image, performing mask operation on the white image, and converting the white image into an RGB image.
5. The unmanned aerial vehicle aerial photography tree self-adaptive segmentation method based on switching thought as claimed in claim 3, wherein when the image is classified into a type using Canopy + Kmeans clustering segmentation, the image is segmented by using a corresponding segmentation method according to the classification result to obtain a segmented image with the tree and the background separated, the method comprises:
arranging a plurality of aerial tree images into a sample list L [ x1, x 2., xm ], setting initial distance thresholds T1 and T2 according to prior knowledge or cross validation parameters, wherein T1 is more than T2;
randomly selecting a sample P from the sample list L as a centroid of a first sphere, and deleting the P from the sample list L;
randomly selecting a sample Q from the sample list L, calculating the distances from Q to all centroids, and determining the minimum distance D: if D is less than or equal to T1, giving Q a weak mark to indicate that Q belongs to the corresponding canty and adding Q to the corresponding canty; if D is less than or equal to T2, giving Q a strong mark, indicating that Q belongs to the corresponding canty and is close to the centroid, setting the centroid of the canty as the center position of all strong mark samples, and deleting Q from the sample list L; if D > T1, Q forms a new cluster and Q is removed from the sample list L;
and taking k points obtained by the initial clustering of canty as initial clustering center points of kmeans, assigning the nearest cluster to each residual object according to the distance between the k points and the centers of the clusters, and then recalculating the average value of each cluster until convergence.
6. The unmanned aerial vehicle aerial photography tree self-adaptive segmentation method based on switching thought as claimed in claim 1, wherein before the binarization processing of the segmentation image, the method further comprises: and denoising the segmentation image.
7. The unmanned aerial vehicle aerial photography tree self-adaptive segmentation method based on switching thought as claimed in claim 1, wherein after the binarization processing is performed on the segmentation image, the method further comprises: and performing morphology correction on the segmentation image after the binarization processing by using a watershed method.
8. The utility model provides an unmanned aerial vehicle tree self-adaptation system of cutting apart of taking photo by plane based on switching thought which characterized in that includes:
the color complexity calculating module is used for calculating the color complexity of an image, wherein the image is an aerial tree image;
the classification module is used for determining a switching factor according to the color complexity and classifying the images according to the switching factor;
the segmentation module is used for segmenting the image by adopting a corresponding segmentation method according to the classification result so as to obtain a segmented image for separating the tree and the background;
and the processing module is used for carrying out binarization processing on the segmented image, calculating the area information of each area in the image after binarization processing, determining a target area meeting a preset requirement, and calculating the number of connected areas of the target area.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for self-adaptive segmentation of trees by unmanned aerial vehicle based on switching ideas according to any one of claims 1 to 7 when executing the computer program.
10. A non-transitory computer-readable storage medium, on which a computer program is stored, wherein the computer program, when being executed by a processor, implements the unmanned aerial vehicle aerial tree adaptive segmentation method based on switching concept according to any one of claims 1 to 7.
CN202010548394.XA 2020-06-16 2020-06-16 Unmanned aerial vehicle aerial photography tree self-adaptive segmentation method and system based on switching thought Pending CN111798459A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010548394.XA CN111798459A (en) 2020-06-16 2020-06-16 Unmanned aerial vehicle aerial photography tree self-adaptive segmentation method and system based on switching thought

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010548394.XA CN111798459A (en) 2020-06-16 2020-06-16 Unmanned aerial vehicle aerial photography tree self-adaptive segmentation method and system based on switching thought

Publications (1)

Publication Number Publication Date
CN111798459A true CN111798459A (en) 2020-10-20

Family

ID=72803409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010548394.XA Pending CN111798459A (en) 2020-06-16 2020-06-16 Unmanned aerial vehicle aerial photography tree self-adaptive segmentation method and system based on switching thought

Country Status (1)

Country Link
CN (1) CN111798459A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112818775A (en) * 2021-01-20 2021-05-18 北京林业大学 Forest road rapid identification method and system based on regional boundary pixel exchange

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102208099A (en) * 2011-05-30 2011-10-05 华中科技大学 Illumination-change-resistant crop color image segmentation method
CN104157002A (en) * 2014-08-14 2014-11-19 东南大学 Color image texture force tactile reproduction method based on color transform space
CN104978565A (en) * 2015-05-11 2015-10-14 厦门翼歌软件科技有限公司 Universal on-image text extraction method
CN106651863A (en) * 2016-11-30 2017-05-10 厦门大学 Point cloud data based automatic tree cutting method
CN108416284A (en) * 2018-03-02 2018-08-17 北京航空航天大学 A kind of dividing method of traffic lights
CN109934856A (en) * 2019-01-30 2019-06-25 南京邮电大学 A kind of integration objective tracking based on ASMS and particle filter

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102208099A (en) * 2011-05-30 2011-10-05 华中科技大学 Illumination-change-resistant crop color image segmentation method
CN104157002A (en) * 2014-08-14 2014-11-19 东南大学 Color image texture force tactile reproduction method based on color transform space
CN104978565A (en) * 2015-05-11 2015-10-14 厦门翼歌软件科技有限公司 Universal on-image text extraction method
CN106651863A (en) * 2016-11-30 2017-05-10 厦门大学 Point cloud data based automatic tree cutting method
CN108416284A (en) * 2018-03-02 2018-08-17 北京航空航天大学 A kind of dividing method of traffic lights
CN109934856A (en) * 2019-01-30 2019-06-25 南京邮电大学 A kind of integration objective tracking based on ASMS and particle filter

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
白雪冰等: "基于k-mean聚类与灰度梯度最大熵的树木图像分割", 《森林工程》, pages 1 - 5 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112818775A (en) * 2021-01-20 2021-05-18 北京林业大学 Forest road rapid identification method and system based on regional boundary pixel exchange
CN112818775B (en) * 2021-01-20 2023-07-25 北京林业大学 Forest road rapid identification method and system based on regional boundary pixel exchange

Similar Documents

Publication Publication Date Title
CN107452010B (en) Automatic cutout algorithm and device
Ong et al. Segmentation of color images using a two-stage self-organizing network
TWI406180B (en) Systems and methods for generating high compression image data files having multiple foreground planes
KR100446184B1 (en) Region Segmentation of Color Image
CN109829914A (en) The method and apparatus of testing product defect
JP6192271B2 (en) Image processing apparatus, image processing method, and program
CN108764358B (en) Terahertz image identification method, device and equipment and readable storage medium
WO2018040756A1 (en) Vehicle body colour identification method and device
CN110390643B (en) License plate enhancement method and device and electronic equipment
CN103971134B (en) Image classification, retrieval and bearing calibration, and related device
Agrawal et al. Survey on image segmentation techniques and color models
CN108205671A (en) Image processing method and device
CN112132852A (en) Automatic image matting method and device based on multi-background color statistics
CN107180439B (en) Color cast characteristic extraction and color cast detection method based on Lab chromaticity space
CN114299051A (en) Leather material surface defect detection method based on feature modeling significance detection
CN115272838A (en) Information fusion technology-based marine plankton automatic identification method and system
CN111931782B (en) Semantic segmentation method, system, medium and device
CN111833362A (en) Unstructured road segmentation method and system based on superpixel and region growing
US20210213615A1 (en) Method and system for performing image classification for object recognition
CN114494739B (en) Toner mixing effect detection method based on artificial intelligence
CN111798459A (en) Unmanned aerial vehicle aerial photography tree self-adaptive segmentation method and system based on switching thought
CN115272350A (en) Method for detecting production quality of computer PCB mainboard
Kuzovkin et al. Descriptor-based image colorization and regularization
CN113379785B (en) Saliency target detection method integrating boundary priori and frequency domain information
Sharma et al. Enhanced Edges Detection from Different Color Space

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