CN112164110B - Method for discovering road key positions based on skeletonized pictures - Google Patents
Method for discovering road key positions based on skeletonized pictures Download PDFInfo
- Publication number
- CN112164110B CN112164110B CN202010912073.3A CN202010912073A CN112164110B CN 112164110 B CN112164110 B CN 112164110B CN 202010912073 A CN202010912073 A CN 202010912073A CN 112164110 B CN112164110 B CN 112164110B
- Authority
- CN
- China
- Prior art keywords
- point
- target
- points
- image
- angle
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20024—Filtering details
- G06T2207/20032—Median filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30181—Earth observation
- G06T2207/30184—Infrastructure
Abstract
The invention provides a method for finding key positions of roads based on skeletonized pictures, which comprises the steps of taking a 2D street map of a certain road, carrying out median filtering processing on an input image, carrying out image binarization, carrying out skeleton line calculation processing, tracking and obtaining the position, the orientation angle and the attack range of a target through the amplification operation of a third-party library, and obtaining S1 points of all back areas; the farthest point at a certain angle is determined by calculation, and the point farthest from the target is selected from the farthest points, that is, the point is the only key point for the target. The method is mainly used for simulating the scene that one party flexibly attacks the target when two parties fight on the street in the future, and can enable a decision-making system to automatically find the position where the target is attacked in the target view blind area by acquiring the street map and the position orientation of the target through an unmanned aerial vehicle.
Description
Technical Field
The invention belongs to the technical field of screening key positions of targets on a plane street map, relates to an implementation method for skeletonizing calculation on the plane street map and obtaining key points aiming at favorable positions of the targets, and particularly relates to a method for finding key positions of roads based on skeletonized pictures.
Background
In a city simulation scene, a user usually needs to probe the position and the orientation of a target, so that the user can flexibly attack the target at the lowest cost. The keypoints are defined as the best position for the attack target outside the target's field of view. The existing urban simulation battle system cannot achieve intelligent operation, and the key points are usually judged by manpower. At present, on a 2D map, under the condition that coordinate points and view angles of targets in the map are known, the optimal attack positions, namely key points, outside view blind areas of the targets are found, but most of the functions of finding the optimal attack positions in the map are found manually, a large amount of time is consumed for manual finding, and meanwhile, the functions depend on manual experience, errors are prone to occur, and the time is prolonged.
Disclosure of Invention
In order to solve the problem that the intelligent operation cannot be achieved in the existing urban combat system, the key points are usually judged by manpower, the method is based on a skeletonization algorithm, the specific skeletonization algorithm is an operation of processing a binary image, skeletonization is to extract the central pixel outline of a target on the image, the target is refined by taking the target center as the reference, the generally refined target is the single-layer pixel width, a skeleton line of a passing area of the urban map is obtained by skeletonization on the urban map, and the optimal point of a target view blind area is screened as the key point.
The invention provides a method for discovering a key position of a road based on skeletonized pictures, which comprises the following steps of selecting a 2D street map of a certain road and discovering the key position of the road:
step 101, assuming that an input image is a map M constructed by scanning a street area by an unmanned aerial vehicle, performing median filtering processing on the input image, wherein the median filtering operation is F, and a result map M1 is F (M);
102, selecting a mode value in the image M1 as a threshold value, and binarizing the image to obtain a binarized image MASK 1;
step 103, performing skeleton line calculation processing on the binarized image MASK1, defining the skeleton line calculation operation as T, and adding the skeleton line to the binarized image after obtaining the skeleton line S ═ T (MASK1), so as to obtain MASK2 ═ MASK1+ S;
step 104, amplifying the shortest edge of the image by the amplifying operation of the third-party library, and increasing the resolution of the image MASK2 to obtain an amplified image R1;
105, tracking to obtain the position (x1, y1) of the target, an orientation angle D1 and an attack range A1, wherein D1 is larger than 0 degree and smaller than 360 degrees; when the angle is 0 degrees, the target unit faces to the positive north, the numerical value increases along with the clockwise direction, and 180 degrees is added according to the orientation of the target, so that a back area S1 can be obtained;
step 106, traversing the points of the back area S1 of the target, firstly calculating the angle Ai and the distance Di between each point (Xi, Yi) and the coordinate point of the target, storing the point of the straight line of each angle in a passable point set P, and storing the point in an obstacle set Z when the encountered point is an obstacle;
step 107, screening a candidate set P' of keypoints, traversing the set P to obtain the distance between a point of a certain angle and a target, if the point of the angle is in an obstacle point, determining that the farthest point of the angle is the point in the obstacle, calculating the farthest point of the point of P on the angle, namely the point in front of the obstacle point, and selecting the point farthest from the target from the farthest points, namely the point is the only keypoint for the target;
at step 108, the process ends.
As an improvement, in step 101, the median filtering process adopts a convolution operation, specifically: the numerical value of the central point position of the convolution kernel is replaced by the median value of the surrounding eight points, and the median value is used for removing the miscellaneous points in the unmanned aerial vehicle constructed map through median processing.
As an improvement, in step 102, the image binarization method includes: setting the mode value in the map M1 as x1, and performing binarization operation by traversing all points in the image M1, if the value of a point is greater than x1, setting the value of the point as 1, and setting the value of the point as 0 if the value of the point is less than x1, where 0 is an impassable area, i.e., an obstacle, and 1 is a passable area, i.e., a road, and finally obtaining a binarized image MASK 1.
In step 103, the input image contour with a certain width is processed by a method of successively removing edges until the width becomes a skeleton of only one pixel.
As an improvement, in step 107, the key points are screened by a specific method that each element to be screened includes point coordinates (X, Y) and an angle a between the point and the target,
when the angle A is in the obstacle set Z, recording the point as MAX, screening all the points at the angle A in the passable point set P, independently calculating the distances between MAX and the screened points and the target, comparing the MAX and the screened points with the target, and constructing a set R of the points with small distance MAX after comparison;
when the angle A is not in the obstacle set Z, namely no obstacle point exists on the angle line, screening all the points of the angle A in the passable point set P, and the point with the maximum distance from the target, wherein the set of the points is R;
sorting the sets R according to the distance values;
and (4) the point with the maximum distance value is the point without an obstacle with the target, namely the only key point.
Has the advantages that: the method for finding the key positions of the roads based on the skeletonized pictures is mainly used for simulating the scene that one party flexibly attacks the targets when two parties on the street fight against each other in the future, and can enable a decision-making system to automatically find the position where the targets are attacked in the target view dead zone by acquiring the street map and the position orientation of the targets through an unmanned aerial vehicle.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
The figures of the present invention are further described below in conjunction with the examples.
The invention discloses a method for finding a road key position based on a skeletonized picture, in particular to a method for finding a road key position aiming at a target by image processing. The image is a 2D street map obtained by mapping a street scene based on a camera of the unmanned aerial vehicle.
In the present embodiment, some image operations are performed by using a third-party image processing library, preferably an opencv library, which is an image processing basic library and contains a large number of image processing operation functions.
The method for the key points of the target road specifically comprises the following steps:
step 101, assuming that the input image is M, median filtering processing is performed on the input image, where the median filtering operation is F, and as a result, the map M1 is F (M).
The specific implementation mode of the invention is as follows: the specific calculation mode is opencv's media blur operation function, the function adopts 3 × 3 convolution kernel to perform convolution processing on the image, wherein each step of convolution operation is to replace the numerical value of the central point position of the convolution kernel by the median of eight surrounding points, and the hybrid points in the unmanned aerial vehicle constructed map can be effectively removed through median processing.
Step 102, selecting a mode value in the image M1 as a threshold value, binarizing the image by using a threshold function of an opencv library, if the mode value in the image M1 is x1, performing binarization operation by traversing all points in the image M1, if the value of each point is greater than x1, setting the value of each point to be 1, and if the value of each point is less than x1, setting the value of each point to be 0, wherein 0 is an impassable area, namely an obstacle, and 1 is an impassable area, namely a road, and finally obtaining the binarized image MASK 1.
And 103, performing thin function of an opencv library on the binary image MASK1, and performing skeleton line calculation on the image to finally obtain a skeleton in the passable area. Eventually becoming a skeleton of only one pixel in width. After the skeleton line calculation operation is defined as T, the skeleton line S ═ T (MASK1), and the skeleton line is obtained, the skeleton line is added to a binary image MASK2, where MASK2 ═ MASK1+ S.
In step 104, for the purpose of calculating the angle more accurately, the resolution of the image MASK2 is increased, and the resize operation function through the opencv library is performed, wherein the resize function is responsible for changing the resolution of the image. Specifically, the image R1 is enlarged by changing the shortest side of the image to a high pixel, preferably not less than 400 pixels.
And 105, according to the position (x1, y1) of the target obtained by the unmanned aerial vehicle, the orientation angle D1 of the target and the attack range A1 of the target, wherein D1 is larger than 0 degrees and smaller than 360 degrees, when the orientation angle is 0 degree, the unit surface of the target faces the positive north, and the numerical value increases along with the clockwise direction. From the orientation of the object plus 180 deg., the back region S1 of the object can be calculated.
Step 106, traversing the points of the target back area S1, first calculating an angle Ai and a distance Di between each point (Xi, Yi) and a target coordinate point, and if there is no obstacle between the point of the straight line of each angle and the local target, storing the angle Ai and the distance Di in a key point candidate set P, where the set P { (a, X, Y) }, a is the angle of the point, and X, Y is the position of the point in the image. When the meeting point is an obstacle, saving the obstacle point in an obstacle set Z, wherein Z { (A, X, Y) };
step 107, screening the candidate set P' of key points, first traversing the set P to obtain the distance between a point of a certain angle and the target, and if the point of the angle is in the obstacle point, it is known that the farthest point of the angle is the point in the obstacle. Then the farthest point of the point of P at that angle, i.e. the point in front of the obstacle point, is calculated, and the point farthest from the target is taken from the above-mentioned farthest point, which is called the only key point for the target;
at step 108, the process ends.
The method is a method for automatically finding the key point position of the target in the street map constructed by the unmanned aerial vehicle, and can enable the decision-making system to automatically find the position attacking the target in the target view blind area by acquiring the street map and the position orientation of the target by the unmanned aerial vehicle.
Step 107 is described in detail below.
Screening a candidate set P of key points and a set Z of obstacles to find out the best key point for the position of a target, firstly traversing the set P, wherein each element in P is a point (X, Y) and an angle A between the point and the target, if the angle A is in the set Z of obstacle points, showing that the point of the obstacle with the angle farthest from the target is stored in Z, recording the point as MAX, then taking the points of all A angles in the set P, and selecting the points smaller than MAX to store in a result set R. If the angle A is not in the obstacle point set Z, the fact that no obstacle point exists on the angle line is shown, and the point which is farthest away from the target under the angle A in the P set is selected and stored in the result set R. And sequencing the results R according to the distance, finally obtaining a point which is farthest away from the target and has no barrier between the point and the target, and selecting the point as a key point.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (4)
1. A method for finding key positions of roads based on skeletonized pictures is characterized by comprising the following steps: the specific method for selecting the 2D street map of a certain road and finding the key position of the road comprises the following steps:
step 101, assuming that an input image is a map M constructed by scanning a street scene by an unmanned aerial vehicle, performing median filtering processing on the input image, wherein the median filtering operation is F, and a result map M1 is F (M);
102, selecting a mode value in an image M1 as a threshold value, and binarizing the image to obtain a binarized image MASK 1;
step 103, performing skeleton line calculation processing on the binary image MASK1, defining the skeleton line calculation operation as T, and adding the skeleton line to the binary image after obtaining the skeleton line S (MASK1), so as to obtain MASK2 as MASK1+ S;
step 104, amplifying the shortest edge of the image by the amplifying operation of the third-party library, and increasing the resolution of the image MASK2 to obtain an amplified image R1;
105, tracking to obtain the position (x1, y1) of the target, an orientation angle D1 and an attack range A1, wherein D1 is larger than 0 degree and smaller than 360 degrees; when the angle is 0 degrees, the target unit faces to the positive north, the numerical value increases along with the clockwise direction, and 180 degrees is added according to the orientation of the target, so that a back area S1 can be obtained;
step 106, traversing the points of the back area S1 of the target, firstly calculating the angle Ai and the distance Di between each point (Xi, Yi) and the coordinate point of the target, storing the point of the straight line of each angle in a passable point set P, and storing the point in an obstacle set Z when the encountered point is an obstacle;
step 107, screening the candidate set P' of key points and the obstacle set Z, and determining the only key point aiming at the target; wherein, the specific method for screening the key points is that each element to be screened comprises point coordinates (X, Y) and an angle A between the point and a target,
when the angle A is in the obstacle set Z, recording the point as MAX, screening all the points at the angle A in the passable point set P, independently calculating the distances between MAX and the screened points and the target, comparing the MAX and the screened points with the target, and constructing a set R of the points with small distance MAX after comparison;
when the angle A is not in the obstacle set Z, namely no obstacle point exists on the angle line, screening out all points of the angle A in the passable point set P and the point with the maximum distance from the target, wherein the set of the points is R;
sorting the sets R according to the distance values;
the point with the maximum distance value is the point without an obstacle between the point and the target, and the point is the only key point;
at step 108, the process ends.
2. The method for discovering road key locations based on skeletonized pictures as claimed in claim 1, wherein: in step 101, the convolution operation of the median filtering process is to replace the value of the center point position of the convolution kernel with the median of the surrounding eight points, so that the median processing is used for removing the outlier in the map constructed by the unmanned aerial vehicle.
3. The method for discovering road key locations based on skeletonized pictures as claimed in claim 1, wherein: in step 102, the image binarization method comprises the following steps: setting the mode value in the map M1 as x1, and performing binarization operation by traversing all points in the image M1, if the value of a point is greater than x1, setting the value of the point as 1, and setting the value of the point as 0 if the value of the point is less than x1, where 0 is an impassable area, i.e., an obstacle, and 1 is a passable area, i.e., a road, and finally obtaining a binarized image MASK 1.
4. The method for discovering road key locations based on skeletonized pictures as claimed in claim 1, wherein: in step 103, the input image contour with a certain width is subjected to a method of successively removing edges until the width becomes a skeleton of only one pixel.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010912073.3A CN112164110B (en) | 2020-09-02 | 2020-09-02 | Method for discovering road key positions based on skeletonized pictures |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010912073.3A CN112164110B (en) | 2020-09-02 | 2020-09-02 | Method for discovering road key positions based on skeletonized pictures |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112164110A CN112164110A (en) | 2021-01-01 |
CN112164110B true CN112164110B (en) | 2022-05-31 |
Family
ID=73857558
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010912073.3A Active CN112164110B (en) | 2020-09-02 | 2020-09-02 | Method for discovering road key positions based on skeletonized pictures |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112164110B (en) |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5208842B2 (en) * | 2009-04-20 | 2013-06-12 | 株式会社カプコン | GAME SYSTEM, GAME CONTROL METHOD, PROGRAM, AND COMPUTER-READABLE RECORDING MEDIUM CONTAINING THE PROGRAM |
CN106139593B (en) * | 2016-06-23 | 2019-02-05 | 腾讯科技(深圳)有限公司 | A kind of game data processing method and game client |
CN110517334B (en) * | 2018-05-21 | 2023-06-23 | 北京四维图新科技股份有限公司 | Vector map data acquisition method and device |
CN109063270B (en) * | 2018-07-10 | 2022-11-11 | 北京华如科技股份有限公司 | Ground polymerization entity direct aiming shooting damage judging method and storage medium |
CN109948477B (en) * | 2019-03-06 | 2022-05-13 | 东南大学 | Method for extracting road network topology points in picture |
JP6811513B2 (en) * | 2019-12-20 | 2021-01-13 | 株式会社セガ | Program and game equipment |
-
2020
- 2020-09-02 CN CN202010912073.3A patent/CN112164110B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN112164110A (en) | 2021-01-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107045629B (en) | Multi-lane line detection method | |
JP6259928B2 (en) | Lane data processing method, apparatus, storage medium and equipment | |
CN109859226B (en) | Detection method of checkerboard corner sub-pixels for graph segmentation | |
CN104778679B (en) | A kind of control point pel fast matching method based on high score No.1 satellite data | |
CN110390306B (en) | Method for detecting right-angle parking space, vehicle and computer readable storage medium | |
CN110502983B (en) | Method and device for detecting obstacles in expressway and computer equipment | |
CN107784669A (en) | A kind of method that hot spot extraction and its barycenter determine | |
WO2022188663A1 (en) | Target detection method and apparatus | |
CN112200171B (en) | Road point cloud extraction method based on scanning lines | |
CN109559324A (en) | A kind of objective contour detection method in linear array images | |
CN115761550A (en) | Water surface target detection method based on laser radar point cloud and camera image fusion | |
CN110598541A (en) | Method and equipment for extracting road edge information | |
CN111222511B (en) | Infrared unmanned aerial vehicle target detection method and system | |
CN113780110A (en) | Method and device for detecting weak and small targets in image sequence in real time | |
KR101549155B1 (en) | Method of automatic extraction of building boundary from lidar data | |
CN111126211A (en) | Label identification method and device and electronic equipment | |
CN109766846B (en) | Video-based self-adaptive multi-lane traffic flow detection method and system | |
CN114463286A (en) | Road surface point cloud smoothing and crack information processing method based on moving window | |
CN112164110B (en) | Method for discovering road key positions based on skeletonized pictures | |
Raikar et al. | Automatic building detection from satellite images using internal gray variance and digital surface model | |
US11354794B2 (en) | Deposit detection device and deposit detection method | |
Tung et al. | Binarization of uneven-lighting image by maximizing boundary connectivity | |
CN106778822B (en) | Image straight line detection method based on funnel transformation | |
CN116128916B (en) | Infrared dim target enhancement method based on spatial energy flow contrast | |
Gupta et al. | Robust lane detection using multiple features |
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 |