Infrared image intelligent stroking method and device, electronic equipment and medium
Through the maximum inter-class variance algorithm and contour tracking algorithm combined with the infrared image stroke method of user-defined rules, the problems of overgrowth, edge fracture and high computing resource consumption of stroke algorithms in the prior art are solved, and efficient and accurate strokes are achieved in complex scenarios.
Patent Information
- Application Number
- CN202510616352.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-08-15
AI Technical Summary
The existing infrared image stroke algorithms have problems such as overgrowth or undergrowth, edge fracture and high computing resource consumption in complex scenarios such as multi-target overlap, noise interference and temperature gradient unevenness.
The maximum inter-class variance algorithm is used to binarize the grayscale image, generate a mask image and combine it with the contour tracking algorithm, introduce user-defined rules, generate output contour areas and stroke.
A more accurate stroke effect is achieved in complex infrared image scenarios, avoiding overgrowth or undergrowth, overcoming edge fracture problems, reducing computing resource consumption, and suitable for resource-constrained environments.
Smart Images

Figure CN120495329A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an infrared image intelligent outlining method, device, electronic device and medium. Background Art
[0002] Infrared imaging technology can intuitively reflect an object's temperature distribution by capturing infrared radiation emitted by it. Intelligent outlining methods are designed to accurately delineate and automatically label high-temperature areas or targets within an image. This approach holds significant potential for application in industries such as industry and security.
[0003] In the related art, there are three types of intelligent stroking methods, namely, stroking algorithms based on region growing, stroking algorithms based on edge detection, and stroking algorithms based on deep learning. Specifically, the stroking algorithm based on region growing starts from the seed points of the high-temperature area, performs region growing based on the similarity between pixels, and finally obtains the outline of the high-temperature area. However, this algorithm is highly dependent on the selection of seed points, and is prone to overgrowth or undergrowth, making it difficult to process images with multiple high-temperature areas. The stroking algorithm based on edge detection directly uses the edge detection operator to extract edge information in the infrared image, and then obtains the outline of the high-temperature area by connecting and analyzing the edge points. However, this algorithm is sensitive to noise and is prone to broken or discontinuous edges, making it difficult to accurately extract the outline of complex-shaped high-temperature areas. The stroking algorithm based on deep learning uses a deep neural network to learn the features of the high-temperature area in the infrared image and automatically generates outlines. However, it requires a large amount of labeled data for training, the model training time is long, the computing resources consumption is large, and it is difficult to explain the decision-making process of the model.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in this field.
[0005] Application Contents
[0006] In view of at least one of the above technical problems, the present application provides an infrared image intelligent tracing method, device, electronic device and medium.
[0007] In a first aspect, a method for intelligently tracing an infrared image is provided, comprising:
[0008] Acquire an infrared image to be processed, and convert the infrared image into a grayscale image;
[0009] The grayscale image is binarized using the maximum inter-class variance algorithm to generate a first binarized image;
[0010] Determine whether there is an input contour area on the infrared image, and if so, generate a mask image according to the input contour area;
[0011] generating a second binarized image according to the mask image and the first binarized image;
[0012] Outputting the contour in the second binary image using a contour tracking algorithm to generate an output contour area;
[0013] Stroke the infrared image based on the output contour area.
[0014] According to the infrared image intelligent stroke method of the present application, user-defined rules are introduced with the help of a mask mechanism, and a better stroke effect than a single algorithm is achieved in complex infrared image scenes such as multi-target overlap, noise interference, and uneven temperature gradient.
[0015] In some possible implementations, determining whether the infrared image has an input contour area includes:
[0016] If not, outputting the contour in the first binarized image using a contour tracking algorithm to generate an output contour region;
[0017] Stroke the infrared image based on the output contour area.
[0018] In some possible implementations, the following formula is used to convert the infrared image into a grayscale image:
[0019] gray=0.299*red+0.587*green+0.114*blue
[0020] Where gray is the grayscale image, red is the red channel value of the infrared image, green is the green channel value of the infrared image, and blue is the blue channel value of the infrared image.
[0021] In some possible implementations, pixels of the first binarized image are 1 or 0.
[0022] In some possible implementations, the mask image is represented as:
[0023]
[0024] Where, mask i,j It is a mask image, outer means that the point (i, j) is outside the input contour area, and inner means that the point (i, j) is inside the input contour area.
[0025] In some possible implementations, pixels of the second binarized image are 1 or 0.
[0026] In a second aspect, an infrared image intelligent tracing device is provided, comprising:
[0027] A conversion module, used for acquiring an infrared image to be processed and converting the infrared image into a grayscale image;
[0028] A first binarization module is used to binarize the grayscale image using a maximum inter-class variance algorithm to generate a first binarized image;
[0029] A judgment module is used to judge whether there is an input contour area on the infrared image, and if so, generate a mask image according to the input contour area;
[0030] A second binarization module, configured to generate a second binarized image based on the mask image and the first binarized image;
[0031] an output module, configured to output the contour in the second binary image using a contour tracking algorithm to generate an output contour area;
[0032] The stroke module is used to stroke the infrared image according to the output contour area.
[0033] In some possible implementations, the determination module includes:
[0034] If not, outputting the contour in the first binarized image using a contour tracking algorithm to generate an output contour region;
[0035] Stroke the infrared image based on the output contour area.
[0036] According to a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, an intelligent tracing method for infrared images is implemented.
[0037] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, an infrared image intelligent tracing method is implemented.
[0038] The present application is further described below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0040] Figure 1 Schematic diagram of the process of the infrared image intelligent edge drawing method in the embodiment of the present application;
[0041] Figure 2Schematic diagram of converting infrared image into grayscale image;
[0042] Figure 3 A schematic diagram for generating a first binarized image;
[0043] Figure 4 A schematic diagram for generating a second binarized image;
[0044] Figure 5 Schematic diagram of infrared image tracing;
[0045] Figure 6 A block diagram of an electronic device for implementing the infrared image intelligent tracing method in an embodiment of the present application; DETAILED DESCRIPTION
[0046] To make the above-mentioned objects, features, and advantages of the present application more clearly understood, the specific embodiments of the present application are described in detail below with reference to the accompanying drawings. The following description sets forth many specific details to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar improvements without violating the scope of the present application. Therefore, the present application is not limited to the specific embodiments disclosed below.
[0047] like Figure 1 As shown, this embodiment provides an infrared image intelligent edge drawing method, including: steps S100 to S600.
[0048] Step S100, obtaining an infrared image to be processed, and converting the infrared image into a grayscale image;
[0049] Among them, the following formula is used to convert the infrared image into a grayscale image:
[0050] gray=0.299*red+0.587*green+0.114*blue
[0051] Where gray is the grayscale image, red is the red channel value of the infrared image, green is the green channel value of the infrared image, and blue is the blue channel value of the infrared image.
[0052] Step S100 reduces the complexity of subsequent image processing and improves processing efficiency. Grayscale images have a relatively small data size and can be processed more quickly, making them useful for applications requiring high real-time performance. Furthermore, grayscale images eliminate color interference, making subsequent binarization more accurate.
[0053] Step S200 , binarizing the grayscale image using the maximum inter-class variance algorithm to generate a first binarized image.
[0054] The pixels of the first binary image are 1 or 0.
[0055] It is understandable that during the image binarization process, the grayscale image is binarized using the Maximum Interclass Variance (OTSU) algorithm. This algorithm automatically calculates the interclass variance between the target and background in the image and accurately determines the optimal threshold, eliminating the need for manually presetting seed points or relying on specific pixel similarity rules, as is done with region-growing-based edge-drawing algorithms. This feature allows this method to avoid overgrowth or undergrowth problems caused by improper seed point selection. When processing complex infrared images containing multiple high-temperature regions, it can accurately distinguish between different temperature regions and generate a complete binary outline foundation.
[0056] Step S200 allows the optimal threshold to be adaptively found without manual intervention, improving the accuracy and robustness of the binarization. The binarized image has only two grayscale values, further simplifying the image data and making the contours clearer, facilitating subsequent contour tracking and tracing operations.
[0057] Step S300 , determining whether there is an input contour area on the infrared image, and if so, generating a mask image according to the input contour area.
[0058] Among them, the mask image is represented as:
[0059]
[0060] Where maski,j is the mask image, outer means that the point (i,j) is outside the input contour area, and inner means that the point (i,j) is inside the input contour area.
[0061] Step S300 improves the pertinence and flexibility of the processing. If a contour area is input, the user can specify the area of interest according to actual needs and process only that area, reducing the amount of calculation, while also avoiding interference with irrelevant areas and improving the accuracy of the processing results.
[0062] Step S400 : generating a second binarized image according to the mask image and the first binarized image.
[0063] The pixels of the second binary image are 1 or 0.
[0064] Through step S400, the accuracy and reliability of the processing result are enhanced. By screening the mask image, the interference of irrelevant areas is eliminated, so that the final second binary image only contains the information of the target object, thereby improving the accuracy of contour extraction.
[0065] In steps S300 and S400, it can be understood that the process of determining whether the input contour area exists in the infrared image, generating a mask image based on this, and then combining it with the first binarized image to generate a second binarized image achieves a deep integration of user interaction and automatic algorithms. Users can manually mark the area of interest and accurately limit the stroke range to meet the target focus requirements in specific scenarios. At the same time, the mask can regionally filter or enhance the automatic binarization results, effectively eliminating irrelevant background interference such as noise areas or non-target temperature ranges, allowing subsequent contour tracking to focus more on the actual high-temperature areas of interest, significantly improving the specificity of the stroked target.
[0066] Step S500: outputting the contour in the second binary image using a contour tracking algorithm to generate an output contour area.
[0067] It's understandable that during the contour extraction phase, a contour tracking algorithm is used based on the second binarized image to output the contour. This algorithm ensures the continuity and integrity of the contour through point-by-point traversal and boundary tracking. Compared to edge detection-based tracing algorithms, it overcomes the problem of edge breakage caused by noise. Even in the presence of localized noise or temperature gradients in the infrared image, it can accurately connect valid edge points to generate a smooth, continuous target contour. This is particularly suitable for contour extraction of complex shapes such as irregular high-temperature areas, greatly improving the reliability of tracing results.
[0068] Step S500 can accurately extract the outline of the target object, providing accurate position information for subsequent tracing operations. The outline tracking algorithm can identify the boundaries of the object, making the tracing more closely fit the actual shape of the object, thereby improving the tracing quality.
[0069] Step S600: Stroke the infrared image according to the output contour area.
[0070] Step S600 intuitively displays the boundary of the target object, enhancing the visualization effect of the image. The infrared image after outlining can be more conveniently observed and analyzed, helping users to quickly identify the target object and improving the usability of the image.
[0071] The infrared image intelligent stroke method of this embodiment introduces user-defined rules with the help of a mask mechanism, and achieves a better stroke effect than a single algorithm in complex infrared image scenes such as multi-target overlap, noise interference, and uneven temperature gradients. Specifically, this method can effectively process infrared images with multiple high-temperature areas, and solves the problem of overgrowth or undergrowth caused by the strong dependence on seed point selection of traditional region growth-based stroke algorithms. It does not need to rely on seed points, can adapt to the distribution of different high-temperature areas, and improves the accuracy of strokes. Secondly, the method combines the mask image with the first binary image when generating the second binary image. The mask image is generated based on the input contour area, which can highlight the key areas of concern and reduce the interference of noise on edge detection, so that the contour tracking algorithm can more accurately extract the continuous and complete contour of the high-temperature area, effectively solving the problem that the edge detection-based stroke algorithm is prone to broken or discontinuous edges, and improving the stroke quality. In addition, compared with the deep learning-based outlining algorithm, this method does not require a large amount of labeled data for training, avoiding the lengthy model training time and huge computing resource consumption. It is easier to deploy and use in resource-constrained environments, greatly expanding its application scope and practicality.
[0072] In some embodiments, determining whether the infrared image has an input contour area includes:
[0073] If not, outputting the contour in the first binarized image using a contour tracking algorithm to generate an output contour region;
[0074] Stroke the infrared image based on the output contour area.
[0075] It can be understood that when there is no input contour area on the infrared image, the contour in the first binarized image is output to generate an output contour area.
[0076] The following example illustrates the intelligent edge drawing method for infrared images.
[0077] like Figure 2 As shown, the first binarized image can highlight the hand and part of the interference area in the grayscale image, thereby making the outline clearer.
[0078] like Figure 3 As shown in Figure 1, the user inputs a contour region in the infrared image. The system determines whether there is an input contour region. If so, it generates a mask image based on the input contour region.
[0079] like Figure 4 As shown, the second binarized image is generated by combining the first binarized image and the mask image, thereby excluding irrelevant areas and retaining only the target object information.
[0080] like Figure 5As shown, the contour of the second binary image is output to generate an output contour area, and the infrared image is stroked based on the output contour area.
[0081] This embodiment provides an infrared image intelligent edge drawing device, including:
[0082] A conversion module, used for acquiring an infrared image to be processed and converting the infrared image into a grayscale image;
[0083] A first binarization module is used to binarize the grayscale image using a maximum inter-class variance algorithm to generate a first binarized image;
[0084] A judgment module is used to judge whether there is an input contour area on the infrared image, and if so, generate a mask image according to the input contour area;
[0085] A second binarization module, configured to generate a second binarized image based on the mask image and the first binarized image;
[0086] an output module, configured to output the contour in the second binary image using a contour tracking algorithm to generate an output contour area;
[0087] The stroke module is used to stroke the infrared image according to the output contour area.
[0088] In some embodiments, the determination module includes:
[0089] If not, outputting the contour in the first binarized image using a contour tracking algorithm to generate an output contour region;
[0090] Stroke the infrared image based on the output contour area.
[0091] This embodiment 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 program, an intelligent edge drawing method for infrared images is implemented.
[0092] This embodiment provides a computer-readable storage medium for storing a computer program thereon. When the computer program is executed by a processor, a method for intelligent edge drawing of infrared images is implemented.
[0093] In order to implement the above embodiments, the present application provides an electronic device and a computer-readable storage medium.
[0094] Figure 6This is a block diagram of an electronic device that implements the infrared image intelligent tracing method according to an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided for example only and are not intended to limit the implementation of the present application as described and / or claimed herein.
[0095] like Figure 6 As shown, the electronic device includes: a memory 610, a processor 620 and a computer program 630 stored in the memory and operable on the processor. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to an interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
[0096] Memory 610 is a non-transitory computer-readable storage medium provided in this application. The memory stores instructions executable by at least one processor to cause the at least one processor to perform the method of the above embodiment. The non-transitory computer-readable storage medium of this application stores computer instructions for causing a computer to perform the method of the above embodiment.
[0097] Memory 610, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods in the above-described embodiments. Processor 620 executes the non-transitory software programs, instructions, and modules stored in memory 610 to execute various server functional applications and data processing, thereby implementing the methods in the above-described embodiments.
[0098] The memory 610 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the electronic device used to implement the method in the above embodiment, etc. In addition, the memory 610 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 610 may optionally include a memory remotely located relative to the processor 620, and these remote memories may be connected to the electronic device used to implement the method in the above embodiment via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0099] The electronic device used in the method of the above embodiment may further include: an input device 640 and an output device 650. The processor 620, the memory 610, the input device 640 and the output device 650 may be connected via a bus or other means. Figure 6 The bus connection is taken as an example.
[0100] The input device 640 can receive input digital or character information and generate key signal input related to user settings and function control of the electronic device, such as input devices such as a touch screen, a keypad, a mouse, a trackpad, a touch pad, a pointer, one or more mouse buttons, a trackball, and a joystick. The output device 650 may include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor). The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touch screen.
[0101] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" 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. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0102] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of such features. Throughout the description of this application, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0103] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.
[0104] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0105] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be performed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps in the method embodiments. The aforementioned storage medium can be a read-only memory, a magnetic disk, or an optical disk.
[0106] In addition, the functional units in the various embodiments of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into a module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0107] The above are merely preferred embodiments of the present application and do not constitute any form of limitation to the present application. Any person skilled in the art can, without departing from the scope of the technical solution of the present application, use the methods and technical contents disclosed above to make many possible changes and modifications to the technical solution of the present application, or modify it into an equivalent embodiment with equivalent changes. Therefore, all equivalent changes made based on the shape, structure and principle of the present application without departing from the content of the technical solution of the present application should be included in the scope of protection of the present application.
Claims
1. An infrared image intelligent tracing method, characterized in that: include: Acquire an infrared image to be processed, and convert the infrared image into a grayscale image; Binarizing the grayscale image using a maximum inter-class variance algorithm to generate a first binarized image; determining whether the infrared image has an input contour area, and if so, generating a mask image according to the input contour area; generating a second binarized image according to the mask image and the first binarized image; outputting the contour in the second binarized image using a contour tracking algorithm to generate an output contour area; The infrared image is stroked according to the output contour area.
2. The infrared image intelligent tracing method according to claim 1, characterized in that: The determining whether the infrared image has an input contour area includes: If not, outputting the contour in the first binarized image using a contour tracking algorithm to generate an output contour region; The infrared image is stroked according to the output contour area.
3. The infrared image intelligent tracing method according to claim 1, characterized in that: The infrared image is converted into a grayscale image using the following formula: gray=0.299*red+0.587*green+0.114*blue Where gray is the grayscale image, red is the red channel value of the infrared image, green is the green channel value of the infrared image, and blue is the blue channel value of the infrared image.
4. The infrared image intelligent tracing method according to claim 1, characterized in that: Pixels of the first binarized image are 1 or 0.
5. The infrared image intelligent tracing method according to claim 1, characterized in that: The mask image is represented as: Where, mask i,j It is a mask image, outer means that the point (i, j) is outside the input contour area, and inner means that the point (i, j) is inside the input contour area.
6. The infrared image intelligent tracing method according to claim 1, characterized in that: Pixels of the second binarized image are 1 or 0.
7. An infrared image intelligent tracing device, characterized in that: include: a conversion module, configured to obtain an infrared image to be processed and convert the infrared image into a grayscale image; A first binarization module is used to binarize the grayscale image using a maximum inter-class variance algorithm to generate a first binarized image; a judging module, configured to judge whether the infrared image has an input contour region, and if so, to generate a mask image according to the input contour region; A second binarization module, configured to generate a second binarized image based on the mask image and the first binarized image; an output module, configured to output the contour in the second binarized image using a contour tracking algorithm to generate an output contour area; A stroke module is used to stroke the infrared image according to the output contour area.
8. The infrared image intelligent tracing device according to claim 7, characterized in that: The judgment module includes: If not, outputting the contour in the first binarized image using a contour tracking algorithm to generate an output contour region; The infrared image is stroked according to the output contour area.
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 program, the method according to any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Infrared thermal imaging target tracking temperature measurement method capable of avoiding jitter interference
CN113008376A
Method and apparatus for infrared thermal image contour extraction
US20180046878A1