A human body background effective area segmentation method and device based on infrared thermal images
By using weighted average and discrete cosine transform to remove noise, and updating the threshold using grayscale histogram for infrared thermal image segmentation, the problem of numerous noise points and blurred edges is solved, achieving efficient and clear image segmentation results.
Patent Information
- Application Number
- CN202410420529.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-09
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2044-04-09
AI Technical Summary
Human background segmentation in infrared thermal images suffers from problems such as high noise and blurred edges, and existing visible light image segmentation algorithms are difficult to meet the requirements of real-time efficiency.
The weighted average algorithm and discrete cosine transform are used to remove noise. The gray level thresholds of the human body and the background are updated using the first valley gray value in the gray level histogram. Image segmentation is performed through binarization.
Significantly reduces noise, improves image quality, enhances the clarity of the separation between the human body and the background, shortens processing time, and improves processing efficiency.
Smart Images

Figure CN118379308B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and specifically to a method and apparatus for effective human background region segmentation based on infrared thermal images. Background Technology
[0002] Infrared thermal imaging technology is widely used in fire monitoring, component defect detection, and other fields, offering advantages such as wide monitoring range, fast equipment response, and small data errors. However, to obtain higher imaging quality, preprocessing of infrared thermal images is essential, with image segmentation playing a crucial role. Image segmentation is the first step in image analysis, the foundation of computer vision, and an important component of image understanding. However, due to the inherent characteristics of infrared sensors, infrared thermal images of human backgrounds typically contain a large amount of noise and poor detail in dark areas, resulting in blurred and unclear segmentation edges during image segmentation. Currently, infrared thermal images generally suffer from problems such as high noise levels and blurred image edges, hindering the widespread application of infrared thermal imaging technology. In particular, fields such as fire protection, transportation, and public safety have a high demand for infrared thermal images of human backgrounds, but current ordinary visible light image segmentation algorithms are insufficient to meet the real-time and high-efficiency requirements of infrared thermal image segmentation algorithms. Therefore, researching effective human background segmentation methods based on infrared thermal images is of great significance. Summary of the Invention
[0003] This invention addresses the technical problems existing in the prior art by providing a method and apparatus for effective human background region segmentation based on infrared thermal images.
[0004] The technical solution of the present invention to solve the above-mentioned technical problems is as follows:
[0005] In a first aspect, the present invention provides a method for effective human background region segmentation based on infrared thermal images, comprising:
[0006] Read the original image, which is an infrared thermal image of the human body background;
[0007] The pixels of the original image are reassigned using a weighted average algorithm to obtain the first grayscale image;
[0008] By utilizing the properties of the discrete cosine function, a discrete cosine transform is applied to the first grayscale image, while simultaneously filtering out high-frequency noise to obtain the second grayscale image.
[0009] A grayscale histogram is generated based on the second grayscale image. The first trough grayscale value in the grayscale histogram is extracted, and the grayscale threshold of the human body and the background is updated using the first trough grayscale value.
[0010] Based on the grayscale threshold of the human body and background regions, the second grayscale image is binarized using this threshold to perform image segmentation.
[0011] In a second aspect, the present invention provides a human body background effective region segmentation device based on infrared thermal images, comprising:
[0012] Image reading module, used to read the original image, which is a human background infrared thermal image;
[0013] The grayscale processing module reassigns the pixel values of the original image using a weighted average algorithm to obtain a first grayscale image;
[0014] The noise reduction and filtering module utilizes the properties of the discrete cosine function to apply discrete cosine transform to the first grayscale image, while simultaneously filtering out the noise in the high-frequency band to obtain the second grayscale image.
[0015] The threshold calculation module generates a grayscale histogram based on the second grayscale image, extracts the first trough grayscale value from the grayscale histogram, and uses the first trough grayscale value to update the grayscale threshold of the human body and the background.
[0016] The image segmentation module performs image segmentation by binarizing the second grayscale image based on the grayscale threshold of the human body and background regions.
[0017] Thirdly, the present invention provides an electronic device, comprising:
[0018] Memory, used to store computer software programs;
[0019] A processor is configured to read and execute the computer software program, thereby implementing the method for effective human background region segmentation based on infrared thermal images as described in the first aspect of the present invention.
[0020] Fourthly, the present invention provides a non-transitory computer-readable storage medium storing a computer software program, which, when executed by a processor, implements the method for effective human background region segmentation based on infrared thermal images as described in the first aspect of the present invention.
[0021] The beneficial effects of this invention are: through denoising processing, image noise is significantly reduced, resulting in better image quality and clearer details. Compared to traditional grayscale transformation algorithms, using the first trough grayscale value to update the grayscale thresholds for the human body and background makes the segmentation lines between the human body and background regions clearer and more accurate, leading to better image quality. Simultaneously, by segmenting the human body and background regions through image processing, the effective area for human body image processing is increased, the processing of ineffective areas is reduced, and the computation time for image processing is shortened. Therefore, this invention features low complexity, high efficiency, and short processing time. Attached Figure Description
[0022] Figure 1 A schematic flowchart of a method for effective human background segmentation based on infrared thermal images provided in an embodiment of the present invention;
[0023] Figure 2 This is an example of a grayscale histogram obtained after processing a human body image, as provided in an embodiment of the present invention.
[0024] Figure 3 A schematic diagram of a human background effective region segmentation device based on infrared thermal images provided in an embodiment of the present invention;
[0025] Figure 4 A schematic diagram of an embodiment of the electronic device provided in this invention;
[0026] Figure 5 This is a schematic diagram of an embodiment of a computer-readable storage medium provided in this invention. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] In the description of this application, 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 indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0029] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0030] like Figure 1 As shown, an embodiment of the present invention provides a method for effective human background region segmentation based on infrared thermal images, comprising:
[0031] S100, Read the original image, which is a human body background infrared thermal image. Acquire a human body color RGB image Y with background from the infrared device.
[0032] S200, the pixels of the original image are reassigned using a weighted average algorithm to obtain a first grayscale image.
[0033] A grayscale image algorithm is used to transform the aforementioned RGB color human body image into grayscale, resulting in a first grayscale image y with a background. The grayscale image algorithm employs a weighted average method.
[0034] Gray=0.299×R+0.587×G+0.114×B (1)
[0035] In the formula, Gray represents the gray value of a pixel px in the first grayscale image y, R represents the red component of the pixel value of pixel px in the RGB image Y, G represents the green component of the pixel value of pixel px in the RGB image Y, and B represents the blue component of the pixel value of pixel px in the RGB image Y.
[0036] S300 utilizes the properties of the discrete cosine function to apply discrete cosine transform to the first grayscale image, while simultaneously filtering out high-frequency noise to obtain the second grayscale image.
[0037] The discrete cosine transform is shown in the following equation:
[0038]
[0039] In the formula, M and N are the row and column sizes of the first grayscale image, respectively.
[0040] S400, Generate a grayscale histogram based on the second grayscale image, extract the first trough grayscale value from the grayscale histogram, and use the first trough grayscale value to update the grayscale threshold of the human body and the background.
[0041] The method of updating the gray level thresholds of the human body and the background using the first trough gray value includes:
[0042] The grayscale threshold is limited to the range (0, a), and is calculated using the following formula:
[0043]
[0044] In the formula, A is the gray level threshold to be updated, c = 0, d = b = 255, and a is the first trough gray value in the gray level histogram.
[0045] Figure 2 An example of a grayscale histogram obtained after processing a human body image, provided as an embodiment of the present invention. For example... Figure 2 As shown, the corresponding first trough gray value is 65, which is the gray level threshold between the human image and the background area. Using the gray-level transformation method, the gray level threshold is updated to obtain a new gray level threshold A = 35, and the gray level range of the human image is expanded from [65, 255] to [35, 255]. The idea of the algorithm in equation (3) is to retain part of the background area for the expanded background overlay, thereby enhancing the segmentation line between the human body and the background area.
[0046] S500, based on the gray level threshold of the human body and background region, the second gray level image is binarized using the threshold to perform image segmentation.
[0047] By processing the human image Y, most of the noise in the image is filtered out, and the grayscale level of the image is expanded from the 65-255 range to the 35-255 range, enhancing the visual effect of the image. The image segmentation uses the new algorithm of formula (3) to superimpose the expanded background with the original retained background, enhancing the edge segmentation line. The binary image segments the human body and background regions well and accurately, obtaining the maximum effective area for human image processing. In addition, the background region is removed after image segmentation, that is, compared with processing the whole image, processing only the segmented image maximizes the effective area of the processed image, greatly reducing the computation time for subsequent image processing. Therefore, the present invention has the characteristics of low computational complexity, high efficiency, and short processing time.
[0048] Based on the above method embodiments, the present invention also provides a device for effective human background region segmentation based on infrared thermal images, such as... Figure 3 The above includes:
[0049] Image reading module, used to read the original image, which is a human background infrared thermal image;
[0050] The grayscale processing module reassigns the pixel values of the original image using a weighted average algorithm to obtain a first grayscale image;
[0051] The noise reduction and filtering module utilizes the properties of the discrete cosine function to apply discrete cosine transform to the first grayscale image, while simultaneously filtering out the noise in the high-frequency band to obtain the second grayscale image.
[0052] The threshold calculation module generates a grayscale histogram based on the second grayscale image, extracts the first trough grayscale value from the grayscale histogram, and uses the first trough grayscale value to update the grayscale threshold of the human body and the background.
[0053] The image segmentation module performs image segmentation by binarizing the second grayscale image based on the grayscale threshold of the human body and background regions.
[0054] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating an embodiment of the electronic device provided in this invention. For example... Figure 4 As shown, this embodiment of the invention provides an electronic device 500, including a memory 510, a processor 520, and a computer program 511 stored in the memory 510 and executable on the processor 520. When the processor 520 executes the computer program 511, it performs the following steps:
[0055] Read the original image, which is an infrared thermal image of the human body background;
[0056] The pixels of the original image are reassigned using a weighted average algorithm to obtain the first grayscale image;
[0057] By utilizing the properties of the discrete cosine function, a discrete cosine transform is applied to the first grayscale image, while simultaneously filtering out high-frequency noise to obtain the second grayscale image.
[0058] A grayscale histogram is generated based on the second grayscale image. The first trough grayscale value in the grayscale histogram is extracted, and the grayscale threshold of the human body and the background is updated using the first trough grayscale value.
[0059] Based on the grayscale threshold of the human body and background regions, the second grayscale image is binarized using this threshold to perform image segmentation.
[0060] Please see Figure 5 , Figure 5 This is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by an embodiment of the present invention. For example... Figure 5As shown, this embodiment provides a computer-readable storage medium 600, on which a computer program 611 is stored. When the computer program 611 is executed by a processor, it performs the following steps:
[0061] Read the original image, which is an infrared thermal image of the human body background;
[0062] The pixels of the original image are reassigned using a weighted average algorithm to obtain the first grayscale image;
[0063] By utilizing the properties of the discrete cosine function, a discrete cosine transform is applied to the first grayscale image, while simultaneously filtering out high-frequency noise to obtain the second grayscale image.
[0064] A grayscale histogram is generated based on the second grayscale image. The first trough grayscale value in the grayscale histogram is extracted, and the grayscale threshold of the human body and the background is updated using the first trough grayscale value.
[0065] Based on the grayscale threshold of the human body and background regions, the second grayscale image is binarized using this threshold to perform image segmentation.
[0066] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0067] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0068] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0069] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0070] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0071] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0072] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for effective human background region segmentation based on infrared thermal images, characterized in that, include: Read the original image, which is an infrared thermal image of the human body background; The pixels of the original image are reassigned using a weighted average algorithm to obtain the first grayscale image; By utilizing the properties of the discrete cosine function, a discrete cosine transform is applied to the first grayscale image, while simultaneously filtering out high-frequency noise, to obtain the second grayscale image. The discrete cosine transform is shown in the following equation: ; In the formula, , M and N are the row and column sizes of the first grayscale image, respectively; A grayscale histogram is generated based on the second grayscale image. The first trough grayscale value in the grayscale histogram is extracted, and the grayscale threshold of the human body and the background is updated using the first trough grayscale value. The method of updating the gray level thresholds of the human body and the background using the first trough gray value includes: The range of grayscale threshold values is limited to (0, ...). a The grayscale threshold is calculated using the following formula: ; In the formula, A The grayscale threshold to be updated. c =0, d = b =255, a The gray value of the first trough in the gray-scale histogram; Based on the grayscale threshold of the human body and background regions, the second grayscale image is binarized using this threshold to perform image segmentation.
2. The method according to claim 1, characterized in that, The pixels of the original image are reassigned using the following formula: Gray=0.299×R+0.587×G+0.114×B; In the formula, Gray represents the gray value of a certain pixel px in the original image after reassignment, R represents the red component of the pixel value of pixel px in the original image, G represents the green component of the pixel value of pixel px in the original image, and B represents the blue component of the pixel value of pixel px in the original image.
3. A device for effective human body background region segmentation based on infrared thermal images, characterized in that, include: Image reading module, used to read the original image, which is a human background infrared thermal image; The grayscale processing module reassigns the pixel values of the original image using a weighted average algorithm to obtain a first grayscale image; The noise reduction filtering module utilizes the properties of the discrete cosine function to apply a discrete cosine transform to the first grayscale image, simultaneously filtering out high-frequency noise to obtain the second grayscale image. The discrete cosine transform is shown in the following equation: ; In the formula, , M and N are the row and column sizes of the first grayscale image, respectively; The threshold calculation module generates a grayscale histogram based on the second grayscale image, extracts the first trough grayscale value from the grayscale histogram, and uses the first trough grayscale value to update the grayscale threshold of the human body and the background. The method of updating the gray level thresholds of the human body and the background using the first trough gray value includes: The range of grayscale threshold values is limited to (0, ...). a The grayscale threshold is calculated using the following formula: ; In the formula, A The grayscale threshold to be updated. c =0, d = b =255, a The gray value of the first trough in the gray-scale histogram; The image segmentation module performs image segmentation by binarizing the second grayscale image based on the grayscale threshold of the human body and background regions.
4. The apparatus according to claim 3, characterized in that, The pixels of the original image are reassigned using the following formula: Gray=0.299×R+0.587×G+0.114×B; In the formula, Gray represents the gray value of a certain pixel px in the original image after reassignment, R represents the red component of the pixel value of pixel px, G represents the green component of the pixel value of pixel px, and B represents the blue component of the pixel value of pixel px.
5. An electronic device, characterized in that, include: Memory, used to store computer software programs; A processor is configured to read and execute the computer software program, thereby implementing the method for effective human background region segmentation based on infrared thermal images as described in any one of claims 1-2.
6. A non-transitory computer-readable storage medium, characterized in that, The storage medium stores a computer software program, which, when executed by a processor, implements a method for effective human background region segmentation based on infrared thermal images as described in any one of claims 1-2.
Citation Information
Patent Citations
A method for extracting human body region in CT image
CN109087296A
Image enhancement method and system based on double histogram equalization
CN116402729A
