[go: up one dir, main page]

CN119573658A - Method, device, electronic device and storage medium for determining target distance of drone patrol infrared image - Google Patents

Method, device, electronic device and storage medium for determining target distance of drone patrol infrared image Download PDF

Info

Publication number
CN119573658A
CN119573658A CN202411650349.XA CN202411650349A CN119573658A CN 119573658 A CN119573658 A CN 119573658A CN 202411650349 A CN202411650349 A CN 202411650349A CN 119573658 A CN119573658 A CN 119573658A
Authority
CN
China
Prior art keywords
pixel
actual
target object
width
ratio
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411650349.XA
Other languages
Chinese (zh)
Inventor
李端姣
李雄刚
陈浩
郑志豪
张峰
汪皓
李国强
刘高
蒙华伟
林俊省
缪钟灵
廖建东
饶成成
李声福
谢卓均
谢子瀚
汪朝阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Power Grid Co Ltd
Original Assignee
Guangdong Power Grid Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Power Grid Co Ltd filed Critical Guangdong Power Grid Co Ltd
Priority to CN202411650349.XA priority Critical patent/CN119573658A/en
Publication of CN119573658A publication Critical patent/CN119573658A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C3/00Measuring distances in line of sight; Optical rangefinders
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C11/00Photogrammetry or videogrammetry, e.g. stereogrammetry; Photographic surveying
    • G01C11/02Picture taking arrangements specially adapted for photogrammetry or photographic surveying, e.g. controlling overlapping of pictures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10048Infrared image

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Geometry (AREA)
  • Multimedia (AREA)
  • Electromagnetism (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了一种机巡红外图像的目标距离确定方法、装置、电子设备及存储介质,所述方法包括:获取待测图像及相机的像素焦距,提取图像中目标物体的像素尺寸;根据像素尺寸计算目标物体的像素高宽比,并进一步计算其实际尺寸比例,包括实际高宽比、实际高长比和实际宽长比;通过将这些实际尺寸比例与像素高宽比进行比较,选取相差最小的值作为目标物体在世界坐标系下的投影比例;根据投影比例对应的尺寸参数、目标物体的像素尺寸和相机的像素焦距,确定目标物体的实际距离。通过实施本发明能够快速生成目标物体的目标距离,有效提升了目标距离确定的实时性,节约了计算资源。

The present invention discloses a method, device, electronic device and storage medium for determining the target distance of an infrared image of an aircraft patrol. The method comprises: obtaining the pixel focal length of the image to be tested and the camera, extracting the pixel size of the target object in the image; calculating the pixel aspect ratio of the target object according to the pixel size, and further calculating its actual size ratio, including the actual aspect ratio, the actual height-to-length ratio and the actual width-to-length ratio; by comparing these actual size ratios with the pixel aspect ratio, selecting the value with the smallest difference as the projection ratio of the target object in the world coordinate system; determining the actual distance of the target object according to the size parameter corresponding to the projection ratio, the pixel size of the target object and the pixel focal length of the camera. By implementing the present invention, the target distance of the target object can be quickly generated, the real-time performance of the target distance determination is effectively improved, and computing resources are saved.

Description

Method and device for determining target distance of machine inspection infrared image, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of visual ranging, in particular to a method and a device for determining a target distance of an infrared image, electronic equipment and a storage medium.
Background
Image distance determination of transmission line equipment is an important technology for carrying out false recognition and filtering on background line components. Since the temperature recognition error of the equipment component is larger at a long shooting distance, in the process of infrared temperature detection, the example with a long distance after the example is segmented must be effectively filtered. This process not only requires that the actual distance of the instance from the camera be obtained in order to verify the temperature matrix, improving the accuracy of the temperature detection, but also how to select the appropriate ranging scheme in the actual engineering.
In recent years, with the rapid development of deep learning technology, a main visual ranging method adopts a monocular ranging scheme based on deep learning, and although the method has a certain advantage in ranging accuracy, in practical engineering application, ranging is often only a small link in projects and is limited by requirements of cost, working conditions and image shooting forms, and a solution with high response speed, high instantaneity and strong adaptability to image categories is required.
However, the monocular ranging scheme based on deep learning generally relies on a large amount of training data, utilizes a deep learning model such as a convolutional neural network to learn depth information from a large-scale data set, and directly regresses or classifies depth values from a single image through the training network so as to ensure the accuracy and generalization capability of the model. In order to improve the accuracy of the inference, the model must perform feature learning from a huge dataset, which results in complex and time-consuming calculation process, and high-dimensional calculation, feature extraction and data processing involved in the inference process all increase response time, especially when dealing with complex scenes or dynamically changing environments, so that the real-time performance of the monocular ranging scheme based on deep learning is poor, the response speed is slow, and the coping capability of the fast-changing environment is reduced.
Disclosure of Invention
The embodiment of the invention provides a method, a device, electronic equipment and a storage medium for determining the target distance of an infrared image of a machine inspection, which can be used for rapidly determining the target distance of the infrared image of the machine inspection by implementing the method, the device and the electronic equipment, thereby effectively improving the real-time performance of determining the target distance and saving computing resources.
The embodiment of the invention provides a target distance determining method for machine inspection infrared images, which comprises the following steps:
Acquiring a first machine inspection infrared image containing a target object to be detected and a pixel focal length of a camera for shooting the first machine inspection infrared image;
extracting the pixel size of a target object in the first machine inspection infrared image;
calculating and generating the pixel aspect ratio of the target object according to the pixel size of the target object;
calculating and generating an actual size proportion of the target object according to the actual size of the target object, wherein the actual size proportion comprises an actual height-width ratio, an actual height-length ratio and an actual width-length ratio;
comparing the actual aspect ratio, the actual height-length ratio and the actual width-length ratio with the pixel aspect ratio in sequence, and selecting the projection ratio of the target object under a world coordinate system, wherein the projection ratio has the smallest difference with the pixel aspect ratio;
Taking the size parameter corresponding to the projection proportion as the projection size parameter of the target object;
And 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.
Further, the acquiring the pixel focal length of the camera for inspecting the infrared image of the camera includes:
Acquiring a plurality of second machine inspection infrared images and image information corresponding to each second machine inspection infrared image, wherein the image information comprises an object shooting distance, an object actual width and an object pixel width;
Under the condition that the physical focal length of the camera and the width of the image sensor cannot be acquired, determining the pixel focal length of the camera according to the object shooting distance and the actual width of the object of each second machine inspection infrared image;
and under the condition that the physical focal length of the camera and the width of the image sensor are obtained, randomly selecting a second inspection infrared image, and determining the pixel focal length of the camera according to the camera parameters and the object pixel width of the selected second inspection infrared image.
Further, in the case where the physical focal length of the camera and the width of the image sensor cannot be acquired, the pixel focal length of the camera is determined by the following formula:
fi=(wi *di)/Wi
Wherein f i is a shooting focal length corresponding to the ith second machine inspection infrared image, W i is the pixel width of the object of the ith second machine inspection infrared image, d i is the shooting distance of the object of the ith second machine inspection infrared image, and W i is the actual width of the object of the ith second machine inspection infrared image; Is the focal length of the pixels of the camera, and N is the total number of the infrared images of the second camera.
Further, in the case where the physical focal length of the camera and the width of the image sensor are acquired, the pixel focal length of the camera is determined by the following formula:
Wherein, 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, and P w is the object pixel width of the second randomly selected infrared image.
Further, the extracting the pixel size of the target object in the first machine inspection infrared image includes:
dividing a target object from the first machine inspection infrared image to generate a binary mask of the target object;
And performing contour extraction and minimum circumscribed rectangle fitting operation on the binary mask of the target object to generate the pixel size of the target object.
Further, the size parameter corresponding to the projection ratio is taken as a projection size parameter of the target object, and the size parameter comprises:
If the projection ratio of the target object is the actual height-width ratio, taking the actual height in the actual height-width ratio as the projection height in the projection size, and taking the actual width as the projection width in the projection size;
if the projection ratio of the target object is the actual height-length ratio, taking the actual height in the actual height-length ratio as the projection height in the projection size and taking the actual length as the projection width in the projection size;
if the projection ratio of the target object is the actual width-to-length ratio, the actual width in the actual width-to-length ratio is taken as the projection height in the projection size, and the actual length is taken as the projection width in the projection size.
Further, the target distance of the target object is determined by any one of the following formulas:
Or alternatively, the first and second heat exchangers may be,
Wherein d is the target distance of the target object; Is the pixel focal length of the camera, H p is the projection height in the projection size parameter, H pixel is the pixel height in the pixel size, W p is the projection width in the projection size parameter, and W pixel is the pixel width in the pixel size.
On the basis of the method item embodiments, the invention correspondingly provides the device item embodiments.
The embodiment of the invention provides a target distance determining device for an infrared image of machine inspection, which comprises an acquisition module, a pixel aspect ratio generating module, an actual size proportion generating module, a projection proportion determining module and a target distance determining module.
The data acquisition module is used for acquiring a first machine inspection infrared image containing a target object to be detected and a pixel focal length of a camera for shooting the first machine inspection infrared image;
The pixel aspect ratio generation module is used for extracting the pixel size of the target object in the first machine inspection infrared image;
The actual size proportion generating module is used for calculating and generating the actual size proportion of the target object according to the actual size of the target object, wherein the actual size proportion comprises an actual height-width ratio, an actual height-length ratio and an actual width-length ratio;
The projection ratio determining module is used for comparing the actual height-width ratio, the actual height-length ratio and the actual width-length ratio with the pixel height-width ratio in sequence and selecting the projection ratio of the target object under the world coordinate system, wherein the difference between the projection ratio and the pixel height-width ratio is the smallest;
The target distance determining module is used for calculating and generating 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.
On the basis of the method item embodiments, the invention correspondingly provides the electronic equipment item embodiments.
An embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor may implement the method for determining a target distance of an infrared image for machine inspection according to any one of the above method embodiments when executing the computer program.
Based on the method item embodiments, the invention correspondingly provides storage medium item embodiments.
An embodiment of the present invention provides a storage medium having stored thereon a computer program which, when executed by a processor, implements a method for determining a target distance of an infrared image according to any one of the above method embodiments.
Compared with the prior art, the invention has the following beneficial effects:
The embodiment of the invention provides a method and a device for determining a target distance of an infrared image, electronic equipment and a storage medium. The method is characterized in that an infrared image containing a target object is obtained, the image is processed by combining with the pixel focal length of a camera, the pixel size of the target object including the pixel height and the pixel width can be rapidly extracted, and the proportion relation of the actual size of the target object is further analyzed by calculating the pixel height-width ratio of the target object. The system can efficiently select the actual size proportion with the smallest difference between the actual size proportion and the pixel height-width ratio by comparing the actual size proportion with the pixel height-width ratio, so as to obtain the projection proportion of the target object under the world coordinate system, and can calculate based on the pixel size of the target object, the projection size of the target object and the pixel focal length of the camera only by means of the data without involving huge data sets and high-dimensional calculation, so that the target distance of the target object is rapidly generated, the real-time performance of target distance determination is effectively improved, and the calculation resources are saved.
Drawings
Fig. 1 is a flowchart of a method for determining a target distance of an infrared image for machine inspection according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of calculating a target distance of a target object of an infrared image according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a target distance determining device for inspecting an infrared image according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, an embodiment of the present invention provides a method for determining a target distance of an infrared image, which at least includes the following steps:
step S1, acquiring a first machine inspection infrared image containing a target object to be detected and a pixel focal length of a camera for shooting the first machine inspection infrared image;
specifically, in a preferred embodiment, the acquiring the pixel focal length of the camera for camera inspection of the infrared image includes:
Acquiring a plurality of second machine inspection infrared images and image information corresponding to each second machine inspection infrared image, wherein the image information comprises an object shooting distance, an object actual width and an object pixel width;
Under the condition that the physical focal length of the camera and the width of the image sensor cannot be acquired, determining the pixel focal length of the camera according to the object shooting distance and the actual width of the object of each second machine inspection infrared image;
and under the condition that the physical focal length of the camera and the width of the image sensor are obtained, randomly selecting a second inspection infrared image, and determining the pixel focal length of the camera according to the camera parameters and the object pixel width of the selected second inspection infrared image.
Illustratively, in the event that 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:
fi=(wi *di)/Wi
Wherein f i is a shooting focal length corresponding to the ith second machine inspection infrared image, W i is the pixel width of the object of the ith second machine inspection infrared image, d i is the shooting distance of the object of the ith second machine inspection infrared image, and W i is the actual width of the object of the ith second machine inspection infrared image; Is the focal length of the pixels of the camera, and N is the total number of the infrared images of the second camera.
Illustratively, in the case where 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:
Wherein, 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, and P w is the object pixel width of the second randomly selected infrared image.
It should be noted that, the camera used for the camera to patrol the infrared image is generally an infrared camera or a thermal imaging camera, and the image sensor of the infrared camera is different from that of a common camera, so that the width of the image sensor of the infrared camera is difficult to obtain, and the pixel focal length of the camera needs to be reversely deduced according to the object shooting distance and the actual object width of each second dryer to patrol the infrared image under the condition that the physical focal length of the camera and the width of the image sensor cannot be obtained.
It will be appreciated that the focal length of the pixels of the camera is a key parameter for accurate distance estimation, which directly affects the accuracy and reliability of the measurement. By accurately acquiring the pixel focal length, the actual distance of the target object can be more effectively calculated, thereby reducing measurement errors.
S2, extracting the pixel size of a target object in the first machine inspection infrared image;
Specifically, in a preferred embodiment, the extracting the pixel size of the target object in the first machine inspection infrared image includes:
dividing a target object from the first machine inspection infrared image to generate a binary mask of the target object;
And performing contour extraction and minimum circumscribed rectangle fitting operation on the binary mask of the target object to generate the pixel size of the target object.
Optionally, an example segmentation technique is adopted to process the machine inspection infrared image, a target object is segmented from the machine inspection infrared image, a corresponding binary mask is generated, after the binary mask is obtained, a function in OpenCV is called, outline extraction is carried out on the mask to obtain outline information of the target object, minimum circumscribed rectangle fitting is carried out on the extracted outline, and the pixel size of the target object in the image is calculated. The pixel size comprises the pixel height and the pixel width of the target object, wherein the long side of the minimum circumscribed rectangle of the target object is defined as the pixel height, and the short side of the minimum circumscribed rectangle is defined as the pixel height and the short side of the minimum circumscribed rectangle is defined as the pixel width.
Illustratively, the pixel height and pixel width are calculated by the following formulas:
Where p hi_pixel is the pixel ordinate of the ith vertex of the bounding rectangle, p wj_pixel is the pixel abscissa of the ith point of the bounding rectangle, h pixel is the pixel height in pixel size, and w pixel is the pixel width in pixel size.
It can be understood that the position of the target object in the three-dimensional space can be better understood by analyzing the pixel representation of the target object in the image, and the actual distance of the object can be effectively calculated. The process can reduce measurement errors caused by the shape, the posture or the background interference of the object, thereby improving the reliability of measurement.
S3, calculating and generating the pixel aspect ratio of the target object according to the pixel size of the target object;
Specifically, calculating the ratio of the pixel height to the pixel width of the target object to generate the pixel aspect ratio of the target object;
it will be appreciated that the pixel aspect ratio provides important information on the shape of the object for ranging, which can help to more accurately understand the behavior of the target object in the image. When the aspect ratio of an object is compared with a known standard, the true attitude thereof in space can be estimated more effectively, thereby improving the accuracy of distance estimation.
S4, calculating and generating an actual size proportion of the target object according to the actual size of the target object, wherein the actual size proportion comprises an actual height-width ratio, an actual height-length ratio and an actual width-length ratio;
In an alternative embodiment, since the pixel height of the target object is defined as the long side of the minimum bounding rectangle and the pixel height of the target object is defined as the short side of the minimum bounding rectangle when the pixel aspect ratio is calculated, in this step the actual length of the target object is defined as the shortest side representing one basic dimension of the object, meaning that this value is the smallest in all dimensions, reflecting the smaller dimension of one side of the object, the actual width of the target object is defined as the next shortest side, indicating that in each dimension of the object the width is slightly larger than the length, but still smaller than the height, and the actual height of the target object is defined as the longest side, indicating that this is the largest dimension of the object.
It can be understood that the actual aspect ratio, the actual aspect ratio and the actual aspect ratio can effectively describe the proportional relation of the object in the three-dimensional space, and the shape characteristics of the object can be considered when the distance calculation is performed, so that the measurement error caused by the change of the posture and the appearance of the object is reduced, and the accuracy of distance measurement is improved.
S5, comparing the actual aspect ratio, the actual height-length ratio and the actual width-length ratio with the pixel aspect ratio in sequence, and selecting the projection ratio of the target object under a world coordinate system, wherein the difference between the projection ratio and the pixel aspect ratio is the smallest;
Preferably, the target object 1:1 is projected to a world coordinate system, the projection proportion at the moment can represent the actual proportion of the target object, and the projection size parameter corresponding to the projection proportion can truly reflect the partial actual size of the target object. This means that the real proportion of the object is kept as much as possible during the calculation, and this 1:1 projection proportion can accurately represent the actual form of the target object, so that the subsequent distance calculation is more reliable.
It will be appreciated that choosing the actual dimension ratio closest to the pixel aspect ratio reduces errors due to viewing angle variations and object appearance differences, ensuring a more accurate range estimation during ranging.
S6, taking the size parameter corresponding to the projection proportion as the projection size parameter of the target object;
specifically, in a preferred embodiment, the size parameter corresponding to the projection ratio is taken as a projection size parameter of the target object, and includes:
If the projection ratio of the target object is the actual height-width ratio, taking the actual height in the actual height-width ratio as the projection height in the projection size, and taking the actual width as the projection width in the projection size;
if the projection ratio of the target object is the actual height-length ratio, taking the actual height in the actual height-length ratio as the projection height in the projection size and taking the actual length as the projection width in the projection size;
if the projection ratio of the target object is the actual width-to-length ratio, the actual width in the actual width-to-length ratio is taken as the projection height in the projection size, and the actual length is taken as the projection width in the projection size.
And 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.
Specifically, in a preferred embodiment, the calculation principle of the target distance of the target object of the machine inspection infrared image is shown in fig. 2, and the target distance of the target object can be determined by any one of the following formulas:
Or alternatively, the first and second heat exchangers may be,
Wherein 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 the pixel size, W p is the projection width in the projection size parameter, and W pixel is the pixel width in the pixel size.
It can be appreciated that the scheme only needs a single camera, and does not need additional hardware support, such as a binocular camera or LiDAR, so that the equipment cost in the infrared inspection project is zero. In addition, the device is high in flexibility, can adapt to different shooting distances and scenes, and meets the distance measurement requirements of various objects by adjusting parameters. Because the input object does not need to depend on specific environment or texture characteristics and has no strict requirements on the shape and the size of the input object, the input object has strong universality and is suitable for wide application scenes. Meanwhile, by combining the real size of the target object and the focal length parameter, the distance can be estimated accurately, the distance measurement accuracy is controllable, and the accuracy of the focal length and the object size is depended on, so that a reliable measurement result is ensured to be obtained in practical application. The scheme 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, so that the calculation can be performed only by means of the data, a huge data set and high-dimensional calculation are not involved, the actual distance of the target object is rapidly generated, the real-time performance of determining the target distance is effectively improved, and the calculation resources are saved.
On the basis of the method item embodiments, the invention correspondingly provides the device item embodiments.
As shown in fig. 3, an embodiment of the present invention provides a target distance determining device for machine inspection infrared images, which includes 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;
the data acquisition module 101 is configured to acquire a first machine inspection infrared image containing a target object to be detected and a pixel focal length of a camera for capturing the first machine inspection infrared image;
The pixel aspect ratio generating module 102 is configured to extract a pixel size of a target object in the first machine inspection infrared image;
The actual size proportion generating module 103 is configured to calculate and generate an actual size proportion of the target object according to an actual size of the target object, where the actual size proportion includes an actual aspect ratio, and an actual aspect ratio;
The projection ratio determining 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 a projection ratio of the target object in the world coordinate system with the smallest difference between the actual height-to-width ratio and the actual width-to-length ratio;
the target distance determining module 105 is configured to calculate a target distance for generating the target object according to a pixel size of the target object, a size parameter of the target object, and a pixel focal length of the camera.
It should be noted that the above-described embodiments of the apparatus correspond to the above-described embodiments of the present invention, and can implement any of the above-described methods of the present invention. Furthermore, the embodiments of the apparatus described above are merely illustrative, wherein the modules illustrated as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the embodiment of the device provided by the invention, the connection relation between the modules represents that the modules have communication connection, and can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
On the basis of the method item embodiment of the invention, an electronic equipment item embodiment is correspondingly provided.
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, where the processor implements the method for determining a target distance of an infrared image for machine inspection according to any one of the present invention when executing the computer program, or implements functions of each module in the foregoing apparatus embodiments when executing the computer program.
The computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to accomplish the present invention, for example. The one or more modules may be a series of computer program instruction segments capable of performing specific functions for describing the execution of the computer program in the terminal device.
The terminal equipment can be computing equipment such as a desktop computer, a notebook computer, a palm computer, a cloud server and the like. The terminal device may include, but is not limited to, a processor, a memory.
The Processor may be a central processing unit (Central Processing Unit, CPU), other general purpose Processor, digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, which is a control center of the terminal device, and which connects various parts of the entire terminal device using various interfaces and lines.
The memory may be used to store the computer program and/or module, and the processor may implement various functions of the terminal device by running or executing the computer program and/or module stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area which may store an operating system, an application program required for at least one function, etc., and a storage data area which may store data created according to the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart memory card (SMART MEDIA CARD, SMC), secure Digital (SD) card, flash memory card (FLASH CARD), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
On the basis of the method item embodiment, the invention correspondingly provides a storage medium item embodiment;
another embodiment of the present invention provides a storage medium, where the storage medium includes a stored computer program, and when the computer program runs, the device where the storage medium is controlled to execute the method for determining a target distance of any one of the above-mentioned infrared images.
The storage medium is a computer readable storage medium, and the computer program includes computer program code, where the computer program code may be in a source code form, an object code form, an executable file or some intermediate form, and the like. The computer readable medium may include any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the invention, such changes and modifications are also intended to be within the scope of the invention.

Claims (10)

1. The method for determining the target distance of the machine inspection infrared image is characterized by comprising the following steps of:
Acquiring a first machine inspection infrared image containing a target object to be detected and a pixel focal length of a camera for shooting the first machine inspection infrared image;
extracting the pixel size of a target object in the first machine inspection infrared image;
calculating and generating the pixel aspect ratio of the target object according to the pixel size of the target object;
Calculating and generating the actual size proportion of the target object according to the actual size of the target object, wherein the actual size proportion comprises an actual height-width ratio, an actual height-length ratio and an actual width-length ratio;
comparing the actual aspect ratio, the actual height-length ratio and the actual width-length ratio with the pixel aspect ratio in sequence, and selecting the projection ratio of the target object under a world coordinate system, wherein the projection ratio has the smallest difference with the pixel aspect ratio;
Taking the size parameter corresponding to the projection proportion as the projection size parameter of the target object;
And 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.
2. The method for determining a target distance of an inspection infrared image according to claim 1, wherein the acquiring a pixel focal length of a camera for capturing the first inspection infrared image comprises:
Acquiring a plurality of second machine inspection infrared images and image information corresponding to each second machine inspection infrared image, wherein the image information comprises an object shooting distance, an object actual width and an object pixel width;
Under the condition that the physical focal length of the camera and the width of the image sensor cannot be acquired, determining the pixel focal length of the camera according to the object shooting distance and the actual width of the object of each second machine inspection infrared image;
and under the condition that the physical focal length of the camera and the width of the image sensor are obtained, randomly selecting a second inspection infrared image, and determining the pixel focal length of the camera according to the camera parameters and the object pixel width of the selected second inspection infrared image.
3. The method for determining the target distance of the machine inspection infrared image according to claim 2, wherein in the case that 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:
fi=(wi *di)/Wi
Wherein f i is a shooting focal length corresponding to the ith second machine inspection infrared image, W i is the pixel width of the object of the ith second machine inspection infrared image, d i is the object shooting distance of the ith second machine inspection infrared image, and W i is the actual width of the object of the ith second machine inspection infrared image; Is the focal length of the pixels of the camera, and N is the total number of the infrared images of the second camera.
4. The method for determining the target distance of the machine inspection infrared image according to claim 2, wherein in the case that 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:
Wherein, 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, and P w is the object pixel width of the second randomly selected infrared image.
5. The method for determining a target distance of an inspection infrared image according to claim 1, wherein the extracting a pixel size of a target object in the first inspection infrared image comprises:
dividing a target object from the first machine inspection infrared image to generate a binary mask of the target object;
And performing contour extraction and minimum circumscribed rectangle fitting operation on the binary mask of the target object to generate the pixel size of the target object.
6. The method for determining a target distance of an infrared image for machine inspection according to claim 1, wherein the step of taking the size parameter corresponding to the projection ratio as the projection size parameter of the target object comprises the steps of:
If the projection ratio of the target object is the actual height-width ratio, taking the actual height in the actual height-width ratio as the projection height in the projection size, and taking the actual width as the projection width in the projection size;
if the projection ratio of the target object is the actual height-length ratio, taking the actual height in the actual height-length ratio as the projection height in the projection size and taking the actual length as the projection width in the projection size;
if the projection ratio of the target object is the actual width-to-length ratio, the actual width in the actual width-to-length ratio is taken as the projection height in the projection size, and the actual length is taken as the projection width in the projection size.
7. The method for determining a target distance of an infrared image for machine inspection according to claim 1, wherein the target distance of the target object is determined by any one of the following formulas:
Or alternatively, the first and second heat exchangers may be,
Wherein d is the target distance of the target object; Is the pixel focal length of the camera, H p is the projection height in the projection size parameter, H pixel is the pixel height in the pixel size, W p is the projection width in the projection size parameter, and W pixel is the pixel width in the pixel size.
8. The target distance determining device for the machine inspection infrared image is characterized by comprising a data acquisition module, a pixel aspect ratio generating module, an actual size proportion generating module, a projection proportion determining module and a target distance determining module;
the data acquisition module is used for acquiring a first machine inspection infrared image containing a target object to be detected and a pixel focal length of a camera for shooting the first machine inspection infrared image;
The pixel aspect ratio generation module is used for extracting the pixel size of the target object in the first machine inspection infrared image;
The actual size proportion generating module is used for calculating and generating the actual size proportion of the target object according to the actual size of the target object, wherein the actual size proportion comprises an actual height-width ratio, an actual height-length ratio and an actual width-length ratio;
The projection ratio determining module is used for comparing the actual height-width ratio, the actual height-length ratio and the actual width-length ratio with the pixel height-width ratio in sequence and selecting the projection ratio of the target object under the world coordinate system, wherein the difference between the projection ratio and the pixel height-width ratio is the smallest;
The target distance determining module is used for calculating and generating 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.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the method for determining the target distance for machine inspection of an infrared image according to any one of claims 1 to 7.
10. A storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, is adapted to carry out the method for determining a target distance for an infrared image according to any one of claims 1 to 7.
CN202411650349.XA 2024-11-19 2024-11-19 Method, device, electronic device and storage medium for determining target distance of drone patrol infrared image Pending CN119573658A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411650349.XA CN119573658A (en) 2024-11-19 2024-11-19 Method, device, electronic device and storage medium for determining target distance of drone patrol infrared image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411650349.XA CN119573658A (en) 2024-11-19 2024-11-19 Method, device, electronic device and storage medium for determining target distance of drone patrol infrared image

Publications (1)

Publication Number Publication Date
CN119573658A true CN119573658A (en) 2025-03-07

Family

ID=94803046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411650349.XA Pending CN119573658A (en) 2024-11-19 2024-11-19 Method, device, electronic device and storage medium for determining target distance of drone patrol infrared image

Country Status (1)

Country Link
CN (1) CN119573658A (en)

Similar Documents

Publication Publication Date Title
CN112336342B (en) Hand key point detection method and device and terminal equipment
US9307221B1 (en) Settings of a digital camera for depth map refinement
US20200160040A1 (en) Three-dimensional living-body face detection method, face authentication recognition method, and apparatuses
CN109784250B (en) Positioning method and device of automatic guide trolley
CN106447592B (en) Online personalization service for each feature descriptor
CN110148117B (en) Power equipment defect identification method and device based on power image and storage medium
US9865061B2 (en) Constructing a 3D structure
CN113378864B (en) Method, device and equipment for determining anchor frame parameters and readable storage medium
CN113269752A (en) Image detection method, device terminal equipment and storage medium
CN115601430A (en) Texture-free high-reflection object pose estimation method and system based on key point mapping
CN118781102A (en) A Mura defect classification method based on conditional generative adversarial network and related equipment
CN109766896A (en) A kind of method for measuring similarity, device, equipment and storage medium
CN119445005A (en) A point cloud image fusion method based on vision
CN117593547A (en) Commodity area detection method, commodity area detection device, terminal equipment and medium
CN114255268A (en) Disparity map processing and deep learning model training method and related equipment
CN113870210B (en) Image quality assessment method, device, equipment and storage medium
CN119573658A (en) Method, device, electronic device and storage medium for determining target distance of drone patrol infrared image
CN114219831B (en) Target tracking method, device, terminal equipment and computer readable storage medium
CN117079265A (en) Method, device and equipment for generalizing open set field of monocular 3D target detection
CN115883969A (en) Unmanned aerial vehicle shooting method, device, equipment and medium
CN111967579B (en) Method and device for performing convolution calculation on image using convolutional neural network
CN115375896A (en) Method and device for determining training sample, electronic equipment and storage medium
CN114549429A (en) Depth data quality evaluation method and device based on hypergraph structure
CN113724176A (en) Multi-camera motion capture seamless connection method, device, terminal and medium
US11202000B2 (en) Learning apparatus, image generation apparatus, learning method, image generation method, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination