A method and device for determining the distance of a target in a machine-patrol infrared image
By acquiring the pixel focal length and target object size ratio of the infrared image obtained from the machine-guided scanning, and combining it with the camera's pixel focal length, the distance to the target object can be quickly determined. This solves the problem of complex and time-consuming calculations in existing technologies, and improves real-time performance and accuracy.
Patent Information
- Application Number
- CN202411650349.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-11-19
AI Technical Summary
Existing deep learning-based monocular ranging solutions are computationally complex and time-consuming in infrared temperature detection of power transmission line equipment, resulting in poor real-time performance and an inability to quickly respond to complex or dynamically changing environments.
By acquiring the pixel focal length and pixel size of the target object from the machine-scanning infrared image, the pixel aspect ratio and actual size ratio of the target object are calculated. Combined with the camera's pixel focal length, the distance to the target object can be quickly determined, avoiding the dependence on high-dimensional calculations and large datasets.
It improves the real-time performance of target distance determination, saves computing resources, adapts to different shooting distances and scenarios, and has strong versatility and ranging accuracy.
Smart Images

Figure CN119573658B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of visual ranging, and in particular to a method, device, electronic device and storage medium for determining target distance of an aircraft patrol infrared image. Background Art
[0002] Determining the image distance of power transmission line equipment is a crucial technique for filtering out misidentifications of background line components. Because temperature recognition errors of equipment components can be significant at longer shooting distances, effective filtering of distant instances after instance segmentation is essential during infrared temperature measurement. This process not only requires obtaining the actual distance from the instance to the camera to verify the temperature matrix and improve temperature measurement accuracy, but also involves selecting an appropriate distance measurement scheme in practical applications.
[0003] In recent years, with the rapid development of deep learning technology, the main visual ranging method adopts a monocular ranging solution based on deep learning. Although this method has certain advantages in ranging accuracy, in actual engineering applications, ranging is often only a small part of the project. Due to the limitations of cost, working conditions and image capture requirements, a solution with fast response speed, high real-time performance and strong adaptability to image categories is needed.
[0004] However, deep learning-based monocular ranging solutions typically rely on large amounts of training data. They utilize deep learning models such as convolutional neural networks to learn depth information from large datasets and then train the network to directly regress or classify depth values from a single image to ensure model accuracy and generalization. To improve inference accuracy, the model must learn features from a massive dataset, making the computational process complex and time-consuming. The high-dimensional computation, feature extraction, and data processing involved in the inference process increase response time, especially when dealing with complex scenes or dynamically changing environments. This results in poor real-time performance and slow response speeds for deep learning-based monocular ranging solutions, reducing their ability to cope with rapidly changing environments. Summary of the Invention
[0005] The embodiments of the present invention provide a method, device, electronic device and storage medium for determining the target distance of an aircraft patrol infrared image. By implementing the present invention, the target distance of an aircraft patrol infrared image can be quickly determined, thereby effectively improving the real-time performance of the target distance determination and saving computing resources.
[0006] An embodiment of the present invention provides a method for determining target distance from an aircraft patrol infrared image, comprising:
[0007] Acquire a first aircraft patrol infrared image containing a target object to be measured and a pixel focal length of a camera used to capture the first aircraft patrol infrared image;
[0008] Extracting the pixel size of the target object in the infrared image of the first patrol aircraft;
[0009] Calculate and generate the pixel aspect ratio of the target object according to the pixel size of the target object;
[0010] Calculate and generate the actual size ratio of the target object according to the actual size of the target object; the actual size ratio includes: actual height-to-width ratio, actual height-to-length ratio, and actual width-to-length ratio;
[0011] Comparing the actual aspect ratio, the actual height-to-length ratio, and the actual width-to-length ratio with the pixel aspect ratio in sequence, and selecting the one with the smallest difference from the pixel aspect ratio as the projection ratio of the target object in the world coordinate system;
[0012] The size parameter corresponding to the projection ratio is used as the projection size parameter of the target object;
[0013] The target distance of the target object is determined based on the pixel size of the target object, the projection size parameter of the target object, and the pixel focal length of the camera.
[0014] Furthermore, the pixel focal length of the camera used to capture the infrared image of the patrol aircraft is obtained, including:
[0015] Acquire a plurality of second aircraft patrol infrared images and image information corresponding to each second aircraft patrol infrared image; wherein the image information includes: object shooting distance, object actual width, and object pixel width;
[0016] In the case where the physical focal length of the camera and the width of the image sensor cannot be obtained, determining the pixel focal length of the camera according to the object shooting distance and the actual width of the object in the infrared image of each second patrol;
[0017] When the physical focal length of the camera and the width of the image sensor are obtained, a second patrol infrared image is randomly selected, and the pixel focal length of the camera is determined according to the camera parameters and the object pixel width of the selected second patrol infrared image.
[0018] Furthermore, when the physical focal length of the camera and the width of the image sensor cannot be obtained, the pixel focal length of the camera is determined by the following formula:
[0019] f i =(w i * d i ) / W i
[0020]
[0021] Among them, f i is the shooting focal length corresponding to the i-th second-machine patrol infrared image; w iis the object pixel width of the second patrol infrared image of the i-th machine; d i W is the object shooting distance of the i-th second-machine patrol infrared image; i is the actual width of the object in the i-th second-machine patrol infrared image; is the pixel focal length of the camera; N is the total number of infrared images of the second patrol.
[0022] Furthermore, when the physical focal length of the camera and the width of the image sensor are obtained, the pixel focal length of the camera is determined by the following formula:
[0023]
[0024] in, is the pixel focal length of the camera; F plysical is the physical focal length of the camera; S w is the width of the image sensor; P w is the pixel width of the object in the randomly selected second patrol infrared image.
[0025] Furthermore, extracting the pixel size of the target object in the first patrol infrared image includes:
[0026] Segment the target object from the first patrol infrared image and generate a binary mask of the target object;
[0027] The binary mask of the target object is subjected to contour extraction and minimum bounding rectangle fitting operations to generate the pixel size of the target object.
[0028] Furthermore, the step of using the size parameter corresponding to the projection ratio as the projection size parameter of the target object includes:
[0029] If the projection ratio of the target object is the actual aspect ratio, the actual height in the actual aspect ratio is used as the projection height in the projection size, and the actual width is used as the projection width in the projection size;
[0030] If the projection ratio of the target object is the actual height-to-length ratio, the actual height in the actual height-to-length ratio is used as the projection height in the projection size, and the actual length is used as the projection width in the projection size;
[0031] If the projection ratio of the target object is the actual aspect ratio, the actual width in the actual aspect ratio is used as the projection height in the projection size, and the actual length is used as the projection width in the projection size.
[0032] Furthermore, the target distance of the target object is determined by any of the following formulas:
[0033] or,
[0034]
[0035] Where d is the target distance of the target object; is the pixel focal length of the camera; H p h is the projection height in the projection size parameter; pixel is the pixel height in pixel size; W p is the projection width in the projection size parameter; w pixel is the pixel width in pixel dimensions.
[0036] Based on the above method embodiments, the present invention provides corresponding device embodiments.
[0037] An embodiment of the present invention provides a target distance determination device for an aircraft patrol infrared image, comprising: an acquisition module, a pixel aspect ratio generation module, an actual size ratio generation module, a projection ratio determination module, and a target distance determination module.
[0038] The data acquisition module is used to acquire a first aircraft patrol infrared image containing a target object to be measured and a pixel focal length of a camera used to capture the first aircraft patrol infrared image;
[0039] The pixel aspect ratio generating module is configured to extract the pixel size of the target object in the first patrol infrared image; and calculate and generate the pixel aspect ratio of the target object based on the pixel size of the target object;
[0040] The actual size ratio generating module is used to calculate and generate the actual size ratio of the target object according to the actual size of the target object; wherein the actual size ratio includes: actual height-to-width ratio, actual height-to-length ratio, and actual width-to-length ratio;
[0041] The projection ratio determination module is configured to compare the actual height-to-width ratio, the actual height-to-length ratio, and the actual width-to-length ratio with the pixel height-to-width ratio in sequence, and select the one with the smallest difference from the pixel height-to-width ratio as the projection ratio of the target object in the world coordinate system;
[0042] The target distance determination module is used to calculate and generate the target distance of the target object according to the pixel size of the target object, the projection size parameter of the target object and the pixel focal length of the camera.
[0043] Based on the above method embodiment, the present invention provides a corresponding electronic device embodiment.
[0044] An embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for determining the target distance of an aircraft patrol infrared image as described in any one of the above-mentioned method embodiments can be implemented.
[0045] Based on the above method embodiment, the present invention provides a corresponding storage medium embodiment.
[0046] An embodiment of the present invention provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for determining the target distance of an aircraft patrol infrared image described in any one of the above method embodiments can be implemented.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] The embodiments of the present invention provide a method, device, electronic device, and storage medium for determining the target distance of an aircraft patrol infrared image. The method acquires an infrared image containing a target object and processes the image in combination with the pixel focal length of the camera, thereby being able to quickly extract the pixel size of the target object, including pixel height and pixel width; and further analyze the proportional relationship of its actual size by calculating the pixel aspect ratio of the target object. By comparing the actual size ratio with the pixel aspect ratio, the system can efficiently select the actual size ratio with the smallest difference from the pixel aspect ratio, thereby obtaining the projection ratio of the target object in the world coordinate system; based on the pixel size of the target object, the projection size of the target object, and the pixel focal length of the camera, calculations can be performed solely based on these data without involving a large data set and high-dimensional calculations, thereby quickly generating the target distance of the target object, effectively improving the real-time performance of target distance determination and saving computing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 The present invention provides a flow chart of a method for determining target distance from an aircraft patrol infrared image according to an embodiment of the present invention.
[0050] Figure 2 This is a diagram showing the principle of calculating the target distance of a target object in an aircraft patrol infrared image provided by one embodiment of the present invention.
[0051] Figure 3 The present invention is a schematic structural diagram of a device for determining target distance from an aircraft patrol infrared image provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0053] like Figure 1As shown, an embodiment of the present invention provides a method for determining target distance in an aircraft patrol infrared image, comprising at least the following steps:
[0054] Step S1: obtaining a first drone patrol infrared image containing a target object to be measured and a pixel focal length of a camera used to capture the first drone patrol infrared image;
[0055] Specifically, in a preferred embodiment, the step of obtaining the pixel focal length of a camera used to capture an infrared image of an aircraft patrol includes:
[0056] Acquire a plurality of second aircraft patrol infrared images and image information corresponding to each second aircraft patrol infrared image; wherein the image information includes: object shooting distance, object actual width, and object pixel width;
[0057] In the case where the physical focal length of the camera and the width of the image sensor cannot be obtained, determining the pixel focal length of the camera according to the object shooting distance and the actual width of the object in the infrared image of each second patrol;
[0058] When the physical focal length of the camera and the width of the image sensor are obtained, a second patrol infrared image is randomly selected, and the pixel focal length of the camera is determined according to the camera parameters and the object pixel width of the selected second patrol infrared image.
[0059] For example, when the physical focal length of the camera and the width of the image sensor cannot be obtained, the pixel focal length of the camera is determined by the following formula:
[0060] f i =(w i * d i ) / W i
[0061]
[0062] Among them, f i is the shooting focal length corresponding to the i-th second-machine patrol infrared image; w i is the object pixel width of the second patrol infrared image of the i-th machine; d i W is the object shooting distance of the i-th second-machine patrol infrared image; i is the actual width of the object in the second patrol infrared image; is the pixel focal length of the camera; N is the total number of infrared images of the second patrol.
[0063] For example, when the physical focal length of the camera and the width of the image sensor are obtained, the pixel focal length of the camera is determined by the following formula:
[0064]
[0065] in, is the pixel focal length of the camera; F plysical is the physical focal length of the camera; S w is the width of the image sensor; P w is the pixel width of the object in the randomly selected second patrol infrared image.
[0066] It should be noted that the camera used to capture infrared images of drone patrols is generally an infrared camera or a thermal imaging camera. The image sensor of an infrared camera is different from that of an ordinary camera. Therefore, the width of the image sensor of an infrared camera is difficult to obtain. If the physical focal length of the camera and the width of the image sensor cannot be obtained, the pixel focal length of the camera must be inferred based on the object shooting distance and the actual width of the object in each of the second drone patrol infrared images.
[0067] It's no secret that a camera's pixel focal length is a critical parameter for accurate distance estimation, directly impacting the accuracy and reliability of measurements. Accurately understanding the pixel focal length allows for more efficient calculation of the actual distance to the target object, reducing measurement errors.
[0068] Step S2: extracting the pixel size of the target object in the first patrol infrared image;
[0069] Specifically, in a preferred embodiment, extracting the pixel size of the target object in the first patrol infrared image includes:
[0070] Segment the target object from the first patrol infrared image and generate a binary mask of the target object;
[0071] The binary mask of the target object is subjected to contour extraction and minimum bounding rectangle fitting operations to generate the pixel size of the target object.
[0072] Optionally, use instance segmentation technology to process the drone infrared image, segment the target object, and generate a corresponding binary mask. After obtaining the binary mask, call the OpenCV function to extract the contour of the mask to obtain the contour information of the target object. Fit the extracted contour to the minimum bounding rectangle and calculate the pixel size of the target object in the image. The pixel size includes the pixel height and pixel width of the target object. The pixel height is defined as the long side of the minimum bounding rectangle of the target object, and the pixel height is defined as the short side of the minimum bounding rectangle.
[0073] For example, the pixel height and pixel width are calculated using the following formula:
[0074]
[0075] Among them, p hi_pixelis the pixel ordinate of the i-th vertex of the circumscribed rectangle; p wj_pixel is the pixel horizontal coordinate of the i-th point of the circumscribed rectangle; h pixel is the pixel height in pixel size; w pixel is the pixel width in pixel dimensions.
[0076] It's understandable that by analyzing the pixel representation of the target object in the image, we can better understand its position in three-dimensional space and effectively infer the object's actual distance. This process can reduce measurement errors introduced by the object's shape, posture, or background interference, thereby improving measurement reliability.
[0077] Step S3: Calculate and generate the pixel aspect ratio of the target object according to the pixel size of the target object;
[0078] Specifically, the ratio of the pixel height to the pixel width of the target object is calculated to generate the pixel aspect ratio of the target object;
[0079] It's no secret that pixel aspect ratio provides crucial information about an object's shape for distance measurement, helping to more accurately understand the target object's appearance in an image. When an object's aspect ratio is compared to a known standard, its true position in space can be more effectively inferred, improving the accuracy of distance estimation.
[0080] Step S4: Calculate and generate the actual size ratio of the target object based on the actual size of the target object; wherein the actual size ratio includes: actual height-to-width ratio, actual height-to-length ratio, and actual width-to-length ratio;
[0081] In an optional embodiment, since the pixel height of the target object is defined as the long side of the minimum circumscribed rectangle, and the pixel height of the target object is defined as the short side of the minimum circumscribed rectangle when calculating the pixel aspect ratio; therefore, in this step, the actual length of the target object is defined as the shortest side, representing a basic dimension of the object; this means that among all dimensions, this value is the smallest, reflecting the smaller scale of one side of the object; the actual width of the target object is defined as the second shortest side, indicating that among all dimensions of the object, the width is slightly larger than the length, but still smaller than the height; the actual height of the target object is defined as the longest side, indicating that this is the largest dimension of the object.
[0082] It can be understood that the actual height-to-width ratio, actual height-to-length ratio, and actual width-to-length ratio can effectively describe the proportional relationship of an object in three-dimensional space, and can take into account the shape characteristics of the object when calculating the distance, thereby reducing measurement errors caused by changes in the object's posture and appearance, and improving the accuracy of ranging.
[0083] Step S5: Compare the actual aspect ratio, actual height-to-length ratio, and actual width-to-length ratio with the pixel aspect ratio in sequence, and select the one with the smallest difference from the pixel aspect ratio as the projection ratio of the target object in the world coordinate system;
[0084] Preferably, the target object is projected onto the world coordinate system at a 1:1 ratio. This allows the projection scale to represent the actual scale of the target object, and the corresponding projection size parameters can accurately reflect the actual dimensions of some of the target object. This means that the object's true scale is maintained as much as possible during the calculation process. This 1:1 projection scale accurately represents the target object's actual form, making subsequent distance calculations more reliable.
[0085] It is understandable that selecting the actual size ratio closest to the pixel aspect ratio can reduce errors caused by changes in viewing angle and differences in object appearance, ensuring a more accurate distance estimation during the ranging process.
[0086] Step S6: Using the size parameter corresponding to the projection ratio as the projection size parameter of the target object;
[0087] Specifically, in a preferred embodiment, the step of using the size parameter corresponding to the projection ratio as the projection size parameter of the target object includes:
[0088] If the projection ratio of the target object is the actual aspect ratio, the actual height in the actual aspect ratio is used as the projection height in the projection size, and the actual width is used as the projection width in the projection size;
[0089] If the projection ratio of the target object is the actual height-to-length ratio, the actual height in the actual height-to-length ratio is used as the projection height in the projection size, and the actual length is used as the projection width in the projection size;
[0090] If the projection ratio of the target object is the actual aspect ratio, the actual width in the actual aspect ratio is used as the projection height in the projection size, and the actual length is used as the projection width in the projection size.
[0091] Step S7: Determine the target distance of the target object according to the pixel size of the target object, the projection size parameter of the target object, and the pixel focal length of the camera.
[0092] Specifically, in a preferred embodiment, the calculation principle of the target distance of the target object in the drone patrol infrared image is as follows: Figure 2 As shown, the target distance of the target object can be determined by any of the following formulas:
[0093] or,
[0094]
[0095] Where d is the target distance of the target object; is the pixel focal length of the camera; L p is the projection height in the projection size parameter; l pixel is the pixel height in pixel size; W p is the projection width in the projection size parameter; w pixel is the pixel width in pixel dimensions.
[0096] Understandably, this solution requires only a single camera and no additional hardware support, such as binocular cameras or LiDAR, making its equipment cost in infrared inspection projects zero. Furthermore, it is highly flexible and can adapt to different shooting distances and scenes, meeting the distance measurement needs of a variety of objects by adjusting parameters. Since it does not rely on specific environments or texture features and has no strict requirements on the shape and size of the input object, it has strong versatility and is suitable for a wide range of application scenarios. At the same time, by combining the actual size and focal length parameters of the target object, the solution can estimate the distance more accurately, and the ranging accuracy is controllable, relying on the accuracy of the focal length and object size, thereby ensuring reliable measurement results in practical applications. Because the solution is based on the pixel size of the target object, the projected size of the target object, and the pixel focal length of the camera, it can rely solely on this data for calculations, without involving large data sets and high-dimensional calculations, and quickly generate the actual distance of the target object, effectively improving the real-time performance of target distance determination and saving computing resources.
[0097] Based on the above method embodiments, the present invention provides corresponding device embodiments.
[0098] like Figure 3 As shown, an embodiment of the present invention provides a target distance determination device for an aircraft patrol infrared image, comprising: a data acquisition module 101, a pixel aspect ratio generation module 102, an actual size ratio generation module 103, a projection ratio determination module 104, and a target distance determination module 105;
[0099] The data acquisition module 101 is used to acquire a first drone patrol infrared image containing a target object to be measured and a pixel focal length of a camera used to capture the first drone patrol infrared image;
[0100] The pixel aspect ratio generating module 102 is configured to extract the pixel size of the target object in the first patrol infrared image; and calculate and generate the pixel aspect ratio of the target object based on the pixel size of the target object;
[0101] The actual size ratio generating module 103 is used to calculate and generate the actual size ratio of the target object according to the actual size of the target object; wherein the actual size ratio includes: actual height-to-width ratio, actual height-to-length ratio, and actual width-to-length ratio;
[0102] The projection ratio determination module 104 is configured to compare the actual aspect ratio, the actual height-to-length ratio, and the actual width-to-length ratio with the pixel aspect ratio in sequence, and select the one with the smallest difference from the pixel aspect ratio as the projection ratio of the target object in the world coordinate system;
[0103] The target distance determination module 105 is configured to calculate and generate the target distance of the target object according to the pixel size of the target object, the projection size parameter of the target object, and the pixel focal length of the camera.
[0104] It should be noted that the embodiments of the device described above correspond to the above-mentioned embodiments of the present invention, and can implement any of the methods described above in the present invention. In addition, the embodiments of the above-mentioned device are merely schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the embodiment of the device provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0105] Based on the above method embodiment of the present invention, a corresponding electronic device embodiment is provided.
[0106] An embodiment of the present invention provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the method for determining the target distance of an aircraft patrol infrared image described in any one of the present invention is implemented, or when the processor executes the computer program, the functions of the modules in the above-mentioned device embodiments are implemented.
[0107] Exemplarily, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.
[0108] The terminal device may be a computing device such as a desktop computer, a notebook computer, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0109] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, connecting various parts of the entire terminal device using various interfaces and lines.
[0110] The memory can be used to store the computer programs and / or modules, and the processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created based on the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0111] Based on the above method embodiment, the present invention provides a corresponding storage medium embodiment;
[0112] Another embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute any of the above-mentioned target distance determination methods for aircraft patrol infrared images of the present invention.
[0113] The above-mentioned storage medium is a computer-readable storage medium, and the computer program includes computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0114] In the description of this specification, the reference terms "one embodiment," "some embodiments," "example," "specific example," or "some examples" mean that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials, or characteristics described may be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and integrate different embodiments or examples described in this specification, as well as features of different embodiments or examples, unless they are mutually inconsistent.
[0115] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for determining target distance from an aircraft patrol infrared image, characterized in that: include: Acquire a first aircraft patrol infrared image containing a target object to be measured and a pixel focal length of a camera used to capture the first aircraft patrol infrared image; Extracting the pixel size of the target object in the infrared image of the first patrol aircraft; Calculate and generate the pixel aspect ratio of the target object according to the pixel size of the target object; According to the actual size of the target object, the actual size ratio of the target object is calculated and generated; The actual size ratio includes: actual height-to-width ratio, actual height-to-length ratio and actual width-to-length ratio; Comparing the actual aspect ratio, the actual height-to-length ratio, and the actual width-to-length ratio with the pixel aspect ratio in sequence, and selecting the one with the smallest difference from the pixel aspect ratio as the projection ratio of the target object in the world coordinate system; The size parameter corresponding to the projection ratio is used as the projection size parameter of the target object; The target distance of the target object is determined based on the pixel size of the target object, the projection size parameter of the target object, and the pixel focal length of the camera.
2. The method for determining target distance from an aircraft patrol infrared image according to claim 1, wherein: The obtaining of the pixel focal length of the camera used to capture the first aircraft patrol infrared image includes: Acquire a plurality of second aircraft patrol infrared images and image information corresponding to each second aircraft patrol infrared image; wherein the image information includes: object shooting distance, object actual width, and object pixel width; In the case where the physical focal length of the camera and the width of the image sensor cannot be obtained, determining the pixel focal length of the camera according to the object shooting distance and the actual width of the object in the infrared image of each second patrol; When the physical focal length of the camera and the width of the image sensor are obtained, a second patrol infrared image is randomly selected, and the pixel focal length of the camera is determined according to the camera parameters and the object pixel width of the selected second patrol infrared image.
3. The method for determining target distance from an aircraft patrol infrared image according to claim 2, wherein: If the physical focal length of the camera and the width of the image sensor are not known, the pixel focal length of the camera is determined by the following formula: f i =(w i * d i ) / W i Among them, f i is the shooting focal length corresponding to the i-th second-machine patrol infrared image; w i is the object pixel width of the second patrol infrared image of the i-th machine; d i W is the object shooting distance of the i-th second-machine patrol infrared image; i is the actual width of the object in the i-th second-machine patrol infrared image; is the pixel focal length of the camera; N is the total number of infrared images of the second patrol.
4. The method for determining target distance from an aircraft patrol infrared image according to claim 2, wherein: When the physical focal length of the camera and the width of the image sensor are obtained, the pixel focal length of the camera is determined by the following formula: in, is the pixel focal length of the camera; F plysical is the physical focal length of the camera; S w is the width of the image sensor; P w is the pixel width of the object in the randomly selected second patrol infrared image.
5. The method for determining target distance from an aircraft patrol infrared image according to claim 1, wherein: The extracting the pixel size of the target object in the first patrol infrared image includes: Segment the target object from the first patrol infrared image and generate a binary mask of the target object; The binary mask of the target object is subjected to contour extraction and minimum bounding rectangle fitting operations to generate the pixel size of the target object.
6. The method for determining target distance from an aircraft patrol infrared image according to claim 1, wherein: The step of using the size parameter corresponding to the projection ratio as the projection size parameter of the target object includes: If the projection ratio of the target object is the actual aspect ratio, the actual height in the actual aspect ratio is used as the projection height in the projection size, and the actual width is used as the projection width in the projection size; If the projection ratio of the target object is the actual height-to-length ratio, the actual height in the actual height-to-length ratio is used as the projection height in the projection size, and the actual length is used as the projection width in the projection size; If the projection ratio of the target object is the actual aspect ratio, the actual width in the actual aspect ratio is used as the projection height in the projection size, and the actual length is used as the projection width in the projection size.
7. The method for determining target distance from an aircraft patrol infrared image according to claim 1, wherein: Determine the target distance of the target object using any of the following formulas: or, Where d is the target distance of the target object; is the pixel focal length of the camera; H p h is the projection height in the projection size parameter; pixel is the pixel height in pixel size; W p is the projection width in the projection size parameter; w pixel is the pixel width in pixel dimensions.
8. A device for determining target distance from an aircraft patrol infrared image, characterized in that: include: Data acquisition module, pixel aspect ratio generation module, actual size ratio generation module, projection ratio determination module and target distance determination module; The data acquisition module is used to acquire a first aircraft patrol infrared image containing a target object to be measured and a pixel focal length of a camera used to capture the first aircraft patrol infrared image; The pixel aspect ratio generating module is used to extract the pixel size of the target object in the first patrol infrared image; Calculate and generate the pixel aspect ratio of the target object according to the pixel size of the target object; The actual size ratio generating module is used to calculate and generate the actual size ratio of the target object according to the actual size of the target object; The actual size ratio includes: actual height-to-width ratio, actual height-to-length ratio, actual width-to-length ratio; The projection ratio determination module is configured to compare the actual height-to-width ratio, the actual height-to-length ratio, and the actual width-to-length ratio with the pixel height-to-width ratio in sequence, and select the one with the smallest difference from the pixel height-to-width ratio as the projection ratio of the target object in the world coordinate system; The target distance determination module is used to calculate and generate the target distance of the target object according to the pixel size of the target object, the projection size parameter of the target object and the pixel focal length of the camera.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it can implement the target distance determination method of the aircraft patrol infrared image described in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it can implement the target distance determination method of the aircraft patrol infrared image described in any one of claims 1 to 7.