A target search method
By converting the target image of the UAV into a grayscale image and calculating the variance to determine the target position, the problem of accurate landing of the UAV when RTK positioning fails is solved, and visually guided accurate landing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2026-03-06
AI Technical Summary
When drones lose their RTK positioning signal or are affected by local winds, they have difficulty landing accurately on the take-off and landing platform of the drone nest, and existing technologies cannot provide reliable visual guidance.
By acquiring a black-and-white interlocking circular image containing the target, converting it into a grayscale image and generating a two-dimensional array, the target's position in two-dimensional coordinates is determined using variance calculation, and then converted into the three-dimensional coordinate position of the UAV.
This technology enables drones to accurately identify target locations and land safely even when RTK positioning fails.
Smart Images

Figure CN115731481B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target recognition, and more specifically to a target search method. Background Technology
[0002] As the hardware support for automated drone inspection, the drone nest must ensure that the drone can land accurately on the take-off and landing platform of the nest every time. It is difficult to achieve reliability by simply relying on technologies such as GPS positioning and RTK differential positioning. Therefore, it is necessary to study related vision-based landing guidance technologies as a supplement to RTK differential positioning, so that the drone can also rely on vision to identify the target location even when the RTK positioning signal is lost or affected by local wind. Summary of the Invention
[0003] The purpose of this invention is to provide a target search method that can accurately identify target objects.
[0004] To achieve the above objectives, embodiments of the present invention provide a target search method, the target search method comprising:
[0005] Acquire an image containing a target, wherein the target is a series of black and white alternating rings, the center of the rings being black and its diameter being equal to the width of each black ring, and each white ring having an equal width.
[0006] Convert the image to grayscale;
[0007] Use 0 and 1 to represent black and white pixels in the grayscale image to convert the grayscale image into a two-dimensional array;
[0008] Obtain the width range of the grayscale image where 0 and 1 appear at equal intervals along the X-axis;
[0009] Obtain the length interval of the grayscale image where 0 and 1 appear at equal intervals along the Y-axis;
[0010] The region containing the width interval and the length interval is defined as the target.
[0011] Optionally, the two-dimensional array consists of 0s and 1s in different rows and columns.
[0012] Optionally, the widths of the black and white regions in the grayscale image are proportional to the number of pixels in the grayscale image, so that different numbers of 0 and 1 represent different widths of the black and white regions, thereby generating two-dimensional coordinates in the grayscale image.
[0013] Optionally, obtaining the width range of 0 and 1 appearing at equal intervals along the X-axis in the grayscale image includes:
[0014] Obtain the two-dimensional array;
[0015] Obtain all the black and white regions represented by 0 and 1 that appear in different rows of the two-dimensional array;
[0016] The equally spaced black areas in different rows are assigned values based on the number of pixels.
[0017] According to formula (1), obtain the average width of the black areas that appear at equal intervals in each row:
[0018]
[0019] Among them, l i Let l be the width of the area where black regions appear at equal intervals in each row, and l be the average width of the black regions in each row.
[0020] According to formula (2), obtain each l i degree of proximity:
[0021]
[0022] Where σ1 represents each l i The first variance;
[0023] Determine the magnitude of the first variance and the first preset threshold;
[0024] When the first variance is less than the first preset threshold, the location of the equally spaced black areas is determined to be the vertical coordinate of the target in the two-dimensional coordinate system.
[0025] Optionally, when the first variance is greater than the first preset threshold, it is determined that the row containing the equally spaced black areas is not the vertical coordinate of the target.
[0026] Optionally, obtaining the length interval of 0 and 1 appearing equally in the Y-axis direction of the grayscale image includes:
[0027] Obtain the two-dimensional array;
[0028] Obtain all the black and white regions represented by 0 and 1 that appear in different columns of the two-dimensional array;
[0029] The equally spaced black areas in different columns are assigned values based on the number of pixels.
[0030] According to formula (3), obtain the average width of the black areas that appear at equal intervals in each column:
[0031]
[0032] Where, d i The width of the area where black regions appear at equal intervals in each column. The average width of the black area in each column;
[0033] According to formula (4), each d is obtained. i degree of proximity:
[0034]
[0035] Where σ2 represents each d i The second variance;
[0036] Determine the magnitude of the second variance and the second preset threshold;
[0037] When the second variance is less than the second preset threshold, the column containing the equally spaced black areas is determined as the horizontal coordinate of the target in the two-dimensional coordinate system.
[0038] Optionally, defining the region containing the width interval and the length interval as the target includes:
[0039] Obtain the x-coordinate of the target in the two-dimensional coordinate system;
[0040] Obtain the ordinate of the target in the two-dimensional coordinate system;
[0041] The position of the target in the grayscale image is determined based on the target's horizontal and vertical coordinates in the two-dimensional coordinate system.
[0042] The position of the target in the grayscale image is converted into the position of the UAV in three-dimensional coordinates.
[0043] Optionally, when the second variance is greater than the second preset threshold, it is determined that the column containing the equally spaced black areas is not the horizontal coordinate of the target in the two-dimensional coordinate system.
[0044] Through the above technical solution, the target search method provided by this invention acquires an image containing a target and converts the image into a grayscale image. The target can be a series of black and white alternating rings, with the center of each ring being black and the diameter of the center being equal to the width of each black ring. The width of each white ring can also be equal. After converting the image into a grayscale image, 0 and 1 can be used to represent black and white in the grayscale image, thus converting the grayscale image into a two-dimensional array. After obtaining the two-dimensional array, the width region in the grayscale image where 0 and 1 are equally spaced along the X-axis can be searched, and then the length region where 0 and 1 are equally spaced along the Y-axis can be searched. Because the target is a series of black and white alternating rings, and the width of the center of each ring is equal to the width of each black ring, the area of the target in the grayscale image can be an area where 0 and 1 are equally spaced along both the X and Y axes. Therefore, the area containing the width and length regions can be defined as the target, thereby searching for the target in the image. Then, the position of the target in the image is converted into a world coordinate system to obtain the position of the target.
[0045] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0046] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings:
[0047] Figure 1 This is a flowchart of a target search method according to an embodiment of the present invention;
[0048] Figure 2 This is a flowchart illustrating the determination of the ordinate in a target search method according to an embodiment of the present invention;
[0049] Figure 3 This is a flowchart illustrating the determination of the horizontal coordinate in a target search method according to an embodiment of the present invention;
[0050] Figure 4 This is a flowchart illustrating the method for determining the target location according to an embodiment of the present invention;
[0051] Figure 5 This is a schematic diagram of a target search method according to an embodiment of the present invention;
[0052] Figure 6 This is a schematic diagram of the diameter of the target being intercepted in a target search method according to an embodiment of the present invention;
[0053] Figure 7 This is based on a target search method according to an embodiment of the present invention. Figure 6 A schematic diagram showing the diameter of the target in the middle, represented by 0 and 1. Detailed Implementation
[0054] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the scope of the present invention.
[0055] Figure 1 This is a flowchart of a target search method according to an embodiment of the present invention. In this invention, the target search method may include:
[0056] In step S1, an image containing the target is acquired, wherein the target is a series of black and white rings, the center of the rings is black and its diameter is equal to the width of each black ring, and the width of each white ring is equal.
[0057] In step S2, the image is converted to a grayscale image.
[0058] In step S3, 0 and 1 are used to represent black and white in the grayscale image to convert the grayscale image into a two-dimensional array.
[0059] In step S4, the width range of the grayscale image where 0 and 1 appear at equal intervals along the X-axis is obtained.
[0060] In step S5, the length intervals in the grayscale image where 0 and 1 appear at equal intervals along the Y-axis are obtained.
[0061] In step S6, the region containing the width interval and the length interval is defined as the target.
[0062] In this invention, when a drone loses signal due to external influences and is unable to accurately land on the takeoff and landing platform of the drone pod, the drone can determine the target based on visual target search and then perform a precise landing. When searching for the target, it is necessary to first acquire an image containing the target, which can be located anywhere in the image, such as... Figure 5As shown, the target can be a series of black and white alternating rings, with the center of each ring being black and its diameter equal to the width of each black ring. The widths of the white rings can be equal, ensuring that the target's features in the image are distinct from those of other objects. After acquiring an image containing the target, the image can be converted to a grayscale image. The numbers 0 and 1 can represent black and white pixels in the grayscale image, thus converting it into a two-dimensional array. This grayscale image can consist of 0s and 1s. When identifying the target, the width region of the grayscale image with equal intervals of 0s and 1s along the X-axis can be obtained, and then the length region with equal intervals of 0s and 1s along the Y-axis can be searched. Then, the area where the width and length regions overlap can be identified as the target region, thus enabling the target to be searched. This is because the target is a series of black and white interlaced rings, and the diameter of the center of each ring is equal to the width of the black ring. After converting the target into a graph represented by 0 and 1, the target can be searched from either the X-axis or the Y-axis, and the two sets of regions can overlap. Therefore, the area where the length and width regions are located can be identified as the target region.
[0063] In one embodiment of the present invention, the two-dimensional array can be composed of 0s and 1s in different rows and columns. When searching for 0s and 1s that appear in intervals, the search can be performed from the X-axis direction and Y-axis direction of the two-dimensional array, that is, the length direction and the width direction, respectively.
[0064] In one embodiment of the present invention, the widths of the black and white regions in the grayscale image can be proportional to the number of pixels in the grayscale image, thereby allowing different numbers of 0s and 1s to represent different widths, such as... Figure 6 and Figure 7 As shown, when a diameter is cut from the ring of the target, this diameter can appear with equal intervals of black and white, and different numbers of 0s and 1s can represent different widths of black and white areas. Because these different numbers of 0s and 1s can represent different widths of black and white areas, two-dimensional coordinates can be generated in this grayscale image. After determining the target in the grayscale image, the position of the target in the grayscale image can be determined using these two-dimensional coordinates.
[0065] In one embodiment of the present invention, such as Figure 2 As shown, obtaining the width of the region in the grayscale image that appears at equal intervals of 0 and 1 along the X-axis can include:
[0066] In step S7, a two-dimensional array is obtained.
[0067] In step S8, all black and white regions represented by 0 and 1 appearing in different rows of the two-dimensional array are obtained.
[0068] In step S9, the black areas that appear at equal intervals in different rows are assigned values based on the number of pixels.
[0069] In step S10, the average width of the equally spaced black regions in each row is obtained according to formula (1):
[0070]
[0071] Among them, l i The width of the area where black regions appear at equal intervals in each row. This represents the average width of the black area in each row.
[0072] In step S11, each l is obtained according to formula (2). i degree of proximity:
[0073]
[0074] Where σ1 represents each l i The first variance.
[0075] In step S12, the magnitude of the first variance and the first preset threshold are determined.
[0076] In step S13, when the first variance is less than the first preset threshold, the row containing the equally spaced black areas is determined as the vertical coordinate of the target in the two-dimensional coordinate system.
[0077] In this invention, when it is necessary to obtain equally spaced black and white regions along the X-axis in the grayscale image, a two-dimensional array composed of 0s and 1s can be obtained first. This two-dimensional array can be composed of 0s and 1s. After obtaining this two-dimensional array, the regions composed of equally spaced 0s and 1s can be searched row by row. Regions with 0s can represent black regions, and regions with 1s can represent white regions. Furthermore, different numbers of 0s and 1s can represent different widths of black and white regions. Figure 6 and Figure 7As shown, if the row containing the horizontal diameter of the target is found, black and white areas will appear at equal intervals. Then, the black areas appearing at equal intervals in different rows can be assigned a value based on the number of pixels. Since 0 and 1 in this two-dimensional array can represent black and white pixels in the grayscale image, and 0 can be proportional to the number of pixels, the width of the black area can be obtained by calculating the number of consecutive 0s. Then, the average width of the black areas appearing at equal intervals in each row can be obtained by formula (1). Then, the similarity of the width of each black area appearing at equal intervals can be obtained by formula (2). After obtaining the first variance, the first variance of this row can be compared with the first variance of the adjacent rows. The first variance passing through the center of the target is the smallest. This row can be the vertical coordinate of the center of the target. However, in target recognition, if the UAV is far away from the target, then at a greater distance... Since the widths of the black areas vary significantly, it's impossible to find the row containing the smallest first variance. Therefore, we can determine the magnitude of this first variance and a first preset threshold. When the first variance is less than the first preset threshold, the row containing that first variance can be identified as the vertical coordinate of the target in the two-dimensional coordinate system. The set of all rows containing first variances less than the first preset threshold can be considered the width region of the target.
[0078] When the first variance is greater than the first preset threshold, it indicates that the width of the black area is inconsistent and does not conform to the characteristics of the target in the grayscale image. Therefore, it can be determined that the row where the equally spaced black areas are located is not the vertical coordinate of the target, and the vertical coordinate of the row can be discarded.
[0079] In one embodiment of the present invention, such as Figure 3 As shown, obtaining the length region of the grayscale image that appears at equal intervals of 0 and 1 along the Y-axis can include:
[0080] In step S14, a two-dimensional array is obtained.
[0081] In step S15, all black and white areas represented by 0 and 1 appearing in different columns of the two-dimensional array are obtained.
[0082] In step S16, the black areas that appear at equal intervals in different columns are assigned values based on the number of pixels.
[0083] In step S17, the average width of the black areas that appear at equal intervals in each column is obtained according to formula (3):
[0084]
[0085] Where, d i The width of the area where black regions appear at equal intervals in each column. This represents the average width of the black area in each column.
[0086] In step S18, each d is obtained according to formula (4). i The degree of similarity.
[0087]
[0088] Where σ2 represents each d i The second variance.
[0089] In step S19, the magnitude of the second variance and the second preset threshold are determined.
[0090] In step S20, when the second variance is less than the second preset threshold, the column containing the equally spaced black areas is determined as the horizontal coordinate of the target in the two-dimensional coordinate system.
[0091] In this invention, when it is necessary to obtain equally spaced black and white regions from the Y-axis direction of the grayscale image, a two-dimensional array composed of 0s and 1s can be obtained first. Then, all black and white regions represented by 0s and 1s appearing in different columns of the two-dimensional array are obtained. Then, the black and white regions in different columns are assigned values based on the number of pixels, so that the black and white regions in each column have the same baseline width. Then, the average value of the equally spaced black regions in each column can be obtained according to formula (3). Then, the proximity between each equally spaced black region in each column can be obtained according to formula (4). This proximity can indicate whether the width of each black interval in each equally spaced black region in each column is consistent. Since the target is an equally spaced ring, when the width of each black region in an equally spaced black region in a column is consistent, it can indicate that the column can pass through the center of the target. However, in target recognition, if the UAV is far away from the target, then at a greater distance... The widths of the black areas vary considerably, making it impossible to find the row containing the smallest second variance. Therefore, we can determine the magnitude of the second variance of a column relative to a second preset threshold. When the second variance is less than the second preset threshold, it indicates that the column containing the equally spaced black areas can be the x-coordinate of the target in the two-dimensional coordinate system. The set of all columns containing second variances less than the second preset threshold can be the length region of the target.
[0092] In one embodiment of the present invention, such as Figure 4 As shown, the steps to determine the target area may include:
[0093] In step S21, the x-coordinate of the target in two-dimensional coordinates is obtained.
[0094] In step S22, the ordinate of the target in two-dimensional coordinates is obtained.
[0095] In step S23, the position of the target in the grayscale image is determined based on the target's horizontal and vertical coordinates in the two-dimensional coordinate system.
[0096] In step S24, the position of the target in the grayscale image is converted into the position of the UAV in three-dimensional coordinates.
[0097] In this invention, after identifying a target in an image, its position within the image can be determined. Therefore, the target's abscissa in a two-dimensional coordinate system can be obtained, followed by its ordinate in the same system. The target's position in the image can then be determined using both the abscissa and ordinate in the two-dimensional coordinate system. This position can then be converted to the drone's position in a three-dimensional coordinate system, thus obtaining the relative position between the target and the drone in the three-dimensional coordinate system. Based on this position, the drone can then accurately descend to the target's location.
[0098] In this invention, when the second variance is greater than the second preset threshold, it indicates that the width of the black area is inconsistent and does not conform to the characteristics of the target in the grayscale image. Therefore, it can be determined that the column where the equally spaced black areas are located is not the horizontal coordinate of the target, and the horizontal coordinate of the column can be discarded.
[0099] Through the above technical solution, the target search method provided by this invention acquires an image containing a target and converts the image into a grayscale image. The target can be a series of black and white alternating rings, with the center of each ring being black and the diameter of the center being equal to the width of each black ring. The width of each white ring can also be equal. After converting the image into a grayscale image, 0 and 1 can be used to represent black and white in the grayscale image, thus converting the grayscale image into a two-dimensional array. After obtaining the two-dimensional array, the width region in the grayscale image where 0 and 1 are equally spaced along the X-axis can be searched, and then the length region where 0 and 1 are equally spaced along the Y-axis can be searched. Because the target is a series of black and white alternating rings, and the width of the center of each ring is equal to the width of each black ring, the area of the target in the grayscale image can be an area where 0 and 1 are equally spaced along both the X and Y axes. Therefore, the area containing the width and length regions can be defined as the target, thereby searching for the target in the image. Then, the position of the target in the image is converted into a world coordinate system to obtain the position of the target.
[0100] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0101] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A target search method characterized by comprising: The target searching method comprises: acquiring an image containing a target, wherein the target is a series of black and white interval annular rings, the center of the annular ring is black and the diameter of the annular ring is equal to the width of each black annular ring, and the width of each white annular ring is equal; converting the image into a grayscale image; representing black and white pixels in the grayscale image by 0 and 1 to convert the grayscale image into a two-dimensional array; acquiring a width interval in which 0 and 1 appear at equal intervals in the X-axis direction of the grayscale image; acquiring a length interval in which 0 and 1 appear at equal intervals in the Y-axis direction of the grayscale image; defining a region in which the width interval and the length interval are as the target; the two-dimensional array is composed of 0 and 1 in different rows and different columns; the width of the black and white regions in the grayscale image is in a preset proportion to the number of pixel points in the grayscale image, so that different numbers of 0 and 1 represent different black region widths and white region widths, and two-dimensional coordinates are generated in the grayscale image; acquiring the width interval in which 0 and 1 appear at equal intervals in the X-axis direction of the grayscale image comprises: acquiring the two-dimensional array; acquiring all black and white regions represented by 0 and 1 appearing in different rows of the two-dimensional array; assigning values to the black regions appearing at equal intervals in different rows based on the number of pixel points; acquiring the average value of the width of the black regions appearing at equal intervals in each row according to formula (1): (1), wherein the average width of the black regions for each row, the average width of the black regions for each row; The closeness of each of the is obtained according to formula (2) (2), wherein denotes the first variance of each of the first variance; judging the size of the first variance and the first preset threshold value; when the first variance is less than the first preset threshold value, determining that the row in which the black regions appearing at equal intervals are located is the vertical coordinate of the target in the two-dimensional coordinates.
2. The object search method according to claim 1, characterized by, when the first variance is greater than the first preset threshold value, determining that the row in which the black regions appearing at equal intervals are located is not the vertical coordinate of the target.
3. The object search method according to claim 1, characterized by, acquiring the length interval in which 0 and 1 appear at equal intervals in the Y-axis direction of the grayscale image comprises: acquiring the two-dimensional array; acquiring all black and white regions represented by 0 and 1 appearing in different columns of the two-dimensional array; assigning values to the black regions appearing at equal intervals in different columns based on the number of pixel points; acquiring the average value of the width of the black regions appearing at equal intervals in each column according to formula (3): (3), wherein the average width of the black regions for each column, the average width of the black regions for each column, The closeness of each of the is obtained according to formula (4) (4), wherein represents each of the second variance of judging the size of the second variance and the second preset threshold value; when the second variance is less than the second preset threshold value, determining that the column in which the black regions appearing at equal intervals are located is the horizontal coordinate of the target in the two-dimensional coordinates.
4. The object search method according to claim 3, characterized by, defining the region in which the width interval and the length interval are as the target comprises: acquiring the horizontal coordinate of the target in the two-dimensional coordinates; acquiring the vertical coordinate of the target in the two-dimensional coordinates; determining the position of the target in the grayscale image according to the horizontal coordinate and the vertical coordinate of the target in the two-dimensional coordinates; converting the position of the target in the grayscale image into a position in the three-dimensional coordinates of the unmanned aerial vehicle.
5. The object search method according to claim 3, characterized by, when the second variance is greater than the second preset threshold value, determining that the column in which the black regions appearing at equal intervals are located is not the horizontal coordinate of the target in the two-dimensional coordinates.
Citation Information
Patent Citations
Paper money version identification method and device
CN106780967A