Target distance determination method and device for machine patrol infrared image, electronic equipment and storage medium

By extracting pixel size and aspect ratio in machine-survey infrared images, and combining the actual size ratio, the target distance of the target object is quickly calculated, which solves the shortcomings of the deep learning ranging solution in real time and response speed, and achieves efficient target distance determination.

CN119573658AActive Publication Date: 2025-03-07GUANGDONG POWER GRID CO LTD

Patent Information

Application Number
CN202411650349.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-07
Estimated Expiration
2044-11-19

AI Technical Summary

Technical Problem

Monocular ranging schemes based on deep learning have problems such as poor real-time and slow response in actual engineering applications, especially when dealing with complex scenarios or dynamically changing environments.

Method used

By obtaining the infrared image of the machine and the pixel focal length of the camera, extracting the pixel size and pixel aspect ratio of the target object, and combining the actual size ratio and projection ratio, the target distance of the target object is quickly calculated.

Benefits of technology

Improves real-time performance of target distance determination, saves computing resources, and is suitable for rapidly changing environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119573658A_ABST
    Figure CN119573658A_ABST
Patent Text Reader

Abstract

The invention discloses a target distance determination method and device for a machine patrol infrared image, electronic equipment and a storage medium, and the method comprises the steps: obtaining a to-be-detected image and a pixel focal length of a camera, and extracting the pixel size of a target object in the image; calculating a pixel height-width ratio of the target object according to the pixel size, and further calculating an actual size ratio, including an actual height-width ratio, an actual height-length ratio and an actual width-length ratio, of the target object; comparing the actual size proportions with the pixel height-width ratio, and selecting a value with the minimum difference as the projection proportion of the target object in the world coordinate system; and determining the actual distance of the target object according to the size parameter corresponding to the projection proportion, the pixel size of the target object and the pixel focal length of the camera. According to the invention, the target distance of the target object can be quickly generated, the real-time performance of determining the target distance is effectively improved, and computing resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of visual distance measurement technology, and in particular to a method, device, electronic equipment and storage medium for determining target distance of an aircraft patrol infrared image. Background Art

[0002] Image distance determination of power transmission line equipment is an important technology for filtering out misidentification of background line components. Since the temperature recognition error of equipment components is large at a long shooting distance, it is necessary to effectively filter out instances with long distances after instance segmentation during infrared temperature detection. This process not only requires obtaining the actual distance from the instance to the camera in order to verify the temperature matrix and improve the accuracy of temperature detection, but also involves how to select a suitable distance measurement scheme in actual engineering.

[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 link in a project. Due to the requirements of cost, working conditions and image shooting form, a solution with fast response speed, high real-time performance and strong adaptability to image categories is needed.

[0004] However, monocular ranging solutions based on deep learning usually rely on a large amount of training data, using deep learning models such as convolutional neural networks to learn depth information from large-scale data sets, and directly regress or classify depth values ​​from a single image through training networks to ensure the accuracy and generalization of the model. In order to improve the accuracy of inference, the model must learn features from a huge data set, which makes the calculation process complicated and time-consuming. The high-dimensional calculation, feature extraction, and data processing involved in the inference process will increase the response time, especially when dealing with complex scenes or dynamically changing environments. As a result, the real-time performance of the monocular ranging solution based on deep learning is poor, the response speed is slow, and the ability to cope with rapidly changing environments is reduced. 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 a target distance of an aircraft patrol infrared image, comprising:

[0007] Acquire a first machine patrol infrared image containing a target object to be measured and a pixel focal length of a camera used to capture the first machine patrol infrared image;

[0008] Extracting the pixel size of the target object in the first patrol infrared image;

[0009] According to the pixel size of the target object, the pixel aspect ratio of the target object is calculated and generated;

[0010] According to the actual size of the target object, the actual size ratio of the target object is calculated and generated; wherein the actual size ratio includes: actual height-to-width ratio, actual height-to-length ratio, and actual width-to-length ratio;

[0011] 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;

[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 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 aircraft patrol 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 each second patrol infrared image;

[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 i-th second-machine patrol infrared image; d i is the object shooting distance of the i-th second patrol infrared image; W 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.

[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, the step of 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 to 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] Further, 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 embodiment, the present invention provides a corresponding device embodiment.

[0037] An embodiment of the present invention provides a device for determining target distance of 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 machine patrol infrared image containing a target object to be measured and a pixel focal length of a camera used to shoot the first machine patrol infrared image;

[0039] The pixel aspect ratio generating module is used 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 according to 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 used 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 size parameters 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 described in any one of the above method embodiments can be implemented.

[0045] Based on the above method item embodiments, the present invention provides a corresponding storage medium item 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 embodiment of the present invention provides a method, device, electronic device and storage medium for determining the target distance of an infrared image of an unmanned patrol. The method can quickly extract the pixel size of the target object, including pixel height and pixel width, by acquiring an infrared image containing a target object and processing the image in combination with the pixel focal length of the camera; 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, the target distance of the target object can be quickly generated by relying solely on these data for calculation without involving a large data set and high-dimensional calculations, effectively improving the real-time performance of the target distance determination and saving computing resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 The present invention is a flowchart of a method for determining target distance of an aircraft patrol infrared image provided by an embodiment of the present invention.

[0050] Figure 2 The present invention is a schematic diagram of a calculation principle of a target distance of a target object in an infrared image of an aircraft patrol provided by an embodiment of the present invention.

[0051] Figure 3 It is a structural schematic diagram of a target distance determination device for an aircraft patrol infrared image provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] like Figure 1 As shown, an embodiment of the present invention provides a method for determining a target distance of an aircraft patrol infrared image, which at least includes the following steps:

[0054] Step S1, obtaining a first machine patrol infrared image containing a target object to be measured and a pixel focal length of a camera used to shoot the first machine 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 each second patrol infrared image;

[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 i-th second-machine patrol infrared image; d i is the object shooting distance of the i-th second patrol infrared image; W 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] Exemplarily, 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; Fplysical 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 take infrared images of the patrol machine is generally an infrared camera or a thermal imaging camera, and the image sensor of the infrared camera is different from that of an ordinary camera. Therefore, the width of the image sensor of the infrared camera is difficult to obtain. When the physical focal length of the camera and the width of the image sensor cannot be obtained, it is necessary to infer the pixel focal length of the camera based on the object shooting distance and the actual width of the object in each of the second dry patrol infrared images.

[0067] It is understandable that the camera's pixel focal length is a key parameter for accurate distance estimation, which directly affects the accuracy and reliability of the measurement. By accurately obtaining the pixel focal length, the actual distance of the target object can be calculated more effectively, thereby 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 aircraft patrol infrared image includes:

[0070] Segment the target object from the first patrol infrared image to 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 infrared image of the drone, segment the target object from it, and generate the corresponding binary mask; after obtaining the binary mask, call the function in OpenCV to extract the contour of the mask to obtain the contour information of the target object; fit the extracted contour with the minimum bounding rectangle to 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; define the long side of the minimum bounding rectangle of the target object as the pixel height, the short side of the minimum bounding rectangle as the pixel height, and the short side as the pixel width.

[0073] Exemplarily, the pixel height and pixel width are calculated by the following formula:

[0074]

[0075]

[0076] 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.

[0077] It is 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 then effectively infer the actual distance of the object. This process can reduce the measurement error introduced by the object's shape, posture or background interference, thereby improving the reliability of the measurement.

[0078] Step S3, calculating and generating the pixel aspect ratio of the target object according to the pixel size of the target object;

[0079] 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;

[0080] It is understandable that the pixel aspect ratio provides important information about the shape of the object for distance measurement, which can help to more accurately understand the performance of the target object in the image. When the aspect ratio of the object is compared with a known standard, its true posture in space can be more effectively inferred, thereby improving the accuracy of distance estimation.

[0081] Step S4, calculating and generating 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;

[0082] 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, in this step, the actual length of the target object is defined as the shortest side, indicating a basic dimension of the object; this means that this value is the smallest among all dimensions, 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.

[0083] It can be understood that the actual aspect 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 the measurement error caused by changes in the object's posture and appearance, and improving the accuracy of the distance measurement.

[0084] Step S5, 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;

[0085] Preferably, the target object is projected 1:1 to the world coordinate system, and the projection ratio at this time can represent the actual ratio of the target object; the projection size parameter corresponding to the projection ratio can truly reflect the actual size of part of the target object. This means that during the calculation process, the actual ratio of the object will be maintained as much as possible. This 1:1 projection ratio can accurately represent the actual shape of the target object, making the subsequent distance calculation more credible.

[0086] It is understandable that selecting the actual size ratio that is closest to the pixel aspect ratio can reduce the errors caused by changes in viewing angle and differences in object appearance, ensuring a more accurate distance estimation during the distance measurement process.

[0087] Step S6, using the size parameter corresponding to the projection ratio as the projection size parameter of the target object;

[0088] 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:

[0089] 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;

[0090] 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;

[0091] 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.

[0092] Step S7: determining the target distance of the target object according to the pixel size of the target object, the size parameter of the target object and the pixel focal length of the camera.

[0093] 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:

[0094] or,

[0095]

[0096] 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.

[0097] It is understandable that this solution only requires a single camera and no additional hardware support, such as binocular cameras or LiDAR, making its equipment cost in infrared inspection projects zero. In addition, it is highly flexible and can adapt to different shooting distances and scenes, and meet the distance measurement needs of various objects by adjusting parameters. Since it does not need to rely on specific environments or texture features, and there are 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. Since the solution is based on the pixel size of the target object, the projection size of the target object, and the pixel focal length of the camera, it can rely only on these data for calculation, without involving large data sets and high-dimensional calculations, and quickly generate the actual distance of the target object, effectively improving the real-time determination of the target distance and saving computing resources.

[0098] Based on the above method embodiment, the present invention provides a corresponding device embodiment.

[0099] like Figure 3 As shown, an embodiment of the present invention provides a device for determining a target distance of 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;

[0100] The data acquisition module 101 is used to acquire a first machine patrol infrared image containing a target object to be measured and a pixel focal length of a camera used to capture the first machine patrol infrared image;

[0101] The pixel aspect ratio generating module 102 is used 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 according to the pixel size of the target object;

[0102] 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;

[0103] The projection ratio determination module 104 is used 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 with the pixel height-to-width ratio as the projection ratio of the target object in the world coordinate system;

[0104] The target distance determination module 105 is used to calculate and generate the target distance of the target object according to the pixel size of the target object, the size parameters of the target object and the pixel focal length of the camera.

[0105] It should be noted that the embodiments of the device described above correspond to the above 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 may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments 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.

[0106] Based on the above method embodiment of the present invention, a corresponding electronic device embodiment is provided.

[0107] An embodiment of the present invention provides an electronic device, including 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 target distance determination method 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 each module in the above-mentioned device embodiments are implemented.

[0108] 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 implementing specific functions, which are used to describe the execution process of the computer program in the terminal device.

[0109] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0110] 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, and uses various interfaces and lines to connect various parts of the entire terminal device.

[0111] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the terminal device by running or executing the computer program and / or module 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 according to 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 (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0112] Based on the above method embodiment, the present invention provides a storage medium embodiment;

[0113] 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.

[0114] The 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, etc. 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.

[0115] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means 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 one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

[0116] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle 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 of an aircraft patrol infrared image, characterized in that: include: Acquire a first machine patrol infrared image containing a target object to be measured and a pixel focal length of a camera used to capture the first machine patrol infrared image; Extracting the pixel size of the target object in the first patrol infrared image; According to the pixel size of the target object, the pixel aspect ratio of the target object is calculated and generated; 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; 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; 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 size parameter of the target object, and the pixel focal length of the camera.

2. The method for determining target distance of an aircraft patrol infrared image according to claim 1, characterized in that: The step of obtaining the pixel focal length of a 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 each second patrol infrared image; 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 of an aircraft patrol infrared image as claimed in claim 2, characterized in that: 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 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 i-th second-machine patrol infrared image; d i is the object shooting distance of the i-th second patrol infrared image; W 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 of an aircraft patrol infrared image as claimed in claim 2, characterized in that: 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 of an aircraft patrol infrared image according to claim 1, characterized in that: The step of 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 to 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 of an aircraft patrol infrared image according to claim 1, characterized in that: 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 of an aircraft patrol infrared image according to claim 1, characterized in that: 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 of an aircraft patrol infrared image, characterized in that: include: A data 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; The data acquisition module is used to acquire a first machine patrol infrared image containing a target object to be measured and a pixel focal length of a camera used to shoot the first machine patrol infrared image; The pixel aspect ratio generation module is used to extract the pixel size of the target object in the first patrol infrared image; According to the pixel size of the target object, the pixel aspect ratio of the target object is calculated and generated; 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, and actual width-to-length ratio; The projection ratio determination module is used 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 with the pixel aspect 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 size parameters 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 method for determining the target distance 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 method for determining the target distance of an aircraft patrol infrared image as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for correcting circle center error of circular index point when translating camera perspective projection

    CN101303768A

  • Method and system for positioning and measuring space objects based on computer vision

    CN110030928A

  • Monocular real-time distance measurement method based on target pixel area and aspect ratio

    CN111780716A

  • Coal mine operation area calibration method based on computer vision

    CN111895931A

  • Vehicle positioning method and device, vehicle system and storage medium

    CN114359384A

Cited By

  • Seedling raising system and method

    CN120918025A

  • A system and method for growing seedlings

    CN120918025B