A decoding method, an aircraft, and a storage medium

By performing grid division and relative brightness decoding on beacon images, the problem of decoding accuracy caused by beacon occlusion by shadows was solved, thus improving the accuracy of aircraft landing.

CN116309624BActive Publication Date: 2026-01-30BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111569593.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-21
Publication Date
2026-01-30
Estimated Expiration
2041-12-21

AI Technical Summary

Technical Problem

In existing technologies, when a beacon is obscured by a shadow, the image decoding accuracy is low, leading to errors in the decoding results during the aircraft's descent.

Method used

By dividing the target image containing beacons into M*N grids, obtaining the average pixel value of each grid, and using the relative brightness relationship between grids for decoding, a propagation method is adopted to reduce shadow occlusion interference and improve decoding accuracy.

Benefits of technology

It effectively reduces the interference of shadow occlusion on the beacon decoding process, improves the accuracy of image decoding containing beacons, and ensures the accuracy of aircraft landing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116309624B_ABST
    Figure CN116309624B_ABST
Patent Text Reader

Abstract

This application discloses a decoding method, an aircraft, and a storage medium, which can improve the decoding accuracy of images containing beacons when the beacon is occluded by shadows. The decoding method includes: acquiring an image containing the beacon and dividing the image into M*N grids; acquiring the average pixel value of the pixels contained in each of the M*N grids; designating any grid in the image as a first reference grid; determining the decoding result of the first decoding grid based on the decoding result of the first reference grid and the relative magnitude of the average pixel values ​​of the first decoding grid adjacent to the first reference grid in the target direction; using the first decoding grid as a second reference grid; determining the decoding result of the second decoding grid based on the decoding result of the second reference grid and the relative magnitude of the average pixel values ​​of the second decoding grid adjacent to the second reference grid in the target direction; and obtaining the decoding results of each grid in the image.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of image processing, and particularly relate to a decoding method, an aircraft and a storage medium.

BACKGROUND

[0002] At present, an aircraft usually takes a beacon as a landing reference in a landing stage, that is, an image containing a beacon is collected, and then the image is decoded to realize detection of the beacon in the image.

SUMMARY

[0003] Embodiments of the present application disclose a decoding method, an aircraft and a storage medium, which can improve decoding accuracy of an image containing a beacon when the beacon is blocked by a shadow.

[0004] In a first aspect, an embodiment of the present application provides a decoding method, which is applied to an aircraft, and the method comprises:

[0005] obtaining a target image containing a beacon, and dividing the target image into M*N grids, the beacon being used to indicate landing of the aircraft, and M and N are both positive integers not less than 1;

[0006] obtaining average pixel values of pixel points contained in each grid of the M*N grids;

[0007] specifying any grid of the target image as a first reference grid, determining a decoding result of a first target decoding grid adjacent to the first reference grid in a target direction based on a relative size relationship between the decoding result of the first reference grid and the average pixel value of the first reference grid, taking the first target decoding grid as a second reference grid, determining a decoding result of a second target decoding grid adjacent to the second reference grid in the target direction based on a relative size relationship between the decoding result of the second reference grid and the average pixel value of the second reference grid, and iteratively obtaining decoding results of grids in the target image.

[0008] In the embodiments of the present application, the aircraft can acquire a target image containing a beacon, then divide the target image into M*N grids, and calculate the average pixel value of the pixel points contained in each grid in the M*N grids. Then any grid in the target image is designated as a first reference grid, and it can be considered that the decoding result of the designated first reference grid is known. Then based on the decoding result of the first reference grid, and the relative size relationship between the average pixel value of the first target decoding grid adjacent to the first reference grid in the target direction and the first reference grid, the decoding result of the first target decoding grid can be determined. Then the first target decoding grid is continuously taken as a second reference grid, based on the decoding result of the second reference grid, and the relative size relationship between the average pixel value of the second target decoding grid adjacent to the second reference grid in the same target direction and the second reference grid, the decoding result of the second target decoding grid can be determined. In this way, the decoding results of each grid in the entire target image are finally obtained. In this method, the target image containing the beacon is divided into grids, and the context information between the grids is used to complete the decoding of each grid in the entire target image in a propagation manner in the target direction, so that the interference of shadow blocking on the beacon decoding process can be reduced, and the decoding accuracy of the image containing the beacon can be improved.

[0009] Optionally, the target image includes a background region and a foreground region representing the beacon, and determining the decoding result of the first target decoding grid based on the decoding result of the first reference grid and the relative size relationship between the average pixel value of the first target decoding grid adjacent to the first reference grid in the target direction and the first reference grid includes:

[0010] If the decoding result of the first reference grid represents the background region, and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is greater than a first set threshold, the first target decoding grid is decoded to represent the foreground region.

[0011] In the embodiments of the present application, if the decoding result of the first reference grid represents the background region, if the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is greater than a first set threshold, it can be considered that the average brightness value of the first target decoding grid is greatly different from the background region. At this time, the first target decoding grid should be decoded to represent the foreground region, so as to avoid that the first target decoding grid is misdecoded to represent the background region due to the decrease of the brightness value caused by being blocked by the shadow.

[0012] Optionally, the method further includes:

[0013] If the decoding result of the first reference grid represents the background region, and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is less than a second set threshold, the first target decoding grid is decoded to represent the background region.

[0014] In the embodiments of the present application, if the decoding result of the first reference grid represents the background region, if the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is less than a second set threshold, it can be considered that the average brightness value of the first target decoding grid is close to the background region, and the first target decoding grid should be decoded to represent the foreground region, so as to avoid that the first target decoding grid is decoded to represent the foreground region due to a small amount of white region.

[0015] Optionally, the method further comprises:

[0016] If the decoding result of the first reference grid represents the foreground region, and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is greater than a third set threshold, the first target decoding grid is decoded to represent the background region.

[0017] In the embodiments of the present application, if the decoding result of the first reference grid represents the foreground region, if the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is greater than a third set threshold, it can be considered that the average brightness value of the first target decoding grid is greatly different from the foreground region, and the first target decoding grid should be decoded to represent the background region, so as to avoid that the first target decoding grid is decoded to represent the foreground region due to a small amount of white region.

[0018] Optionally, the method further comprises:

[0019] If the decoding result of the first reference grid represents the foreground region, and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is less than a fourth set threshold, the first target decoding grid is decoded to represent the foreground region.

[0020] In the embodiments of the present application, if the decoding result of the first reference grid represents a foreground region, and if the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is less than the fourth preset threshold, it can be considered that the average brightness value of the first target decoding grid is relatively close to the foreground region, and the first target decoding grid should be decoded to represent the foreground region at this time, thereby avoiding the first target decoding grid from being misdecoded to represent the background region due to the possible brightness value reduction caused by being blocked by a shadow.

[0021] Optionally, dividing the target image into M*N grids comprises:

[0022] Dividing the target image into the M*N grids based on a preset step length, wherein the M*N grids comprise an outer ring region and an inner ring region, the outer ring region does not include the beacon, and a boundary of the outer ring region away from the inner ring region is spaced apart from a boundary of the inner ring region adjacent to the outer ring region by at least one preset step length;

[0023] Before designating any grid of the target image as a first reference grid, the method further comprises:

[0024] Decoding each grid in the outer ring region to represent a background region;

[0025] The designation of any grid of the target image as a first reference grid comprises:

[0026] Determining any grid of the outer ring region as the first reference grid.

[0027] In the embodiments of the present application, the M*N grids divided from the target image comprise an outer ring region and an inner ring region, and the outer ring region does not include the beacon, so each grid in the outer ring region can be directly decoded to represent a background region, and then any grid in the outer ring region is taken as a first reference grid, thereby ensuring the accuracy of the subsequent decoding result.

[0028] Optionally, when the target direction is at least two target directions determined based on any endpoint on any diagonal line of the inner ring region as an origin, obtaining the decoding result of the target image comprises:

[0029] Performing first fusion processing on the decoding results of the same target decoding grid in the inner ring region in each target direction of the at least two target directions, to obtain the decoding result of each target decoding grid in the inner ring region.

[0030] In the embodiments of the present application, the decoding of the same target decoding grid in each of the at least two target directions can be subjected to a first fusion processing based on the same origin, i.e., the decoding results of different target directions starting from the same origin are combined, so that the decoding results of each target grid in the inner ring region can be more accurately obtained.

[0031] Optionally, when the decoding result of any target decoding grid represents the background region as binary 0 and the decoding result of any target decoding grid represents the foreground region as binary 1, the first fusion processing is an OR operation.

[0032] In the embodiments of the present application, when the decoding result of any target decoding grid in the inner ring region represents the background region as binary 0 and the decoding result of any target decoding grid represents the foreground region as binary 1, the first fusion processing can be an OR operation, so that the decoding result error of a target direction does not lead to the decoding result error of the target decoding grid.

[0033] Optionally, the two endpoints on any diagonal line of the inner ring region are taken as a first origin and a second origin, the target directions are at least four target directions determined based on the first origin and the second origin, and the target directions of the first origin and the target directions of the second origin form opposite relationships two by two, and obtaining the decoding results of each grid in the target image comprises:

[0034] The decoding results of the same target decoding grid in the inner ring region in each of the two target directions located at the first origin and the second origin and having opposite relationships are subjected to a second fusion processing, respectively, to obtain at least two groups of intermediate decoding results of each target decoding grid in the inner ring region.

[0035] The intermediate decoding results of the same target decoding grid in the at least two groups of intermediate decoding results are subjected to a third fusion processing to obtain the decoding results of each target decoding grid in the inner ring region.

[0036] In the embodiments of the present application, when the inner ring region is decoded from at least four target directions determined by any two end points on a diagonal line of the inner ring region as a first original point and a second original point, respectively, the decoding results of the same target decoding grid in the inner ring region in each of the two target directions located at the first original point and the second original point and opposite to each other can be subjected to a second fusion processing, so as to obtain intermediate decoding results of each target decoding grid in the at least two groups of inner ring regions. Then, the intermediate decoding results of the same target decoding grid in the at least two groups of intermediate decoding results are subjected to a third fusion processing, that is, the decoding results in different target directions starting from different original points are combined, so that the decoding results of each target grid in the inner ring region can be more accurately obtained.

[0037] Optionally, when the decoding result of any target decoding grid is represented as binary 0 when the decoding result represents the background region, and is represented as binary 1 when the decoding result represents the foreground region, the second fusion processing is an AND operation, and the third fusion processing is an OR operation.

[0038] In the embodiments of the present application, when the decoding result of any target decoding grid is represented as binary 0 when the decoding result represents the background region, and is represented as binary 1 when the decoding result represents the foreground region, an AND operation is adopted for the same target decoding grid in different target directions based on different original points but opposite to each other when the second fusion processing is performed, so as to ensure the consistency of the decoding results of the same target decoding grid in opposite directions; on this basis, an OR operation is adopted for the intermediate decoding results of the same target decoding grid when the third fusion processing is performed, so as to avoid the decoding result error of the target decoding grid caused by the error of a certain intermediate decoding result.

[0039] In a second aspect, the embodiments of the present application provide a flying vehicle, which comprises:

[0040] A first acquisition unit is configured to acquire a target image containing a beacon and divide the target image into M*N grids, the beacon is used to indicate the landing of the flying vehicle, and M and N are both positive integers not less than 1;

[0041] A second acquisition unit is configured to acquire the average pixel value of the pixel points contained in each grid of the M*N grids;

[0042] A first decoding unit is configured to specify any grid of the target image as a first reference grid, determine the decoding result of a first target decoding grid adjacent to the first reference grid in a target direction based on the decoding result of the first reference grid and the relative size relationship between the average pixel value of the first reference grid and the first target decoding grid, and determine the decoding result of the first target decoding grid.

[0043] a second decoding unit configured to take the first target decoding grid as a second reference grid, determine a decoding result of a second target decoding grid adjacent to the second reference grid in the target direction based on the decoding result of the second reference grid and a relative size relationship between the average pixel value of the second target decoding grid and the average pixel value of the second reference grid, and in this way obtain the decoding result of each grid in the target image.

[0044] Optionally, the target image comprises a background region and a foreground region representing the beacon, and the first decoding unit comprises:

[0045] a first decoding subunit configured to, if the decoding result of the first reference grid represents the background region and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is greater than a first preset threshold, decode the first target decoding grid as representing the foreground region.

[0046] Optionally, the first decoding subunit is further configured to:

[0047] if the decoding result of the first reference grid represents the background region and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is less than a second preset threshold, decode the first target decoding grid as representing the background region.

[0048] Optionally, the first decoding subunit is further configured to:

[0049] if the decoding result of the first reference grid represents the foreground region and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is greater than a third preset threshold, decode the first target decoding grid as representing the background region.

[0050] Optionally, the first decoding subunit is further configured to:

[0051] if the decoding result of the first reference grid represents the foreground region and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is less than a fourth preset threshold, decode the first target decoding grid as representing the foreground region.

[0052] Optionally, the first obtaining unit comprises:

[0053] The target image is divided into the M*N grids based on a preset step length, wherein the M*N grids include an outer ring area and an inner ring area, the outer ring area does not include the beacon, and a boundary of the outer ring area away from the inner ring area is spaced apart from a boundary of the inner ring area adjacent to the outer ring area by at least one preset step length;

[0054] The aircraft further includes:

[0055] The third decoding unit is configured to decode each grid in the outer ring area as a background area;

[0056] The first decoding unit further includes:

[0057] The specifying sub-unit is configured to specify any grid in the outer ring area as the first reference grid.

[0058] Optionally, when the target direction is at least two target directions determined based on any endpoint on any diagonal line of the inner ring area as an origin, the second decoding unit includes:

[0059] The first obtaining sub-unit is configured to perform first fusion processing on decoding results of the same target decoding grid in the inner ring area in each target direction of the at least two target directions, to obtain the decoding result of each target decoding grid in the inner ring area.

[0060] Optionally, when the decoding result of any target decoding grid is represented as binary 0 when the decoding result of any target decoding grid is represented as the background area, and the decoding result of any target decoding grid is represented as binary 1 when the decoding result of any target decoding grid is represented as the foreground area, the first fusion processing is an or operation.

[0061] Optionally, when the target direction is at least four target directions determined based on two endpoints on any diagonal line of the inner ring area as a first origin and a second origin, and the target direction of the first origin and the target direction of the second origin form an opposite relationship with each other, the second decoding unit includes:

[0062] The second obtaining sub-unit is configured to perform second fusion processing on decoding results of the same target decoding grid in the inner ring area in each target direction of two target directions located at the first origin and the second origin and having an opposite relationship with each other, to obtain at least two groups of intermediate decoding results of each target decoding grid in the inner ring area.

[0063] The third obtaining sub-unit is configured to perform third fusion processing on intermediate decoding results of the same target decoding grid in the at least two groups of intermediate decoding results, to obtain the decoding result of each target decoding grid in the inner ring area.

[0064] Optionally, when the decoding result of any target decoding grid represents the background region as binary 0 and the decoding result of any target decoding grid represents the foreground region as binary 1, the second fusion processing is an and operation and the third fusion processing is an or operation.

[0065] In a third aspect, an embodiment of the present application provides a flying vehicle, comprising a processor and a memory, wherein the processor is configured to implement the steps of the method according to any embodiment of the first aspect when executing a computer program stored in the memory.

[0066] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, wherein the computer program is configured to implement the steps of the method according to any embodiment of the first aspect when executed by a processor.

[0067] It should be understood that the second to fourth aspects of the embodiments of the present application are consistent with the technical solutions of the first aspect of the embodiments of the present application, and the beneficial effects obtained by each aspect and the corresponding feasible implementation manners are similar, which will not be described in detail. BRIEF DESCRIPTION OF DRAWINGS

[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0069] Figure 1 A schematic diagram of a beacon provided by an embodiment of the present application;

[0070] Figure 2 A schematic diagram of a decoded beacon provided by an embodiment of the present application;

[0071] Figure 3 A schematic diagram of a beacon blocked by a shadow provided by an embodiment of the present application;

[0072] Figure 4 A schematic diagram of a decoded beacon when a beacon is blocked by a shadow provided by an embodiment of the present application;

[0073] Figure 5 A flowchart of a decoding method provided by an embodiment of the present application;

[0074] Figure 6 A schematic diagram of a target image divided into M*N grids provided by an embodiment of the present application;

[0075] Figure 7 A schematic diagram of a decoding mechanism provided by an embodiment of the present application;

[0076] Figure 8 A schematic diagram illustrating a decoding mechanism provided in an embodiment of this application;

[0077] Figure 9 This is a schematic diagram illustrating decoding from multiple target directions based on different origins on the diagonal, as provided in an embodiment of this application.

[0078] Figure 10 A schematic diagram of the structure of an aircraft provided in this application embodiment;

[0079] Figure 11 This is a schematic diagram of the structure of an aircraft provided in an embodiment of this application.

Detailed Implementation Methods

[0080] To better understand the technical solutions in this specification, the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0081] It should be understood that the described embodiments are merely some, not all, of the embodiments in this specification. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without inventive effort are within the scope of protection of this specification.

[0082] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0083] Please see Figure 1 and Figure 2 , Figure 1 This is a schematic diagram of a beacon provided in an embodiment of this application. Figure 2 This is a schematic diagram of a decoded beacon provided in an embodiment of this application. Currently, aircraft typically rely on ground-based beacons as a landing reference during the landing phase. This involves acquiring images containing ground beacons, decoding these images to detect the beacons, and then using the detected beacons to guide the aircraft's landing.

[0084] The inventors of the present application have found that in the prior art, a threshold is sought to maximize the variance of the foreground region and the background region in the image containing the beacon, so as to separate the foreground region and the background region, and then decode the foreground region and the background region respectively. For example, the foreground region is decoded as binary 1, and the background region is decoded as binary 0; or the foreground region is decoded as binary 0, and the background region is decoded as binary 1, which is not particularly limited here. However, if the position of the beacon is affected by the external environment, for example, please refer to Figure 3 , the beacon is easily blocked by the shadow of surrounding buildings or trees, so please refer to Figure 4 , the existing decoding method will misjudge the foreground region as the background region when separating the foreground region and the background region, resulting in errors in the decoding result, that is, the existing decoding method has a low decoding success rate when the beacon is blocked by the shadow.

[0085] In view of this, the embodiments of the present application provide a decoding method, in which the target image containing the beacon is divided into grids, and the decoding of each grid in the target image is completed in a propagation manner in the target direction by using the context information between the grids, so as to reduce the interference of the shadow blocking on the decoding process of the beacon, thereby improving the decoding accuracy of the image containing the beacon.

[0086] The technical solutions provided by the embodiments of the present application will be described below with reference to the accompanying drawings. Please refer to Figure 5 , the embodiments of the present application provide a decoding method, which is applied to an aircraft, which can be a drone or an unmanned airship, and the type of the aircraft is not particularly limited here, and the flow of the method is described as follows:

[0087] Step 101: The aircraft acquires a target image containing a beacon, and divides the target image into M*N grids, the beacon is used to indicate the landing of the aircraft, and M and N are both positive integers not less than 1.

[0088] When the aircraft enters the landing stage, it periodically acquires a target image containing a beacon based on the image acquisition device configured by itself, and then assists itself to land based on the beacon detected by the target image. Here, the beacon can be considered as a reference benchmark for providing the aircraft with a corresponding reference during the landing of the aircraft. Before the aircraft detects and identifies the beacon in the target image, the target image containing the beacon needs to be decoded first.

[0089] Please continue to refer to Figure 3, considering that part of the beacon can be blocked by the shadow, on the one hand, the brightness value of the part of the beacon blocked by the shadow is reduced to a certain extent compared with that when not blocked by the shadow; on the other hand, the brightness value of the part of the beacon blocked by the shadow is still higher than that of the background region. Therefore, in the embodiment of the application, in order to improve the decoding accuracy of the image containing the beacon when the beacon is blocked by the shadow, the relative brightness between local regions can be used as a decoding reference. Before that, the target image containing the beacon needs to be divided into multiple sub-regions in order to utilize the relative brightness information between adjacent sub-regions.

[0090] As a possible implementation, please refer to Figure 6 , the aircraft can divide the target image containing the beacon into M*N grids, where M and N are both positive integers not less than 1. It should be understood that M and N can be the same or different, which can be set according to actual conditions, and no special limitation is made here.

[0091] Step 102: obtaining the average pixel value of the pixel points contained in each grid in the M*N grids.

[0092] In the embodiment of the application, after the aircraft divides the target image containing the beacon into M*N, in order to utilize the relative brightness information between the grids for decoding, the brightness value of each grid needs to be obtained.

[0093] As a possible implementation, the aircraft can obtain the average pixel value of the pixel points contained in each grid in the M*N grids. For example, the integral graph method can be used to obtain the average pixel value of the pixel points contained in each grid, and of course other methods can also be used, and no special limitation is made here.

[0094] It should be understood that the target image includes a plurality of pixel points, and when the target image is divided into M*N grids, each grid also includes a plurality of pixel points, so the average pixel value of the plurality of pixel points contained in each grid can be used to represent the brightness value of the grid.

[0095] Step 103: specifying any grid of the target image as a first reference grid, determining the decoding result of a first target decoding grid adjacent to the first reference grid in the target direction based on the relative size relationship between the average pixel value of the first target decoding grid and the first reference grid and the decoding result of the first reference grid.

[0096] In the embodiment of the application, after obtaining the average pixel value of each grid, the relative brightness between the grids can be used as a reference to decode each grid, which is conducive to reducing the interference of the shadow blocking on the beacon decoding process, thereby improving the decoding accuracy of the image containing the beacon.

[0097] As a possible implementation, the aerial vehicle can specify any grid in the target image as the first reference grid, and it can be considered that the decoding result of the specified first reference grid is known. Then, based on the decoding result of the first reference grid and the relative size relationship between the average pixel value of the first target decoding grid adjacent to the first reference grid in the target direction and the first reference grid, the decoding result of the first target decoding grid can be determined.

[0098] For example, referring to Figure 7 , the aerial vehicle can specify the top-left grid in the target image as the first reference grid. When the target direction is target direction 1, the decoding result of the first target decoding grid 1 adjacent to the first reference grid in the target direction 1 can be determined based on the decoding result of the first reference grid and the relative size relationship between the average pixel value of the first target decoding grid 1 and the first reference grid. When the target direction is target direction 2, the decoding result of the second target decoding grid 2 adjacent to the first reference grid in the target direction 2 can be determined based on the decoding result of the first reference grid and the relative size relationship between the average pixel value of the second target decoding grid 2 and the first reference grid. It should be understood that the target direction here can be any direction with the first reference grid as the starting point, and the target direction is not particularly limited here.

[0099] The target image can be considered to include a background region and a foreground region representing a beacon. The following describes how to obtain the decoding result of the first target decoding grid based on the decoding result of the first reference grid and the relative size relationship between the average pixel value of the first reference grid and the first target decoding grid. The following describes the decoding mechanism with the target direction being target direction 1 as an example.

[0100] Case 1: The decoding result of the first reference grid represents a background region, and the average pixel value of the first reference grid and the first target decoding grid is greatly different.

[0101] In the embodiment of the present application, if the decoding result of the first reference grid represents a background region, it means that the first reference grid does not contain beacon information. At this time, if the absolute value of the difference between the average pixel value corresponding to the first target decoding grid 1 and the average pixel value corresponding to the first reference grid is greater than a first set threshold, it can be considered that the average brightness value of the first target decoding grid is greatly different from the background region. At this time, the first target decoding grid should be decoded to represent a foreground region, that is, it is considered that the first target decoding grid contains more beacon information, so as to avoid that the first target decoding grid is misdecoded to represent a background region due to the possibility of being blocked by a shadow and the brightness value being reduced.

[0102] Case 2: The decoding result of the first reference grid represents a background region, and the average pixel value of the first reference grid and the first target decoding grid is not greatly different.

[0103] In the embodiment of the present application, if the decoding result of the first reference grid represents a background region, it means that the first reference grid does not contain beacon information. At this time, if the absolute value of the difference between the average pixel value corresponding to the first target decoding grid 1 and the average pixel value corresponding to the first reference grid is less than the second set threshold, it can be considered that the average brightness value of the first target decoding grid 1 is relatively close to the background region. At this time, the first target decoding grid 1 should be decoded to represent a background region, that is, it is considered that the first target decoding grid 1 does not contain beacon information, thereby avoiding the possibility that the first target decoding grid 1 is misdecoded to represent a foreground region due to the existence of a small amount of beacon information, which makes the average brightness value of the first target decoding grid 1 higher than that of the background region.

[0104] Case 3: The decoding result of the first reference grid represents a foreground region, and the average pixel value of the first reference grid and the first target decoding grid is greatly different.

[0105] In the embodiment of the present application, if the decoding result of the first reference grid represents a foreground region, it means that the first reference grid contains beacon information. At this time, if the absolute value of the difference between the average pixel value corresponding to the first target decoding grid 1 and the average pixel value corresponding to the first reference grid is greater than the third set threshold, it can be considered that the average brightness value of the first target decoding grid 1 is greatly different from the foreground region. At this time, the first target decoding grid 1 should be decoded to represent a background region, that is, it is considered that the first target decoding grid 1 does not contain beacon information, thereby avoiding the possibility that the first target decoding grid 1 is misdecoded to represent a foreground region due to the existence of a small amount of beacon information, which makes the average brightness value of the first target decoding grid 1 higher than that of the black region.

[0106] Case 4: The decoding result of the first reference grid represents a foreground region, and the average pixel value of the first reference grid and the first target decoding grid 1 is small.

[0107] In the embodiment of the present application, if the decoding result of the first reference grid represents a foreground region, it means that the first reference grid contains beacon information. At this time, if the absolute value of the difference between the average pixel value corresponding to the first target decoding grid 1 and the average pixel value corresponding to the first reference grid is less than the fourth set threshold, it can be considered that the average brightness value of the first target decoding grid 1 is relatively close to the foreground region. At this time, the first target decoding grid 1 should be decoded to represent a foreground region, that is, it is considered that the first target decoding grid 1 contains beacon, thereby avoiding the possibility that the first target decoding grid 1 is misdecoded to represent a background region due to being blocked by a shadow, which causes the brightness value to decrease.

[0108] It should be understood that the first set threshold, the second set threshold, the third set threshold and the fourth set threshold described above can be set according to actual conditions, which are not particularly limited here.

[0109] Step 104: taking the first target decoding grid as the second reference grid, determining the decoding result of the second target decoding grid based on the decoding result of the second reference grid and the relative size relationship between the average pixel value of the second target decoding grid and the second reference grid adjacent to the second reference grid in the target direction, and iteratively obtaining the decoding result of each grid in the target image.

[0110] In the embodiments of the present application, after obtaining the decoding result of the first target decoding grid, the decoding of other target decoding grids can be continued based on the decoding result of the first target decoding grid.

[0111] As a possible implementation, the aerial vehicle can take the first target decoding grid as the second reference grid, determine the decoding result of the second target decoding grid based on the decoding result of the second reference grid and the relative size relationship between the average pixel value of the second target decoding grid and the second reference grid adjacent to the second reference grid in the target direction, and then iteratively obtain the decoding result of each grid in the target image.

[0112] For example, please continue to refer to Figure 7 , when the target direction is target direction 1, after obtaining the decoding result of the first target decoding grid 1, the first target decoding grid 1 can be taken as the second reference grid, and then the decoding result of the second target decoding grid 1 can be determined based on the decoding result of the first target decoding grid 1 and the relative size relationship between the average pixel value of the second target decoding grid 1 adjacent to the first target decoding grid 1 in the target direction 1; or when the target direction is target direction 2, after obtaining the decoding result of the first target decoding grid 2, the first target decoding grid 2 can be taken as the second reference grid, and then the decoding result of the second target decoding grid 2 can be determined based on the decoding result of the first target decoding grid 2 and the relative size relationship between the average pixel value of the second target decoding grid 2 adjacent to the first target decoding grid 2 in the target direction 2.

[0113] In the embodiments of the present application, how to obtain the decoding result of the second target decoding grid based on the decoding result of the second reference grid and the relative size relationship between the average pixel value of the second reference grid and the second target decoding grid can refer to the decoding mechanisms described in cases 1-4 in step 103, which will not be repeated here.

[0114] Please continue to refer to Figure 7 , considering that in the target image containing the beacon, the beacon is in the middle region of the target image, and there is always a certain width of background region at the edges of the target image. Therefore, in the embodiments of the present application, when selecting the first reference grid, the background region around the target image can be selected, so as to ensure the accuracy of the subsequent decoding result.

[0115] As a possible implementation, please refer to Figure 8 The aircraft divides the target image into M*N grids based on a preset step size, the M*N grids can include an outer ring region and an inner ring region, and the outer ring region does not include the beacon, so even if the outer ring region is also blocked by a shadow, it will not affect the decoding result of the beacon. Therefore, each grid in the outer ring region can be directly decoded as a background region, and then any grid in the outer ring region can be selected as a first reference grid. It should be understood that the above-mentioned outer ring region is spaced apart from the boundary between the inner ring region and the adjacent outer ring region of the inner ring region by at least one preset step size.

[0116] In the above embodiment, when decoding the target image, it is decoded in a propagation manner in the same target direction. In order to improve the accuracy of decoding, the embodiment of the application can be based on the same origin and start from at least two target directions according to the decoding mechanism described in cases 1-4 in step 103. That is, for the same target decoding grid, there are decoding results in at least two target directions. On this basis, the decoding results of the same target decoding grid in different target directions can be fused to obtain the final decoding result.

[0117] As a possible implementation, the aircraft can take any endpoint on a diagonal line in the inner ring region as the origin, and the target direction can be considered as at least two target directions determined based on the above-mentioned origin. After decoding the inner ring region from at least two target directions based on the above-mentioned origin, the aircraft can perform first fusion processing on the decoding results of the same target decoding grid in the inner ring region in at least two target directions, thereby obtaining the decoding results of each target decoding grid in the inner ring region.

[0118] For example, please continue to refer to Figure 8 From the origin O2, each target decoding grid in the inner ring region is decoded from target direction 1 and target direction 2. Then the decoding results of the same target decoding grid in the inner ring region in target direction 1 and target direction 2 can be first fused to obtain the decoding results of each target grid in the inner ring region.

[0119] It should be understood that when the decoding result of any target decoding grid is represented as a background region, it corresponds to binary 0, and when the decoding result of any target decoding grid is represented as a foreground region, it corresponds to binary 1, and the first fusion processing can be an or operation. The first fusion processing of the decoding results of the same target decoding grid in the inner ring region in target direction 1 and target direction 2 can be calculated based on formula (1):

[0120] R=R1|R2 (1)

[0121] Wherein, R represents the decoding result of any target decoding grid in target direction 1 and target direction 2 after the first fusion processing, R1 represents the decoding result of any target decoding grid in target direction 1, R2 represents the decoding result of any target decoding grid in target direction 2, and | represents OR operation (first fusion processing).

[0122] For example, if the decoding result of a target decoding grid in target direction 1 is a background region (in fact, the decoding result of the target decoding grid is a foreground region), and the decoding result of the target decoding grid in target direction 2 is a foreground region, then after the first fusion processing, the decoding result of the target decoding grid is binary 1 (representing a foreground region), avoiding the decoding result error of the target decoding grid caused by the decoding result error of a target direction.

[0123] In the embodiment of the present application, in order to improve the decoding accuracy, the inner ring region can also be decoded based on different origins from at least four target directions according to the decoding mechanism described in steps 1-4. That is, for the same target decoding grid, there are decoding results in at least four target directions, and on this basis, the decoding results of the same target decoding grid in different target directions can be fused to obtain the final decoding result.

[0124] As a possible implementation, the aircraft can take any two endpoints of the diagonal of the inner ring region as the first origin and the second origin, the target direction can be considered as at least four target directions determined based on the first origin and the second origin, and the target direction of the first origin and the target direction of the second origin form opposite relationship. After the aircraft decodes each target decoding grid in the inner ring region from the at least four target directions, the aircraft can respectively perform second fusion processing on the decoding results of the same target decoding grid in the two target directions opposite to each other and located at the first origin and the second origin, to obtain at least two groups of intermediate decoding results of each target decoding grid in the inner ring region. On this basis, the third fusion processing is performed on the intermediate decoding results of the same target decoding grid in the at least two groups of intermediate decoding results, to finally obtain the decoding results of each target decoding grid in the inner ring region.

[0125] For example, please refer to Figure 9, the origin O2 and the origin O3 are two end points located on the diagonal of the inner circle. On the one hand, the target decoding grids in the inner circle region are decoded from the origin O2 at the same time from the target direction 1 and the target direction 2. On the other hand, the target decoding grids in the inner circle region are decoded from the origin O3 at the same time from the target direction 3 and the target direction 4. Here, the target direction 1 and the target direction 3 can be considered as opposite directions, and the target direction 2 and the target direction 4 can be considered as opposite directions. First, the decoding results of the target decoding grids on the target direction 1 and the target direction 3 can be subjected to a second fusion processing, and the decoding results of the target decoding grids on the target direction 2 and the target direction 4 can be subjected to a second fusion processing, to obtain intermediate decoding results of the target decoding grids in the two groups of inner circle regions; then the decoding results of the target decoding grids in the intermediate decoding results of the two groups of intermediate decoding results are subjected to a third fusion processing, so as to obtain the final decoding results of the target decoding grids in the inner circle region.

[0126] It should be understood that when the decoding result of any target decoding grid is represented as background region corresponding to binary 0, and the decoding result of any target decoding grid is represented as foreground region corresponding to binary 1, the decoding results of the target decoding grids on the target direction 1 and the target direction 3 are subjected to a second fusion processing, and the decoding results of the target decoding grids on the target direction 2 and the target direction 4 are subjected to a second fusion processing, to obtain intermediate decoding results of the target decoding grids in the two groups of inner circle regions; then the decoding results of the target decoding grids in the intermediate decoding results of the two groups of intermediate decoding results are subjected to a third fusion processing can be calculated based on formula (2):

[0127] R = (R1 & R3) | (R2 & R4) (2)

[0128] Wherein, R represents the decoding result of any target decoding grid on the target direction 1, the target direction 2, the target direction 3 and the target direction 4 after the second fusion processing and the third fusion processing, R1 represents the decoding result obtained by any target decoding grid on the target direction 1, R2 represents the decoding result obtained by any target decoding grid on the target direction 2, R3 represents the decoding result obtained by any target decoding grid on the target direction 3, R4 represents the decoding result obtained by any target decoding grid on the target direction 4, R1 and R3 are opposite directions, R2 and R4 are opposite directions, & represents and operation (second fusion processing), | represents or operation (third fusion processing).

[0129] In the above embodiment, the same target decoding grid in different target directions but in opposite relationship adopts the AND operation when the second fusion processing is performed, so as to ensure the consistency of the decoding results of the same target decoding grid in opposite directions; on this basis, the OR operation is adopted when the third fusion processing is performed on the intermediate decoding results of the same target decoding grid, so as to avoid the error of a certain intermediate decoding result leading to the error of the decoding result of the target decoding grid.

[0130] Please refer to Figure 10 Based on the same inventive concept, the embodiment of the present application provides a flying device, which comprises a first acquisition unit 201, a second acquisition unit 202, a first decoding unit 203 and a second decoding unit 204.

[0131] The first acquisition unit 201 is used for acquiring a target image containing a beacon and dividing the target image into M*N grids, wherein the beacon is used for indicating the landing of the flying device, M and N are both positive integers not less than 1, and the beacon is used for indicating the landing of the flying device.

[0132] The second acquisition unit 202 is used for acquiring the average pixel value of the pixel points contained in each grid of the M*N grids.

[0133] The first decoding unit 203 is used for designating any grid of the target image as a first reference grid, determining the decoding result of a first target decoding grid adjacent to the first reference grid in the target direction based on the decoding result of the first reference grid and the relative size relationship between the average pixel value of the first target decoding grid and the average pixel value of the first reference grid.

[0134] The second decoding unit 204 is used for taking the first target decoding grid as a second reference grid, determining the decoding result of a second target decoding grid adjacent to the second reference grid in the target direction based on the decoding result of the second reference grid and the relative size relationship between the average pixel value of the second target decoding grid and the average pixel value of the second reference grid, and so on, to obtain the decoding result of each grid in the target image.

[0135] Optionally, the target image comprises a background region and a foreground region representing the beacon, and the first decoding unit 203 comprises:

[0136] The first decoding subunit is used for decoding the first target decoding grid as representing the foreground region if the decoding result of the first reference grid represents the background region and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is greater than a first set threshold.

[0137] Optionally, the first decoding subunit is further used for:

[0138] If the decoding result of the first reference grid represents a background region, and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is less than the second set threshold, the first target decoding grid is decoded to represent a background region.

[0139] Optionally, the first decoding subunit is further configured to:

[0140] If the decoding result of the first reference grid represents a foreground region, and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is greater than the third set threshold, the first target decoding grid is decoded to represent a background region.

[0141] Optionally, the first decoding subunit is further configured to:

[0142] If the decoding result of the first reference grid represents a foreground region, and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is less than the fourth set threshold, the first target decoding grid is decoded to represent a foreground region.

[0143] Optionally, the first obtaining unit 201 comprises:

[0144] The dividing subunit is configured to divide the target image into M*N grids based on a preset step length, wherein the M*N grids comprise an outer ring region and an inner ring region, the outer ring region does not comprise a beacon, and a boundary of the outer ring region away from the inner ring region is spaced apart from a boundary of the inner ring region adjacent to the outer ring region by at least one preset step length.

[0145] The aircraft further comprises:

[0146] The third decoding unit is configured to decode each grid in the outer ring region to represent a background region.

[0147] The first decoding unit 203 further comprises:

[0148] The specifying subunit is configured to specify any grid of the outer ring region as the first reference grid.

[0149] Optionally, when the target direction is at least two target directions determined based on the origin point, the second decoding unit 204 comprises:

[0150] The first obtaining subunit is configured to perform first fusion processing on the decoding results of the same target decoding grid in each target direction of the at least two target directions in the inner ring region, to obtain the decoding result of each target decoding grid in the inner ring region.

[0151] Optionally, when the decoding result of any target decoding grid represents a background region corresponding to binary 0, and the decoding result of any target decoding grid represents a foreground region corresponding to binary 1, the first fusion processing is an OR operation.

[0152] Optionally, taking two end points on any diagonal line of the inner ring region as a first origin and a second origin, the target direction is at least four target directions determined based on the first origin and the second origin, and the target direction of the first origin and the target direction of the second origin form an opposite relationship.

[0153] The second obtaining sub-unit is configured to perform second fusion processing on the decoding results of the same target decoding grid in the two target directions opposite to each other and located at the first origin and the second origin, respectively, to obtain at least two groups of intermediate decoding results of the target decoding grids in the inner ring region.

[0154] The third obtaining sub-unit is configured to perform third fusion processing on the intermediate decoding results of the same target decoding grid in the at least two groups of intermediate decoding results to obtain the decoding results of the target decoding grids in the inner ring region.

[0155] Optionally, when the decoding result of any target decoding grid represents a background region corresponding to binary 0, and the decoding result of any target decoding grid represents a foreground region corresponding to binary 1, the second fusion processing is an AND operation, and the third fusion processing is an OR operation.

[0156] Please refer to Figure 11 , based on the same inventive concept, the embodiment of the present application provides a kind of aircraft, which includes at least one processor 301, processor 301 is used to execute the computer program stored in memory, realizes the steps of the decoding method as shown in Figure 5 Provided by the embodiment of the present application.

[0157] Optionally, processor 301 can be a central processing unit, a specific ASIC, and can be one or more integrated circuits for controlling program execution.

[0158] Optionally, the aircraft can also include a memory 302 connected to the at least one processor 301, and the memory 302 can include ROM, RAM and disk storage. The memory 302 is used to store the data required by the processor 301 during operation, i.e. the instructions executable by the at least one processor 301 are stored, and the at least one processor 301 executes the method as shown in Figure 3 by executing the instructions stored in the memory 302. Wherein, the number of memory 302 is one or more. Wherein, the memory 302 is in Figure 11The memory 302 is shown in the figure but it is to be understood that the memory 302 is not an essential functional module, thus it is not necessary to be included in the Figure 11 The memory 302 is shown in the figure but it is to be understood that the memory 302 is not an essential functional module, thus it is not necessary to be included in the

[0159] The first obtaining unit 201, the second obtaining unit 202, the first decoding unit 203 and the second decoding unit 204 can be the processor 301. The processor 301 can be used to execute the method provided by the embodiments shown in the figure. Thus, the functions that the processor 301 can achieve in the embodiments shown in the figure can be referred to the corresponding description of the embodiments shown in the figure, and will not be described in detail. Figure 5 The first obtaining unit 201, the second obtaining unit 202, the first decoding unit 203 and the second decoding unit 204 can be the processor 301. The processor 301 can be used to execute the method provided by the embodiments shown in the figure. Thus, the functions that the processor 301 can achieve in the embodiments shown in the figure can be referred to the corresponding description of the embodiments shown in the figure, and will not be described in detail. Figure 5 The first obtaining unit 201, the second obtaining unit 202, the first decoding unit 203 and the second decoding unit 204 can be the processor 301. The processor 301 can be used to execute the method provided by the embodiments shown in the figure. Thus, the functions that the processor 301 can achieve in the embodiments shown in the figure can be referred to the corresponding description of the embodiments shown in the figure, and will not be described in detail.

[0160] The computer storage medium stores computer instructions, when the computer instructions are run on the computer, the computer executes the method shown in the figure. Figure 5 The computer storage medium stores computer instructions, when the computer instructions are run on the computer, the computer executes the method shown in the figure.

[0161] The above only the preferred embodiments of the present specification, and not to limit the present specification, any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present specification, should be included in the scope of protection of the present specification.

Claims

1. A decoding method, comprising: The method is applied to an aircraft, and the method comprises: obtaining a target image containing a beacon, and dividing the target image into M*N grids, the beacon being used to indicate landing of the aircraft, M and N being positive integers not less than 1; obtaining average pixel values of pixel points contained in each of the M*N grids; designating any grid of the target image as a first reference grid, determining a decoding result of a first target decoding grid adjacent to the first reference grid in a target direction based on a decoding result of the first reference grid and a relative size relationship between the average pixel value of the first target decoding grid and the average pixel value of the first reference grid; taking the first target decoding grid as a second reference grid, determining a decoding result of a second target decoding grid adjacent to the second reference grid in the target direction based on a decoding result of the second reference grid and a relative size relationship between the average pixel value of the second target decoding grid and the average pixel value of the second reference grid, and iteratively obtaining decoding results of grids in the target image.

2. The method of claim 1, wherein, The target image comprises a background region and a foreground region representing the beacon, and determining the decoding result of the first target decoding grid based on the decoding result of the first reference grid and the relative size relationship between the average pixel value of the first target decoding grid and the average pixel value of the first reference grid comprises: if the decoding result of the first reference grid represents the background region, and an absolute value of a difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is greater than a first set threshold, decoding the first target decoding grid as representing the foreground region.

3. The method of claim 2, wherein, The method further comprises: if the decoding result of the first reference grid represents the background region, and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is less than a second set threshold, decoding the first target decoding grid as representing the background region.

4. The method of claim 2, wherein, The method further comprises: if the decoding result of the first reference grid represents the foreground region, and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is greater than a third set threshold, decoding the first target decoding grid as representing the background region.

5. The method of claim 4, wherein, The method further comprises: if the decoding result of the first reference grid represents the foreground region, and the absolute value of the difference between the average pixel value corresponding to the first target decoding grid and the average pixel value corresponding to the first reference grid is less than a fourth set threshold, decoding the first target decoding grid as representing the foreground region.

6. The method of claim 2, wherein, dividing the target image into M*N grids comprises: dividing the target image into the M*N grids based on a preset step length, wherein the M*N grids include an outer ring region and an inner ring region, the outer ring region does not include the beacon, and a boundary of the outer ring region away from the inner ring region is spaced apart from a boundary of the inner ring region adjacent to the outer ring region by at least one preset step length; before designating any grid of the target image as a first reference grid, the method further comprises: decoding each grid in the outer ring region as representing the background region; the designation of any grid of the target image as the first reference grid comprises: designating any grid of the outer ring region as the first reference grid.

7. The method of claim 6, wherein, when the target direction is at least two target directions determined based on an origin point at either end point of any diagonal line of the inner ring region, the obtaining of the decoding result of each grid in the target image comprises: performing first fusion processing on the decoding results of the same target decoding grid in the inner ring region in each of the at least two target directions, to obtain the decoding result of each target decoding grid in the inner ring region.

8. The method of claim 7, wherein, when the decoding result of any target decoding grid represents the background region as binary 0 and the decoding result of any target decoding grid represents the foreground region as binary 1, the first fusion processing is an OR operation.

9. The method of claim 6, wherein, when the target direction is at least four target directions determined based on a first origin point and a second origin point at two end points of any diagonal line of the inner ring region, and the target directions of the first origin point and the target directions of the second origin point form an opposite relationship with each other, the obtaining of the decoding result of each grid in the target image comprises: performing second fusion processing on the decoding results of the same target decoding grid in the inner ring region in each of the two target directions opposite to each other and located at the first origin point and the second origin point, respectively, to obtain at least two groups of intermediate decoding results of each target decoding grid in the inner ring region; performing third fusion processing on the intermediate decoding results of the same target decoding grid in the at least two groups of intermediate decoding results, to obtain the decoding result of each target decoding grid in the inner ring region.

10. The method of claim 9, wherein, when the decoding result of any target decoding grid represents the background region as binary 0 and the decoding result of any target decoding grid represents the foreground region as binary 1, the second fusion processing is an AND operation and the third fusion processing is an OR operation.

11. An aircraft, characterized in that The aircraft comprises at least one processor and a memory connected to the at least one processor, and the at least one processor is configured to execute a computer program stored in the memory to implement the steps of the method according to any one of claims 1-10.

12. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is configured to be executed by a processor to implement the steps of the method according to any one of claims 1-10.

Citation Information

Patent Citations

  • Two-dimensional code decoding system and method

    CN104517089A

  • Image mask determination method and device, storage medium and electronic equipment

    CN113205011A