CN111753726B - Magnetic marker crown boundary vectorization method based on crown coding - Google Patents
Magnetic marker crown boundary vectorization method based on crown coding Download PDFInfo
- Publication number
- CN111753726B CN111753726B CN202010588462.5A CN202010588462A CN111753726B CN 111753726 B CN111753726 B CN 111753726B CN 202010588462 A CN202010588462 A CN 202010588462A CN 111753726 B CN111753726 B CN 111753726B
- Authority
- CN
- China
- Prior art keywords
- point
- crown
- current
- magnetic force
- boundary
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/10—Terrestrial scenes
- G06V20/188—Vegetation
Landscapes
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)
- Magnetic Resonance Imaging Apparatus (AREA)
Abstract
The invention provides a crown boundary vectorization method based on a crown code for a magnetic marker, which is used for solving the problem of low crown boundary vectorization efficiency in the prior art. According to the boundary vectorization method, a crown marking grid layer is newly built on the basis of a crown coding grid unit, when the crown coding of the current grid unit is effective and vectorization is not completed, the vectorization crown boundary is obtained as a seed point, and then the grid unit in the boundary range is magnetically marked to obtain a magnetically marked crown grid unit. According to the method, the tree crown boundary vectorization can be rapidly realized through the magnetic force mark without depending on tree crown vertex information or building a spatial index or judging whether the grid unit is positioned in the vectorized tree crown boundary, the operation time is linearly increased along with the increase of the data quantity, geometrical growth cannot occur, the operation efficiency is high, the time is saved, and the method is also suitable for rapid vectorization of a large-data-quantity grid.
Description
Technical Field
The invention belongs to the field of forest identification, and particularly relates to a crown boundary vectorization method based on a crown code and adopting a magnetic force marker.
Background
In forest resource investigation, the number and survival state of trees in a certain region range need to be counted and monitored. The three-dimensional remote sensing technologies such as laser radar and photogrammetry can directly measure the canopy space structure of a forest, generate a canopy height model, vectorize the crown grid area through a single-tree segmentation algorithm, divide the canopy height model into single crown areas and effectively count and monitor trees. To obtain a single crown area, crown vector boundaries need to be obtained.
In the prior art, crown vertex methods and non-crown vertex methods are common. When crown vertices are known, the crown vertices are traversed in turn, each crown boundary is vectorized, and the operation efficiency depends on the number of crown vertices. For example, a single-tree block identification method requires known crown vertices, which in turn vector individual crown areas. However, this method does not allow crown area vectorization in the absence of crown vertex information. In addition, the non-crown vertex method is to pass through each grid unit in turn when the crown vertex is unknown, and judge whether the grid units are positioned in the crown boundary which is already vectorized. The method sequentially judges whether the grid units are positioned in the vectored crown boundary or not, and the operand is increased in geometric progression; even if the grid unit is judged to be positioned in the vectored crown boundary by adopting the space index acceleration, a large amount of operation is still needed, the operation efficiency is low, and the time consumption is long.
Disclosure of Invention
In order to count and monitor trees and improve the efficiency of crown boundary vectorization, the embodiment of the invention provides a crown boundary vectorization method based on a crown code, which does not depend on crown vertex information, does not need to establish a spatial index, does not need to judge whether grid units are positioned in the vectored crown boundary, can rapidly realize crown boundary vectorization through the magnetic marker, increases the operation time linearly along with the increase of data quantity, does not generate geometric growth, has high operation efficiency and saves time.
In order to achieve the above object, the technical scheme adopted by the embodiment of the invention is as follows:
a magnetic marker crown boundary vectorization method based on crown coding comprises the following steps:
step S1, reading raster coding raster data;
step S2, creating a tree crown marking grid layer according to the tree crown coding grid data;
step S3, judging whether the crown coding of the current grid unit is effective or not according to the grid unit index; when invalid, adding 1 to the grid unit index, and repeating the step S3; when valid, step S4 is entered;
s4, judging the marking state of the current grid unit according to the crown marking grid layer; when the marking state is vectorization completed, adding 1 to the grid unit index, and turning to step S3; when the marking state is incomplete vectorization, entering step S5;
s5, taking the current grid unit as a seed point, and taking the seed point as an initial point to obtain a vectorized crown boundary point;
s6, magnetically marking grid units in the vectorized crown boundary range from the seed points to obtain magnetically marked crown grid units;
step S7, judging whether all the magnetic marks of the crown grid units are completed or not, if not, turning to step S3; and if so, obtaining the complete magnetic mark tree crown vectorization boundary.
In the above scheme, in the steps S3 and S4, if the crown coding value of the grid unit is valid and the grid unit is not marked as the vectorized crown, the grid unit is defined as the seed point as the crown grid unit to be vectorized.
In the above scheme, in the step S2, a tree crown marking grid layer is newly built, an initial value of the tree crown marking grid layer is set to 0, a tree crown marking value is defined as a tree crown sequence number, the tree crown sequence number is an integer greater than 0, and the tree crown sequence numbers are sequentially increased according to a traversing sequence of the tree crowns.
In the above solution, the step S5 includes the following steps:
step S51, taking the current grid unit as a seed point, and sequentially decrementing row coordinates of the seed point until a crown boundary grid unit on the north of the seed point is found and taken as a starting point of a crown boundary; calculating geographic coordinates according to the row coordinates of the upper left corner of the starting point, and storing the geographic coordinates of the upper left corner of the starting point;
step S52, defining a starting point as a moving point, and moving the moving point to obtain a crown boundary point;
step S53, for the crown boundary concave area, repeated concave points appear, if the current boundary point coordinates are equal to the previous boundary point coordinates, the repeated concave points are not saved, otherwise, the geographical coordinates are calculated according to the boundary point row and column coordinates, and the boundary point geographical coordinates are saved, so that the vectorized crown boundary points are obtained.
In the above solution, the step S52 includes the following steps:
step S521, the moving point points to east/south/west/north, record the row coordinates of the upper right/lower left/upper left corner of the moving point, if the next point of the moving point does not exceed the outer boundary of the grid, go to step S522; if the next point of the moving point exceeds the grid outer boundary, go to step S525;
step S522, if the next point of the moving point is the current crown upper point, proceeding to step S523; if the next point of the moving point is not the current crown upper point, go to step S525;
step S523, if the left point of the next point of the moving point does not exceed the grid outer boundary, proceeding to step S524; if the point on the left side of the next point of the moving point exceeds the grid outer boundary, the moving point does not change the direction, the moving point advances one point, and the step S521 is shifted to;
step S524, if the point on the left of the next point of the moving point is the point on the current crown, the step S526 is shifted to; if the point on the left side of the next point of the moving point is not the point on the current crown, the moving point does not change the direction, the moving point advances by one point, and the step S521 is shifted to;
step S525, interrupting the current direction, judging whether the current moving point coincides with the starting point; if not, the mobile point turns to south/west/north/east, and the step S521 is entered; if the moving points are overlapped, ending, wherein all the moving points are crown boundary points;
step S526, interrupting the current direction, and judging whether the current moving point coincides with the starting point; if not, the moving point is turned north/east/south/west, and the step S521 is entered; if the moving points are overlapped, ending, wherein all the moving points are crown boundary points.
In the above solution, the step S6 includes the following steps:
step S61, setting the mark of the seed point as a crown sequence number;
step S62, defining a magnetic force point linked list;
and step S63, circulating a magnetic force marking grid unit according to the magnetic force point linked list, and updating a crown marking layer by using the crown serial number.
In the above scheme, in the magnetic mark in step S63, when the magnetic mark of the current crown grid unit is connected, if the grid unit above the current magnetic point belongs to the current crown and the crown number is not marked, the previous point of the current magnetic point is connected; if the grid unit on the right side of the current magnetic force point belongs to the current tree crown and the tree crown serial number is not marked, the right side point of the current magnetic force point is communicated; if the grid unit below the current magnetic point belongs to the current crown and the crown number is not marked, the next point of the current magnetic point is communicated; if the grid unit at the left side of the current magnetic force point belongs to the current tree crown and the tree crown number is not marked, the left side point of the current magnetic force point is communicated.
In the above scheme, in the magnetic mark in step S63, when the magnetic mark of the current crown grid unit is adsorbed, if the previous point of the current magnetic point is communicated, the previous point of the current magnetic point is marked and added to the adsorption magnetic point linked list; if the right side point of the current magnetic force point is communicated, marking the right side point of the current magnetic force point and adding the right side point to an adsorption magnetic force point linked list; if the next point of the current magnetic point is communicated, marking the next point of the current magnetic point and adding the next point to the adsorption magnetic point linked list; if the left side point of the current magnetic force point is communicated, marking the left side point of the current magnetic force point and adding the left side point to the adsorption magnetic force point linked list.
In the above scheme, in the magnetic mark in step S63, when the magnetic mark of the current crown grid unit is adsorbed and updated, if the current magnetic point linked list is processed, the current magnetic point linked list is cleared, the adsorbed magnetic point linked list is transferred to the current magnetic point linked list, the adsorbed magnetic point linked list is cleared, and a new round of magnetic mark adsorption is started; and (3) until no new adsorption magnetic force point appears, and finishing the adsorption of the magnetic force mark.
The invention has the following beneficial effects:
according to the crown coding-based magnetic marker crown boundary vectorization method, the crown vertex information is not relied on, a spatial index is not required to be established, whether a grid unit is located in a crown boundary which is vectorized or not is not required to be judged, crown boundary vectorization can be achieved rapidly through magnetic markers, with the increase of data quantity, operation time is increased linearly, geometric growth cannot occur, operation efficiency is high, time is saved, and the method is also suitable for rapid vectorization of a large number of grids.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a crown boundary vectorization method of a magnetic marker based on crown coding in an embodiment of the invention.
Detailed Description
The technical problems, technical solutions and advantages of the present invention will be explained in detail below by referring to exemplary embodiments. The following exemplary embodiments are only for explaining the present invention and are not to be construed as limiting the present invention. It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
Aiming at the problems of low efficiency and long time consumption of a tree crown boundary vectorization process in the current tree statistics and monitoring, the invention provides a magnetic marking tree crown boundary vectorization method based on tree crown coding, which comprises the steps of generating a crown height model according to a tree crown space structure obtained by direct measurement, performing tree crown coding on the crown height model, processing grid units based on the tree crown coding, traversing each tree crown coding grid unit in sequence, creating a tree crown marking grid layer for marking a vectored tree crown area in order to not change the tree crown coding grid layer, judging vectorization marks for the current grid unit, taking the current grid unit as a seed point if the current grid unit is an effective tree crown coding and is not marked, and finally, marking the grid units in the tree crown boundary range by the magnetic marking tree crown, and accelerating judgment of the tree crown grid units.
Fig. 1 is a schematic flow chart of a crown boundary vectorization method of a magnetometric marker based on crown coding according to an embodiment of the invention. As shown in fig. 1, the magnetic marker crown boundary vectorization method based on crown coding in this embodiment includes the following steps:
and S1, reading crown coding raster data.
The crown coding method in the step has a plurality of methods, can divide the crown height model, code each dividing block and take each dividing block as 1 crown; crown vertices can be identified from the crown height model, crown coverage areas can be identified according to morphological characteristics of the crowns, and each crown can be encoded. And S2, creating a tree crown marking grid layer according to the tree crown coding grid data.
As a preferred embodiment of the invention, the initial values of the crown marking grid layers in the step are all 0, the crown marking values are defined as crown numbers, the crown numbers are integers larger than 0, and the crown numbers are sequentially increased according to the traversing sequence of the crowns.
Step S3, judging whether the crown coding of the current grid unit is effective or not according to the grid unit index; when invalid, adding 1 to the grid unit index, and repeating the step S3; when valid, the process advances to step S4.
In this step, the grid cell index is obtained by sequentially numbering each grid cell position according to a row priority method. For example, the 1 st row 1 st column grid cell index=0, the 1 st row 2 nd column grid cell index=1, the 1 st row 3 rd column grid cell index=2, and the grid cell index=column number-1 when the 1 st row and the last 1 st column are reached, the 2 nd row 1 st column grid cell index=column number.
In this step, the step of judging whether the crown coding of the current grid unit is valid is specifically as follows: if the grid cell value is equal to the non-data value or the ignore value, the crown coding is invalid; if the grid cell value is not equal to the non-data value and the ignore value, it indicates that the crown encoding is valid. The judgment process is used to exclude areas other than crowns, which may be bare land, herbaceous or shrub covered areas.
The basis for whether crown coding is valid is a trellis unit value, which includes a non-data value and an ignore value. Non-data value: the raster cell value does not represent an observed value, i.e. there is no observed data at the location of the raster cell, but a value must be given when saving raster data, this value being the non-data value, which is defined in the raster file header. Ignore value: the grid unit has an observed value, which is not a crown value, but an observed value of other ground features such as bare land, herbs, shrubs and the like, and the crown boundary needs to be ignored when the grid unit is identified. The ignore value may be specified by a user.
S4, judging the marking state of the current grid unit according to the newly-built tree crown marking grid layer; when the marking state is vectorization completed, adding 1 to the grid unit index, and turning to step S3; when the flag state is the incomplete vectorization, the process proceeds to step S5.
In the step, a method for judging the crown grid unit to be vectorized is provided: if the crown coding value of the grid unit is valid and the grid unit is not marked as the vectorized crown, the grid unit is used as the crown grid unit to be vectorized, the grid unit is defined as a seed point, and vectorized crown boundaries are started.
And S5, taking the current grid unit as a seed grid unit (called seed point for short), and vectorizing the boundary of the current crown.
In this step, the vectorizing the current crown boundary specifically includes the following steps:
in step S51, the current grid unit is used as a seed point (SeedCol, seedRow), and the row coordinates of the seed point are sequentially decremented until the northern crown boundary grid unit of the seed point is found and is used as a start grid unit (simply referred to as a start point) of the crown boundary. The geographic coordinates are calculated from the upper left row coordinates (FirstCol, firstRow) of the starting point and the upper left geographic coordinates of the starting point are saved.
In step S52, the starting point is defined as a moving grid unit (simply referred to as a moving point), and a crown boundary point is obtained.
The moving point has four angles of an upper left corner, an upper right corner, a lower right corner and a lower left corner, and the row coordinates of the four angles are respectively: the upper left corner (MoveCol, moveRow), the upper right corner (moveCol+1, moveRow), the lower right corner (moveCol+1, moveRow+1), the lower left corner (moveCol+1, moveRow+1). The moving points have directivity and are respectively directed to the east, the south, the west and the north. The next grid cell of the moving point pointing direction is simply referred to as the next point, and the left grid cell of the next point of the moving point is simply referred to as the left point.
The moving point moves to obtain a crown boundary point, and the description is given taking the initial direction as an example. In particular practice, the initial direction may be any direction. The specific operation is as follows:
step S521, the moving point points to east/south/west/north, record the row and column coordinates (MoveCol+1, moveRow) of the upper right/lower left/upper left of the moving point, if the next point (MoveCol+1, moveRow) of the moving point does not exceed the grid outer boundary, go to step S522; if the next point (moveCol+1, moveRow) of the moving point exceeds the grid outer boundary, go to step S525;
step S522, if the next point (movecol+1, moverow) of the moving point is the current crown upper point, proceeding to step S523; if the next point (moveCol+1, moveRow) of the moving point is not the current crown upper point, the process proceeds to step S525;
step S523, if the left point (moveCol+1, moveRow+1) of the next point of the moving point does not exceed the grid outer boundary, proceeding to step S524; if the point (moveCol+1, moveRow+1) on the left side of the next point of the moving point exceeds the grid outer boundary, the moving point does not change the direction, the moving point advances by one point, and the process goes to step S521;
step S524, if the point (moveCol+1, moveRow+1) on the left side of the next point of the moving point is the current crown upper point, then go to step S526; if the point (moveCol+1, moveRow+1) on the left side of the next point of the moving point is not the current crown point, the moving point does not change the direction, the moving point advances one point, and the step S521 is shifted to;
step S525, interrupting the current direction, judging whether the current moving point coincides with the starting point; if not, the mobile point turns to south/west/north/east, and the step S521 is entered; if the moving points are overlapped, ending, wherein all the moving points are crown boundary points.
Step S526, interrupting the current direction, and judging whether the current moving point coincides with the starting point; if not, the moving point is turned north/east/south/west, and the step S521 is entered; if the moving points are overlapped, ending, wherein all the moving points are crown boundary points.
Step S521 to step S526 propose a turning method of the current crown boundary grid unit: if the next point in the advancing direction of the current crown boundary grid belongs to the current crown and the left point of the next point also belongs to the current crown, the current crown boundary grid does not advance and is directly turned to the left; if the next point in the advancing direction of the current crown boundary grid belongs to the current crown and the point on the left side of the next point does not belong to the current crown, the current crown boundary grid is directly advanced; if the next point in the advancing direction of the current crown boundary grid does not belong to the current crown, the current crown boundary grid does not advance and is directly turned to the right. The method for storing the external corner points of the current crown boundary grid unit is also provided: if the direction of the current crown boundary grid points to the east, storing the upper right corner coordinates of the boundary grid; if the current crown boundary grid direction points to the south, storing the lower right corner coordinates of the boundary grid; if the current crown boundary grid direction points to the west, storing the left lower corner coordinate of the boundary grid; if the current crown boundary grid direction points north, the upper left corner coordinates of the boundary grid are saved.
Step S53, for the crown boundary concave area, repeated concave points appear, if the current boundary point coordinates are equal to the previous boundary point coordinates, the repeated concave points are not saved, otherwise, the geographic coordinates are calculated according to the boundary point row and column coordinates, and the boundary point geographic coordinates are saved.
And (5) obtaining the vectorized crown boundary points through the step (S5).
And S6, magnetically marking the vectorized crown boundary points from the seed points according to the connectivity of the four adjacent domains to obtain magnetically marked crown grid units.
In the step S5, on the basis that the vectorization of the current crown boundary is completed, not only the crown boundary grid units but also the crown internal grid units are marked, the vectorization of the whole crown is completed, and the vectorization judging process of the crown can be accelerated.
The method specifically comprises the following steps:
in step S61, the mark of the seed point is set as the crown number.
Step S62, defining a magnetic force point linked list.
Preferably, two magnetic force point linked lists are defined in the step, wherein the first magnetic force point linked list is used for storing the current magnetic force point and is called the current magnetic force point linked list; the second magnetic force point linked list is used for storing the four adjacent domain connected magnetic force points adsorbed in one cycle, and is called as an adsorption magnetic force point linked list. Defining seed points as magnetic points, and storing the seed points in a current magnetic point linked list; the linked list of the adsorption magnetic force points is empty.
And step S63, circulating a magnetic force marking grid unit according to the magnetic force point linked list, and updating a crown marking layer by using the crown serial number.
In the step, the current magnetic force point linked list is traversed in sequence, whether the four-neighborhood communication grid unit of each magnetic force point meets the adsorption condition is judged, if yes, the communication grid unit is marked, and the communication grid unit is added into the adsorption magnetic force point linked list. The specific process is as follows:
A. for the current magnetic force point (MoveCol, moveRow), a connected grid unit (abbreviated as the upper point) above the magnetic force point is judged:
a.1 if the upper point (MoveCol, moveRow-1) of the magnetic force point does not exceed the outer boundary of the grid, continuing to judge;
1.1, if the crown code of the upper point (MoveCol, moveRow-1) of the magnetic force point is equal to the crown code of the seed point, continuing to judge;
a.1.1.1 if the last point (MoveCol, moveRow-1) of the magnetic point is not marked, marking the last point of the magnetic point as the current crown number, taking the last point of the magnetic point as an adsorption magnetic point, storing the adsorption magnetic point into an adsorption magnetic point linked list, and continuously judging other connected grid units of the magnetic point; in the step, the current magnetic force point is provided with 4 communication grid units, and when the upper communication grid unit of the current magnetic force point is judged, the other 3 communication grid units are a right communication grid unit, a lower communication grid unit and a left communication grid unit respectively; the sequence of judging the 4 connected grid units of the current magnetic force point is arbitrary and has no dependency;
a1.1.2 if the previous point (MoveCol, moveRow-1) of the magnetic force point is marked, continuing to judge other connected grid units of the magnetic force point;
1.2 if the crown code of the last point (MoveCol, moveRow-1) of the magnetic point is not equal to the crown code of the seed point, continuing to judge other connected grid units of the magnetic point;
a2, if the upper point (MoveCol, moveRow-1) of the magnetic force point exceeds the outer boundary of the grid, continuing to judge other connected grid units of the magnetic force point;
B. for the current magnetic force point (MoveCol, moveRow), judging a connected grid unit (right side point for short) on the right side of the magnetic force point:
b.1, if the right side point (MoveCol+1, moveRow) of the magnetic force point does not exceed the outer boundary of the grid, continuing to judge;
b.1.1 if the crown code of the right side point (MoveCol+1, moveRow) of the magnetic force point is equal to the crown code of the seed point, continuing to judge;
b.1.1.1 if the right side point (moveCol+1, moveRow) of the magnetic force point is not marked, marking the right side point of the magnetic force point as the current tree crown serial number, taking the right side point of the magnetic force point as an adsorption magnetic force point, storing the adsorption magnetic force point into an adsorption magnetic force point linked list, and continuously judging other connected grid units of the magnetic force point;
b.1.1.2 if the right side point (MoveCol+1, moveRow) of the magnetic force point is marked, continuing to judge other connected grid units of the magnetic force point;
b.1.2 if the crown code of the right side point (moveCol+1, moveRow) of the magnetic point is not equal to the crown code of the seed point, continuing to judge other connected grid units of the magnetic point;
b.2 if the right side point (MoveCol+1, moveRow) of the magnetic force point exceeds the outer boundary of the grid, continuing to judge other connected grid units of the magnetic force point;
C. for the current magnetic force point (MoveCol, moveRow), a connected grid unit (abbreviated as the next point) below the magnetic force point is judged:
c.1, if the next point (MoveCol, moveRow +1) of the magnetic force points does not exceed the outer boundary of the grid, continuing to judge;
c.1.1 if the crown code of the next point (MoveCol, moveRow +1) of the magnetic force point is equal to the crown code of the seed point, continuing to judge;
c.1.1.1 if the next point (MoveCol, moveRow +1) of the magnetic point is not marked, marking the next point of the magnetic point as the current crown number, taking the next point of the magnetic point as an adsorption magnetic point, storing the adsorption magnetic point into an adsorption magnetic point linked list, and continuously judging other connected grid units of the magnetic point;
c.1.1.2 if the next point (MoveCol, moveRow +1) of the magnetic point is marked, continuing to judge other connected grid units of the magnetic point;
c.1.2 if the next (MoveCol, moveRow +1) crown code of the magnetic point is not equal to the crown code of the seed point, continuing to judge other connected grid units of the magnetic point;
c.2 if the next point (MoveCol, moveRow +1) of the magnetic force point exceeds the outer boundary of the grid, continuing to judge other connected grid units of the magnetic force point;
D. for the current magnetic force point (MoveCol, moveRow), judging a connected grid unit (left point for short) on the left side of the magnetic force point:
d.1, if the left side point (MoveCol-1, moveRow) of the magnetic force point does not exceed the outer boundary of the grid, continuing to judge;
d.1.1 if the crown code of the left side point (moveCol-1, moveRow) of the magnetic force point is equal to the crown code of the seed point, continuing to judge;
d.1.1.1 if the left side point (moveCol-1, moveRow) of the magnetic force point is not marked, marking the left side point of the magnetic force point as the current tree crown serial number, taking the left side point of the magnetic force point as an adsorption magnetic force point, storing the adsorption magnetic force point into an adsorption magnetic force point linked list, and continuing to judge;
d.1.1.2 if the left side point (MoveCol-1, moveRow) of the magnetic force point is marked, continuing to judge;
d.1.2 if the crown code of the left side point (moveCol-1, moveRow) of the magnetic force point is not equal to the crown code of the seed point, continuing to judge;
d.2 if the left side point (MoveCol-1, moveRow) of the magnetic force point exceeds the grid outer boundary, continuing to judge;
E. clearing a current magnetic force point linked list;
F. judging an adsorption magnetic force point linked list:
f.1, if the adsorption magnetic force point chain table has magnetic force points, transferring the magnetic force points in the magnetic force point chain table to the current magnetic force point chain table, and emptying the adsorption magnetic force point chain table;
f.2 if the adsorption magnetic force point chain table has no magnetic force points, ending the cycle.
And (3) finishing marking of the current crown grid unit after the magnetic marking cycle in the step S6 is finished.
The steps include:
the current magnetic mark communication method of the crown grid unit comprises the following steps: if the grid unit above the current magnetic point belongs to the current crown and the crown number is not marked, the last point of the current magnetic point is communicated; if the grid unit on the right side of the current magnetic force point belongs to the current tree crown and the tree crown serial number is not marked, the right side point of the current magnetic force point is communicated; if the grid unit below the current magnetic point belongs to the current crown and the crown number is not marked, the next point of the current magnetic point is communicated; if the grid unit at the left side of the current magnetic force point belongs to the current tree crown and the tree crown number is not marked, the left side point of the current magnetic force point is communicated.
The current magnetic mark adsorption method of the crown grid unit comprises the following steps: if the previous point of the current magnetic point is communicated, marking the previous point of the current magnetic point and adding the previous point to an adsorption magnetic point linked list; if the right side point of the current magnetic force point is communicated, marking the right side point of the current magnetic force point and adding the right side point to an adsorption magnetic force point linked list; if the next point of the current magnetic point is communicated, marking the next point of the current magnetic point and adding the next point to the adsorption magnetic point linked list; if the left side point of the current magnetic force point is communicated, marking the left side point of the current magnetic force point and adding the left side point to the adsorption magnetic force point linked list.
The current method for updating the magnetic mark adsorption of the crown grid unit comprises the following steps: if the current magnetic force point linked list is processed, the current magnetic force point linked list is cleared, the adsorption magnetic force point linked list is transferred to the current magnetic force point linked list, the adsorption magnetic force point linked list is cleared, and a new round of magnetic force mark adsorption is started; and (3) until no new adsorption magnetic force point appears, and finishing the adsorption of the magnetic force mark.
Step S7, judging whether all the magnetic marks of the crown grid units are completed or not, if not, turning to step S3; and if so, obtaining the complete magnetic mark tree crown vectorization boundary.
According to the technical scheme, the crown boundary vectorization method based on the crown coding of the magnetic force mark does not depend on crown vertex information, does not need to establish a spatial index, does not need to judge whether the grid unit is positioned in the vectored crown boundary, can rapidly realize crown boundary vectorization through the magnetic force mark, increases the operation time linearly along with the increase of the data quantity, does not generate geometric growth, has high operation efficiency and time saving, and is also suitable for rapid vectorization of a large number of data grids.
While the foregoing is a description of preferred embodiments of the invention, it is noted that the invention is not limited to the exemplary embodiments disclosed above, and that the nature of the description is merely intended to aid one skilled in the relevant art in a comprehensive understanding of the specific details of the invention. It will be apparent to those skilled in the art that several modifications and variations, changes or substitutions can be made within the scope of the present disclosure without departing from the principles of the present disclosure.
Claims (5)
1. The magnetic marker crown boundary vectorization method based on crown coding is characterized by comprising the following steps:
step S1, reading raster coding raster data;
step S2, creating a tree crown marking grid layer according to the tree crown coding grid data;
step S3, judging whether the crown coding of the current grid unit is effective or not according to the grid unit index; when invalid, adding 1 to the grid unit index, and repeating the step S3; when valid, step S4 is entered;
s4, judging the marking state of the current grid unit according to the crown marking grid layer; when the marking state is vectorization completed, adding 1 to the grid unit index, and turning to step S3; when the marking state is incomplete vectorization, entering step S5;
s5, taking the current grid unit as a seed point, and taking the seed point as an initial point to obtain a vectorized crown boundary point;
s6, magnetically marking grid units in the vectorized crown boundary range from the seed points to obtain magnetically marked crown grid units; the method specifically comprises the following steps:
step S61, setting the mark of the seed point as a crown sequence number;
step S62, defining a magnetic force point linked list;
step S63, circulating a magnetic force marking grid unit according to the magnetic force point linked list, and updating a crown marking layer by using the crown serial number;
in the magnetic marking in the step S63, when the magnetic marking of the current crown grid unit is communicated, if the grid unit above the current magnetic point belongs to the current crown and the crown number is not marked, the last point of the current magnetic point is communicated; if the grid unit on the right side of the current magnetic force point belongs to the current tree crown and the tree crown serial number is not marked, the right side point of the current magnetic force point is communicated; if the grid unit below the current magnetic point belongs to the current crown and the crown number is not marked, the next point of the current magnetic point is communicated; if the grid unit at the left side of the current magnetic force point belongs to the current tree crown and the tree crown serial number is not marked, the left side point of the current magnetic force point is communicated;
in the step S63, when the magnetic force mark of the current crown grid unit is adsorbed, if the previous point of the current magnetic force point is communicated, the previous point of the current magnetic force point is marked and added to an adsorption magnetic force point linked list; if the right side point of the current magnetic force point is communicated, marking the right side point of the current magnetic force point and adding the right side point to an adsorption magnetic force point linked list; if the next point of the current magnetic point is communicated, marking the next point of the current magnetic point and adding the next point to the adsorption magnetic point linked list; if the left side point of the current magnetic force point is communicated, marking the left side point of the current magnetic force point and adding the left side point to an adsorption magnetic force point linked list;
in the step S63, when the magnetic force mark of the current crown grid unit is adsorbed and updated, if the current magnetic force point linked list is processed, the current magnetic force point linked list is emptied, the adsorbed magnetic force point linked list is transferred to the current magnetic force point linked list, the adsorbed magnetic force point linked list is emptied, and a new round of magnetic force mark adsorption is started; until no new adsorption magnetic force point appears, finishing the adsorption of the magnetic force mark;
step S7, judging whether all the magnetic marks of the crown grid units are completed or not, if not, turning to step S3; and if so, obtaining the complete magnetic mark tree crown vectorization boundary.
2. The method according to claim 1, wherein in the steps S3 and S4, if the crown coding value of the grid unit is valid and the grid unit is not marked as a vectorized crown, the grid unit is defined as a seed point.
3. The method of claim 1, wherein in step S2, a tree crown marking grid layer is newly built, an initial value of the tree crown marking grid layer is set to 0, a tree crown marking value is defined as a tree crown sequence number, the tree crown sequence number is an integer greater than 0, and the tree crown sequence numbers are sequentially increased according to a traversing sequence of the tree crowns.
4. The method for magnetically labeling crown boundaries vectorization of claim 1, wherein the step S5 includes the steps of:
step S51, taking the current grid unit as a seed point, and sequentially decrementing row coordinates of the seed point until a crown boundary grid unit on the north of the seed point is found and taken as a starting point of a crown boundary; calculating geographic coordinates according to the row coordinates of the upper left corner of the starting point, and storing the geographic coordinates of the upper left corner of the starting point;
step S52, defining a starting point as a moving point, and moving the moving point to obtain a crown boundary point;
step S53, for the crown boundary concave area, repeated concave points appear, if the current boundary point coordinates are equal to the previous boundary point coordinates, the repeated concave points are not saved, otherwise, the geographical coordinates are calculated according to the boundary point row and column coordinates, and the boundary point geographical coordinates are saved, so that the vectorized crown boundary points are obtained.
5. The method of magnetically marked crown boundary vectorization of claim 4, wherein said step S52 comprises the steps of:
step S521, the moving point points to east/south/west/north, record the row coordinates of the upper right/lower left/upper left corner of the moving point, if the next point of the moving point does not exceed the outer boundary of the grid, go to step S522; if the next point of the moving point exceeds the grid outer boundary, go to step S525;
step S522, if the next point of the moving point is the current crown upper point, proceeding to step S523; if the next point of the moving point is not the current crown upper point, go to step S525;
step S523, if the left point of the next point of the moving point does not exceed the grid outer boundary, proceeding to step S524; if the point on the left side of the next point of the moving point exceeds the grid outer boundary, the moving point does not change the direction, the moving point advances one point, and the step S521 is shifted to;
step S524, if the point on the left of the next point of the moving point is the point on the current crown, the step S526 is shifted to; if the point on the left side of the next point of the moving point is not the point on the current crown, the moving point does not change the direction, the moving point advances by one point, and the step S521 is shifted to;
step S525, interrupting the current direction, judging whether the current moving point coincides with the starting point; if not, the mobile point turns to south/west/north/east, and the step S521 is entered; if the moving points are overlapped, ending, wherein all the moving points are crown boundary points;
step S526, interrupting the current direction, and judging whether the current moving point coincides with the starting point; if not, the moving point is turned north/east/south/west, and the step S521 is entered; if the moving points are overlapped, ending, wherein all the moving points are crown boundary points.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010588462.5A CN111753726B (en) | 2020-06-24 | 2020-06-24 | Magnetic marker crown boundary vectorization method based on crown coding |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010588462.5A CN111753726B (en) | 2020-06-24 | 2020-06-24 | Magnetic marker crown boundary vectorization method based on crown coding |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111753726A CN111753726A (en) | 2020-10-09 |
| CN111753726B true CN111753726B (en) | 2024-01-19 |
Family
ID=72677069
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010588462.5A Active CN111753726B (en) | 2020-06-24 | 2020-06-24 | Magnetic marker crown boundary vectorization method based on crown coding |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111753726B (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102096818A (en) * | 2011-01-31 | 2011-06-15 | 中国林业科学研究院资源信息研究所 | Object-oriented automatic extracting method and system for outline and parameter of remote sensing image crown |
| CN102881028A (en) * | 2012-05-22 | 2013-01-16 | 浙江大学 | Method for quickly vectorizing grid digital image |
| CN102930561A (en) * | 2012-10-22 | 2013-02-13 | 南京大学 | Delaunay-triangulation-based grid map vectorizing method |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11277956B2 (en) * | 2018-07-26 | 2022-03-22 | Bear Flag Robotics, Inc. | Vehicle controllers for agricultural and industrial applications |
-
2020
- 2020-06-24 CN CN202010588462.5A patent/CN111753726B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102096818A (en) * | 2011-01-31 | 2011-06-15 | 中国林业科学研究院资源信息研究所 | Object-oriented automatic extracting method and system for outline and parameter of remote sensing image crown |
| CN102881028A (en) * | 2012-05-22 | 2013-01-16 | 浙江大学 | Method for quickly vectorizing grid digital image |
| CN102930561A (en) * | 2012-10-22 | 2013-02-13 | 南京大学 | Delaunay-triangulation-based grid map vectorizing method |
Non-Patent Citations (2)
| Title |
|---|
| 基于像元有向边的栅格数据扫描线矢量化方法;苏程;周祖煜;倪广翼;俞伟斌;黄智才;章孝灿;;计算机辅助设计与图形学学报(第07期);全文 * |
| 机载激光雷达森林参数估测方法研究;刘清旺;《中国博士学位论文全文数据库》(第01期);全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111753726A (en) | 2020-10-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103383682B (en) | A kind of Geocoding, position enquiring system and method | |
| CN114119863B (en) | Method for automatically extracting street tree targets and forest attributes thereof based on vehicle-mounted laser radar data | |
| Newman et al. | Assessing deforestation and fragmentation in a tropical moist forest over 68 years; the impact of roads and legal protection in the Cockpit Country, Jamaica | |
| CN107179776B (en) | A drone-based method for sowing landscape plants | |
| CN114245316B (en) | Base station deployment optimization method and system based on UWB positioning | |
| CN110473251A (en) | Custom field spatial data area statistics method based on grid spatial index | |
| CN117953278A (en) | A method and system for crop classification in irrigation areas based on remote sensing cloud platform and machine learning algorithm | |
| CN113032404B (en) | Method and system for extracting pattern spot change track facing earth surface coverage data | |
| CN109813273A (en) | A kind of agricultural machinery repetition working area determination method based on spatial analysis | |
| CN112100308B (en) | Similarity query method for Beidou space-time trajectory | |
| CN114493099A (en) | Urban and rural gradient construction method for carbon sink ecological importance | |
| CN106204719B (en) | Magnanimity model real-time scheduling method in three-dimensional scenic based on two-dimensional neighbourhood retrieval | |
| CN114139099A (en) | Extraction method of road intersection information based on trajectory density homogenization and hierarchical segmentation | |
| CN114721418B (en) | A method for planning the operation route of agricultural drones on irregular plots | |
| CN111753726B (en) | Magnetic marker crown boundary vectorization method based on crown coding | |
| CN111681313A (en) | Digital topographic map-based space vision field analysis method and electronic equipment | |
| CN108984584A (en) | geographic information processing method and device | |
| CN116431964B (en) | Run-length stripping method for generating complex river network water system skeleton line | |
| CN110986996B (en) | Data processing method and device, electronic equipment and storage medium | |
| CN108663050A (en) | A kind of paths planning method guiding RRT algorithms based on simulation of plant growth | |
| CN111506576A (en) | A method and device for block coding based on regional quadtree | |
| CN115704900B (en) | Point cloud data processing method, device, equipment and storage medium | |
| CN116358527B (en) | Point cloud data processing and elevation determining method, equipment and storage medium | |
| CN118424298A (en) | Unmanned aerial vehicle emergency task intelligent planning method and system based on three-dimensional grid | |
| CN119225373A (en) | A path planning method, system, device and medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |