CN113269760A - Infrared image heat source area detection method and device, electronic device and storage medium - Google Patents

Infrared image heat source area detection method and device, electronic device and storage medium Download PDF

Info

Publication number
CN113269760A
CN113269760A CN202110601321.7A CN202110601321A CN113269760A CN 113269760 A CN113269760 A CN 113269760A CN 202110601321 A CN202110601321 A CN 202110601321A CN 113269760 A CN113269760 A CN 113269760A
Authority
CN
China
Prior art keywords
color
infrared image
pixel
color band
determining
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
CN202110601321.7A
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.)
Beijing Minglue Zhaohui Technology Co Ltd
Original Assignee
Beijing Minglue Zhaohui Technology 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 Beijing Minglue Zhaohui Technology Co Ltd filed Critical Beijing Minglue Zhaohui Technology Co Ltd
Priority to CN202110601321.7A priority Critical patent/CN113269760A/en
Publication of CN113269760A publication Critical patent/CN113269760A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J5/00Radiation pyrometry, e.g. infrared or optical thermometry
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01VGEOPHYSICS; GRAVITATIONAL MEASUREMENTS; DETECTING MASSES OR OBJECTS; TAGS
    • G01V8/00Prospecting or detecting by optical means
    • G01V8/10Detecting, e.g. by using light barriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J5/00Radiation pyrometry, e.g. infrared or optical thermometry
    • G01J2005/0077Imaging
    • 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/10024Color image
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Life Sciences & Earth Sciences (AREA)
  • Geophysics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Quality & Reliability (AREA)
  • Radiation Pyrometers (AREA)

Abstract

The application relates to an infrared image heat source area detection method and device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring an infrared image needing to be subjected to heat source position determination; determining color bands corresponding to all pixels in the infrared image; obtaining the pixel proportion of all pixels corresponding to each color band in all pixels of the infrared image by determining the pixels in the infrared image corresponding to each color band; and when the pixel ratio corresponding to each color band is judged to meet the preset requirement, determining that a heat source area exists in the infrared image. The method provided by the embodiment of the application only needs to determine the color band corresponding to each pixel in the infrared image and acquire the pixel proportion corresponding to each color band, and then determines whether the heat source area exists in the infrared image according to the pixels of the color bands, and then can quickly analyze whether the heat source area exists in the infrared image phase without carrying out complex mathematical transformation.

Description

Infrared image heat source area detection method and device, electronic device and storage medium
Technical Field
The present disclosure relates to the field of infrared detection technologies, and in particular, to a method and an apparatus for detecting an infrared image heat source area, an electronic device, and a storage medium.
Background
The infrared imaging device is often used for judging whether a heat source exists in the environment, and is widely applied to the fields of military affairs, metallurgy and fire fighting. The infrared device can generate a large amount of infrared images, and how to automatically judge whether a heat source exists in the infrared images and determine the position information of the heat source becomes an important topic for the research of the infrared images. The infrared image is different from the natural image, has no clear edge details and texture structure, and can only represent a heating object by means of color change. Most of the existing image identification methods rely on edge information to calculate image elements such as gradients, so that most of identification methods based on natural images are not outstanding in performance on infrared images, and therefore related technologies cannot accurately identify whether heat sources exist in the infrared images.
From the above, the infrared image heat source region detection method in the related art has the technical problem that whether the heat source exists in the infrared image cannot be accurately identified.
Disclosure of Invention
In order to solve the technical problem that whether a heat source exists in an infrared image cannot be accurately identified, the application provides an infrared image heat source area detection method and device, an electronic device and a storage medium.
In a first aspect, an embodiment of the present application provides a method for detecting an infrared image heat source region, including:
acquiring an infrared image needing to be subjected to heat source position determination;
determining color bands corresponding to pixels in the infrared image, wherein the color bands are used for indicating temperature ranges, the temperature difference of the temperature range corresponding to each color band is the same, and the color of the pixel corresponding to each color band is one of all colors included in the color bands;
obtaining the pixel proportion of all pixels corresponding to each color band in all pixels of the infrared image by determining the pixels in the infrared image corresponding to each color band;
and when the pixel proportion corresponding to each color band is judged to meet the preset requirement, determining that a heat source area exists in the infrared image.
Optionally, as in the foregoing method, before the determining the color bands corresponding to the respective pixels in the infrared image, the method further includes:
determining a temperature bar for identifying the infrared image, wherein each color in the temperature bar is to indicate a unique temperature;
and uniformly dividing the temperature strips according to the number of preset color bands to obtain at least two color bands.
Optionally, as in the foregoing method, the determining color bands corresponding to the respective pixels in the infrared image includes:
performing the following steps for any one of the pixels in the infrared image:
calculating the sum of a red value, a green value and a blue value in the RBG value of the color of the pixel to obtain the color component sum of the pixel;
for each color bar, calculating the color component sum of each color included by the color bar according to the RBG value of each color included by the color bar; calculating the average value of the color component sums of the color bands according to the number of the colors included in the color bands to obtain the average value of the color components of the color bands;
and determining the color band corresponding to the pixel in all the color bands based on the color components of the pixel and the average value of the color components of each color band.
Optionally, as in the foregoing method, when the pixel proportion corresponding to each color band meets a preset requirement, the determining that a heat source region exists in the infrared image includes:
determining a first color band set in all the color bands according to the pixel proportion corresponding to each color band, wherein the sum of the pixel proportions of the color bands in the first color band set is greater than or equal to a first preset threshold value, and the temperature indicated by the color bands in the first color band set is higher than the temperatures indicated by other color bands except the first color band set in the infrared image;
determining a second color band set in all the color bands according to the pixel occupation ratio of each color band, wherein the sum of the pixel occupation ratios of the color bands in the second color band set is greater than or equal to a second preset threshold value, and the temperature indicated by the color bands in the second color band set is lower than the temperature indicated by other color bands except the second color band set in the infrared image;
determining that the heat source region exists in the infrared image when a color band difference between a first target color band in the first color band set and a second target color band in the second color band set is greater than or equal to a third preset threshold, wherein the first target color band is a color band with the lowest indicated temperature in all color bands in the first color band set, the second target color band is a color band with the highest indicated temperature in all color bands in the second color band set, the color band difference is used for indicating the number of color bands separated between the first target color band and the second target color band, and the temperature indicated by the separated color bands is lower than the temperature indicated by the first target color band and higher than the temperature indicated by the second target color band.
Optionally, as in the foregoing method, after the determining that the heat source region exists in the infrared image, the method further includes:
and determining the heat source area in the infrared image according to the distribution condition of target pixels in the infrared image, wherein the target pixels are pixels corresponding to color bands in the first color band set.
Optionally, as in the foregoing method, the determining, according to the distribution of the target pixels in the infrared image, the heat source area in the infrared image includes:
determining the remaining pixels in the infrared image except the target pixel;
determining a saturation value of the target pixel and determining a saturation value of the remaining pixels;
performing binarization processing on the infrared image to obtain a binarized image, wherein the pixel value of a first pixel corresponding to the target pixel in the binarized image is a first preset value after the saturation component value of the target pixel is binarized, and the pixel value of a second pixel corresponding to the target pixel in the binarized image is a second preset value after the saturation component value of the residual pixel is binarized;
and determining the heat source area in the infrared image based on the first pixel and the second pixel in the binary image.
Optionally, as in the foregoing method, the determining, in the infrared image, the heat source region based on the first pixel and the second pixel in the binarized image includes:
determining a target area in the binary image according to a first preset value of the first pixel and a second preset value of the second pixel by using an expansion corrosion method, wherein the density of the first pixel assigned as the first preset value in the target area is higher than a preset threshold value;
and determining the heat source area in the infrared image according to the position information of the target area.
In a second aspect, an embodiment of the present application provides an infrared image heat source area detection apparatus, including:
the acquisition module is used for acquiring an infrared image needing to be subjected to heat source position determination;
the infrared image processing device comprises a corresponding module, a processing module and a display module, wherein the corresponding module is used for determining color bands corresponding to pixels in the infrared image, the color bands are used for indicating temperature ranges, the temperature difference of the temperature ranges corresponding to the color bands is the same, and the color of the pixel corresponding to the color band is one of all colors included in the color bands for each color band;
the proportion module is used for obtaining the pixel proportion of all the pixels corresponding to each color band in all the pixels of the infrared image by determining the pixels in the infrared image corresponding to each color band;
and the determining module is used for determining that a heat source area exists in the infrared image when the pixel occupation ratio corresponding to each color band meets the preset requirement.
In a third aspect, an embodiment of the present application provides an electronic device, including: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory is used for storing a computer program;
the processor, when executing the computer program, is configured to implement the method according to any of the preceding claims.
In a fourth aspect, the present application provides a computer-readable storage medium, which includes a stored program, where the program is executed to perform the method according to any one of the preceding claims.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
the method provided by the embodiment of the application only needs to determine the color band corresponding to each pixel in the infrared image and acquire the pixel proportion corresponding to each color band, and then determines whether the heat source area exists in the infrared image according to the pixels of the color bands, and then can quickly analyze whether the heat source area exists in the infrared image phase without carrying out complex mathematical transformation.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a flowchart of a method for detecting an infrared image heat source area according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a method for detecting a heat source region of an infrared image according to another embodiment of the present application;
fig. 3 is a flowchart of a method for detecting a heat source region of an infrared image according to another embodiment of the present application;
FIG. 4 is a flowchart of a method for detecting a heat source region of an infrared image according to another embodiment of the present application;
FIG. 5 is a flowchart of a method for detecting a heat source region of an infrared image according to another embodiment of the present application;
fig. 6 is a block diagram of an infrared image heat source area detection device according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
According to an aspect of an embodiment of the present application, there is provided an infrared image heat source region detection method. Alternatively, in this embodiment, the infrared image heat source region detection method may be applied to a hardware environment formed by a terminal and/or a server. The server is connected with the terminal through a network, can be used for providing services for the terminal or a client installed on the terminal, and can be provided with a database on the server or independently of the server for providing data storage services for the server.
The network may include, but is not limited to, at least one of: wired networks, wireless networks. The wired network may include, but is not limited to, at least one of: wide area networks, metropolitan area networks, local area networks, which may include, but are not limited to, at least one of the following: WIFI (Wireless Fidelity), bluetooth. The terminal may not be limited to a PC, a mobile phone, a tablet computer, and the like.
The infrared image heat source area detection method in the embodiment of the application may be executed by a server, a terminal, or both the server and the terminal. The terminal executing the infrared image heat source area detection method according to the embodiment of the present application may also be executed by a client installed thereon.
Taking the method for detecting the heat source area of the infrared image in the embodiment executed by the terminal as an example, fig. 1 is a method for detecting the heat source area of the infrared image provided in the embodiment of the present application, and includes the following steps:
and step S101, acquiring an infrared image needing to be subjected to heat source position determination.
The infrared image heat source area detection method in this embodiment may be applied to a scene in which it is necessary to determine whether a heat source area exists in an infrared image acquired by an infrared camera, and may also determine whether a heat source area exists in an infrared image acquired by another device.
The heat source location may be a location in the infrared image where a higher temperature is indicated relative to the environment in which the infrared image was acquired. For example, in the case where the environment in which the infrared image is captured is a human activity environment, the heat source position may be a position of a person in which the infrared image is captured; in the case where the environment in which the infrared image is captured is a running computing device, the heat source location may be the location of a CPU or GPU or the like in which the infrared image is captured.
After the infrared camera acquires the infrared image, the terminal executing the method of the present embodiment may acquire the infrared image from the infrared camera.
Step S102, determining color bands corresponding to pixels in the infrared image, where the color bands are used to indicate temperature ranges, the temperature difference of the temperature range corresponding to each color band is the same, and for each color band, the color of the pixel corresponding to the color band is one of all colors included in the color band.
After the infrared image is acquired, each pixel in the infrared image needs to be analyzed to determine whether a heat source area exists.
Since the infrared image indicates the temperature of different objects by different colors, each pixel has a corresponding color. For example, various temperatures from a specified high temperature to a specified low temperature may be indicated by various colors that fade from yellow to purple.
The color bar may be a color bar made up of a plurality of colors with gradations for indicating a range of temperatures. For example, the color band 1 may be graded from yellow to orange to indicate a temperature range corresponding to 50 ℃ to 41 ℃, with a temperature difference of 9 ℃ (i.e., 50 ℃ -41 ℃ ═ 9 ℃), and the color band 2 may be graded from orange to red to indicate a temperature range corresponding to 40 ℃ to 31 ℃, with a temperature difference of 9 ℃ (i.e., 40 ℃ -31 ℃ ═ 9 ℃), and generally, there is no intersection in the colors between different color bands, and thus, the temperature range indicated by each color band is also different, but the temperature difference indicated by each color band is the same.
Since the color bands include all colors transitioning between two colors, and each pixel displays only one color, a pixel necessarily corresponds to a unique color band, and one color band may correspond to a plurality of pixels.
Step S103, obtaining the pixel ratio of all pixels corresponding to each color band in all pixels of the infrared image by determining the pixels in the infrared image corresponding to each color band.
After determining the color band corresponding to each pixel, the pixels in the infrared image corresponding to each color band can be determined, so that the number of all the pixels corresponding to each color band can be obtained, and then the pixel proportion of all the pixels corresponding to each color band in all the pixels of the infrared image can be obtained according to the total number of the pixels in the infrared image.
For example, when the infrared image is an image having a resolution of 300 × 400 and the number of pixels corresponding to color band 1 is 1200, the pixel ratio of all pixels corresponding to color band 1 in all pixels of the infrared image is 6000/(300 × 400) — 0.05.
And step S104, determining that a heat source area exists in the infrared image when the pixel ratio corresponding to each color band meets the preset requirement.
After the pixel ratio corresponding to each color band is obtained, and when the pixel ratio corresponding to each color band is judged to meet the preset requirement, the heat source area in the infrared image can be determined.
The preset requirement may be a condition for determining that a heat source region exists in the infrared image and that the pixel ratio corresponding to the color band is related. For example, the preset requirements may be: at least one pixel proportion corresponding to the color band with the highest indicated temperature range reaches a first preset lower limit; or the pixel occupation ratio corresponding to at least one color band with the highest indicated temperature range reaches a second preset lower limit, the pixel occupation ratio corresponding to at least one color band with the lowest indicated temperature range reaches a third preset lower limit, and the like. And otherwise, when the pixel ratio corresponding to each color band meets the preset requirement, determining that a heat source area exists in the infrared image.
Therefore, by adopting the method in the embodiment, only the color band corresponding to each pixel in the infrared image needs to be determined, the pixel proportion corresponding to each color band is obtained, whether the heat source area exists in the infrared image is determined according to the pixels of the color bands, and whether the heat source area exists in the infrared image phase can be rapidly analyzed without performing complex mathematical transformation.
As an alternative embodiment, as shown in fig. 2, before determining color bands corresponding to each pixel in the infrared image in step S101, the method further includes the following steps:
step S201, determining a temperature bar for identifying the infrared image, wherein each color in the temperature bar is used for indicating a unique temperature.
The infrared image is an image indicating different temperatures by different colors, and therefore, a temperature bar set when the infrared image is photographed needs to be determined in advance before the infrared image is photographed. The temperature bars indicate the color to which each temperature corresponds, and there is a one-to-one correspondence between temperature and color. For example, the temperature bar may be a color image that fades from yellow to violet.
Step S202, the temperature strips are evenly divided according to the number of preset color bands to obtain at least two color bands.
After the temperature bars are obtained, a plurality of color bands can be obtained based on the temperature bars.
The number of preset ribbons may be a predetermined number of ribbons that need to be obtained. Optionally, the temperature bar covers various colors that the infrared image can present, and the collected temperature bar changes from yellow to purple, representing a temperature from high to low. Since the color on the temperature bar is gradual, the start-stop range of one color cannot be strictly defined. It is therefore possible to divide the temperature bar into n color bands uniformly from one end of the temperature bar along the direction of the color gradation. Assuming that the number of pixels in the color gradation direction is N, the number of color bars d is N/N, where d is the number of pixels per color bar in the color gradation direction on average, and in general, N may be evenly divided by N in order to make the number of pixels per color bar uniform.
By the method in the embodiment, a plurality of color bands can be rapidly divided, and each color band can be in continuous transition in color, so that each pixel in the infrared image can correspond to the color band comprising the color of the pixel.
As an alternative embodiment, as shown in fig. 3, the step S102 of determining color bands corresponding to each pixel in the infrared image according to the foregoing method includes the following steps:
the following steps are performed for any pixel in the infrared image:
in step S301, the sum of the red value, the green value, and the blue value in the RBG value of the color of the pixel is calculated to obtain the color component sum of the pixel.
After the infrared image is acquired, the RGB values of the color displayed by each pixel can be determined (RGB color mode is a color standard in the industry, and various colors are obtained by changing three color channels of red (R), green (G) and blue (B) and superimposing the three color channels on each other).
After determining the RGB values corresponding to the pixels, the red, green, and blue values corresponding to the pixels can be determined, and finally the red, green, and blue values are added to obtain the color component sum of the pixels.
For example, the color component sum s corresponding to the pixel can be calculated according to the following formulapi
spi=rpi+gpi+bpi
When the color of the pixel a is yellow, its RGB value is (255,255,0), i.e., the red value, the green value, and the blue value are 255, and 0, respectively, and thus the resulting color component sum is 510.
Step S302, for each color bar, calculating and obtaining the color component sum of each color included by the color bar according to the RBG value of each color included by the color bar; and calculating the average value of the color component sums of the color bands according to the number of the colors included in the color bands to obtain the average value of the color components of the color bands.
After each color bar is determined, for each color bar, the color component sum of each color included in the color bar can be calculated for the RBG value of each color included in the color bar. Alternatively, the pixels in the color bands included in the color bands may be determined, and then the RBG value of the color of the pixel in each color band may be obtained, wherein the corresponding color component sum of the pixels in each color band may be calculated as shown in the example in step S301.
After the color component sums of each color are obtained, the color component sums of the respective colors may be averaged, thereby obtaining the color component average of the color band.
For example, the color component average s of the color band can be calculated by the following formulaBj
Figure BDA0003093095060000111
Wherein K is a color band BjThe number of pixels in the color band in (b).
Because the color of the pixels in each color band only changes along the direction of color gradual change, and the number of the pixels in each row of the color bands is the same, when the color of the pixels in the color bands changes along the longitudinal direction, only one color band pixel in each row of the color bands can be taken to calculate the color component sum, the color component sum calculation of all the color band pixels is not needed, namely, only one color component sum is calculated for each color, and the accuracy of the obtained color component average value of the color bands can still be ensured.
In step S303, based on the color component sum of the pixel and the average value of the color component of each color band, the color band corresponding to the pixel is determined in all the color bands.
After the color component sum of the pixel and the color component average value of each color band are calculated, the color band corresponding to the pixel can be determined in all the color bands by judging the color component sum of the pixel and which color band the color component average value of.
For example, it can be calculated by the following formula
Figure BDA0003093095060000121
Color band fj
Figure BDA0003093095060000122
That is, the color component average value closest to the color component sum of the pixel is determined among all the color component average values. And then, taking the color band corresponding to the target color component average value as the color band corresponding to the pixel.
By the method in the embodiment, the color bands corresponding to the pixels can be quickly determined in all the color bands, and the efficiency of integrally determining the heat source area can be improved.
As an alternative implementation manner, as in the foregoing method, when it is determined that the pixel ratio corresponding to each color band satisfies the preset requirement in step S104, determining that a heat source area exists in the infrared image includes the following steps:
step S401, determining a first color band set from all color bands according to the pixel ratio corresponding to each color band, where a sum of the pixel ratios of each color band in the first color band set is greater than or equal to a first preset threshold, and a temperature indicated by the color band in the first color band set is higher than temperatures indicated by other color bands except the first color band set in the infrared image.
After the pixel ratio corresponding to each color band is obtained, the ratio of the pixel corresponding to each color band in the infrared image can be determined.
The first color band set may include one or more color bands, and the first color band set is a set of color bands which have the highest indicated temperature and the sum of pixel ratios greater than or equal to a first preset threshold value, among the color bands corresponding to the infrared image (the color bands corresponding to any pixel in the infrared image are the color bands corresponding to the infrared image). The sum of the pixel ratios is the sum of the pixel ratios corresponding to each color band in the first color band set.
The first preset threshold may be a preset value of the minimum pixel ratio corresponding to the sum of the pixel ratios of the color bands in the first color band set.
The pixel ratios corresponding to the color bands can be respectively determined according to the sequence from high to low of the indicated temperature, and then the pixel ratios are sequentially accumulated until the sum of the pixel ratios is greater than a first preset threshold value, so that a first color band set can be obtained according to the color bands traversed.
Step S402, according to the pixel proportion of each color band, determining a second color band set in all the color bands, wherein the sum of the pixel proportions of the color bands in the second color band set is greater than or equal to a second preset threshold value, and the temperature indicated by the color bands in the second color band set is lower than the temperature indicated by other color bands except the second color band set in the infrared image;
one or more color bands may be included in the second color band set, and the second color band set is a set of color bands with the lowest indicated temperature and the sum of pixel ratios greater than or equal to a second preset threshold in the color band corresponding to the infrared image (the color band corresponding to any pixel in the infrared image is the color band corresponding to the infrared image). The sum of the pixel ratios is the sum of the pixel ratios corresponding to each color band in the second set of color bands.
The second predetermined threshold may be a predetermined value of the minimum pixel fraction corresponding to the sum of the pixel fractions of the color bands in the second set of color bands.
The pixel ratios corresponding to the color bands can be respectively determined according to the sequence from low to high of the indicated temperature, and then the pixel ratios are sequentially accumulated until the sum of the pixel ratios is greater than a second preset threshold value, so that a second color band set can be obtained according to the color bands traversed to.
In step S403, it is determined that a heat source region exists in the infrared image when a color band difference between a first target color band in the first color band set and a second target color band in the second color band set is greater than or equal to a third preset threshold, where the first target color band is a color band with the lowest indicated temperature in all color bands in the first color band set, the second target color band is a color band with the highest indicated temperature in all color bands in the second color band set, the color band difference is used to indicate the number of color bands spaced between the first target color band and the second target color band, and the temperature indicated by the spaced color bands is lower than the temperature indicated by the first target color band and higher than the temperature indicated by the second target color band.
Since most of the color bands in an infrared image are not cold but not hot (in the case of containing no heat-generating object, the color bands are almost not different and all appear as one color, namely, not cold but not hot. if there is a heat-generating object, there is a difference between the color bands, where the heat-generating object exists and the hottest color band, there is no part of the heat-generating object, and relatively cold), the proportion of the hot color bands and the cold color bands is very small, and thus it can be specified by 10% which color bands belong to the hot color bands and which color bands belong to the cold color bands. When the color band difference between the first target color band and the second target color band is large, the probability that the heat-generating object exists in the infrared image is high, and if the color band difference is small, the heat-generating object is proved to be absent.
The third preset threshold may be a preset number of color bands with the least separation between the hottest color band (i.e., the first set of color bands) and the coldest color band (i.e., the second set of color bands).
Optionally, the sum of the pixel ratios of the color bands in the first color band set can be greater than the first preset threshold P1(e.g., 10%) of the bands are thermal bands, i.e., { B }1,B2,…,BhSatisfy thermal color band
Figure BDA0003093095060000141
Similarly, the sum of the pixel ratios of the color bands in the second set of color bands can be larger than the second preset threshold P2(e.g., 10%) of the color bands are cold color bands, i.e., { B }c,…,BnSatisfy cold color band
Figure BDA0003093095060000142
And judging that a heat source area exists in the image if the color band difference c-h between the hot color band and the cold color band is larger than or equal to T, and the T is a third preset threshold value, otherwise, judging that no heat source area exists.
For example, after the first set of color bands and the second set of color bands are determined in the infrared image, the color band difference between the first set of color bands and the second set of color bands may be determined. Also, the color bar difference may be a number of color bars spaced between a first target color bar in the first set of color bars and a second target color bar in the second set of color bars. For example, when n color bands are obtained by dividing the temperature bar, the color bands are sequentially as follows according to the temperature from high to low: color tape 1, color tape 2, color tape 3, color tape 4 …, color tape n (n-1); and the pixel ratios corresponding to color band 1, color band 2, color band 3, color band 4 … color band (n-1), color band n are: 2%, 6%, 2%, 5% … 5%, 10% of the first predetermined threshold value and 10% of the second predetermined threshold value, the sum of the pixel ratios of the first color band set composed of the color band 1, the color band 2, and the color band 3 reaches 10%, and the sum of the pixel ratios of the second color band set composed of the color band (n-1) and the color band n also reaches 10%; if the third preset threshold is 3, when the color band difference between the color band 3 and the color band (n-1) is greater than or equal to 3 (i.e., (n-1) -3 ≧ 3), it can be determined that the heat source region exists in the infrared image.
By the method in the embodiment, whether the heat source area exists in the infrared image can be quickly determined based on the pixel occupation ratio corresponding to each color band, and the judging efficiency can be effectively improved.
As an alternative implementation manner, as in the foregoing method, after determining that the heat source region exists in the infrared image in step S104, the method further includes the following steps:
step S501, determining a heat source region in the infrared image according to a distribution of target pixels in the infrared image, where the target pixels are pixels corresponding to color bands in the first color band set.
After the first color band set corresponding to the infrared image is determined, the heat source area may be determined in the infrared image based on the pixels corresponding to the color bands in the first color band set.
The target pixels are pixels corresponding to color bands in the first color band set, and therefore, all the target pixels can be determined by determining all the pixels corresponding to each color band in the first color band set.
Because each pixel in the infrared image is located at the designated position, the position of each target pixel in the infrared image can be obtained, and further the distribution condition of the target pixels in the infrared image is determined, based on the distribution condition, the region where the target pixels in the infrared image are gathered can be obtained, and generally, the region with higher gathering degree of the target pixels is higher in probability of being the heat source region, so that the heat source region can be determined in the infrared image according to the distribution condition of the target pixels in the infrared image.
By the method in the embodiment, the position of the heat source region can be rapidly determined in the infrared image based on the target pixel, and the positioning efficiency can be effectively improved.
As shown in fig. 4, as an alternative implementation manner, as in the foregoing method, the step S501 of determining the heat source area in the infrared image according to the distribution of the target pixels in the infrared image includes the following steps:
in step S601, remaining pixels in the infrared image except the target pixel are determined.
After the target pixel in the infrared image is determined, the remaining pixels except the target pixel can be determined.
In step S602, the saturation value of the target pixel is determined, and the saturation values of the remaining pixels are determined.
After the target pixel and the remaining pixels are determined in the infrared image, the color characteristics are described by using H, S, I three parameters based on an HSI color space (HIS (Hue-Saturation-Intensity) color model, wherein H defines the frequency of the color and is called Hue, S represents the depth of the color and is called Saturation, and I represents the Intensity or brightness), and the heat source area and the non-heat source area have obvious difference on the Saturation component S, so that the infrared image can be firstly converted into the HSI color space from the RGB color space, then the Saturation component value of the target pixel is determined, and the Saturation component value of the remaining pixels is determined.
Step S603, performing binarization processing on the infrared image to obtain a binarized image, where a pixel value of a first pixel corresponding to the target pixel in the binarized image is a first preset value after binarization of the saturation component value of the target pixel, and a pixel value of a second pixel corresponding to the target pixel in the binarized image is a second preset value after binarization of the saturation component value of the remaining pixels.
After the saturation value of the target pixel is obtained and the saturation value of the remaining pixels is determined, in order to further distinguish the target pixel from the remaining pixels, binarization processing can be performed on the infrared image according to a known segmentation idea to obtain a binarized image, wherein the size of the binarized image is consistent with that of the infrared image. A first pixel corresponding to the target pixel in the binarized image is a pixel with the position consistent with the target pixel, a second pixel corresponding to the target pixel in the binarized image is a pixel with the position consistent with the residual pixel, the pixel value of the first pixel is obtained after the saturation component value of the corresponding target pixel is binarized into a first preset value (namely, the first preset value), and the pixel value of the second pixel is obtained after the saturation component value of the corresponding residual pixel is binarized into a second preset value (namely, the second preset value).
For example, a binarized image may be obtained by binarizing the pixel value of the target pixel to 255 and binarizing the pixel values of the remaining pixels to 0.
Step S604 is to determine a heat source region in the infrared image based on the first pixel and the second pixel in the binarized image.
After the first pixel and the second pixel in the binarized image are determined, the first pixels with the pixel values being the first preset values are connected based on the pixel values of the first pixel and the second pixel to obtain a sheet-shaped area formed by connecting target pixels, and a heat source area corresponding to the sheet-shaped area is obtained in the infrared image based on the sheet-shaped area.
By the method in the embodiment, the heat source region can be quickly determined in the infrared image based on a binarization mode, and the positioning efficiency is further improved.
As shown in fig. 5, as an alternative implementation manner, in the foregoing method, the step S604 of determining the heat source region in the infrared image based on the first pixel and the second pixel in the binarized image includes the following steps:
step S701, determining a target area in the binary image according to a first preset value of the first pixel and a second preset value of the second pixel by an expansion corrosion method, wherein the density of the first pixel assigned as the first preset value in the target area is higher than a preset threshold value;
after the binarized image corresponding to the infrared image is obtained, the target area can be determined in the binarized image based on whether the pixel value of each pixel in the binarized image is the first preset value or the second preset value.
The preset threshold may be a preset minimum density value corresponding to the density of the first pixel in the target region.
The swelling erosion method belongs to the category of mathematical morphology in image processing, and has the function of linking discrete points into a plane.
For example, a 1 × 13 rectangular structural element is used by performing a dilation operation on the binarized infrared image. By performing the expansion operation on the binarized image (i.e., the binarized infrared image), the temperature of the object portion having the heat source is relatively high, so that the pixel points (i.e., the target pixels of the first preset value) with the value of 255 are relatively dense. So that the pixel with the value of 255 will be formed after expansion. However, there is a possibility that the portions where the heat source is not present may be connected to form a sheet-like region. However, in general, the area of the sheet-like region in which the portion where the heat source is not present is surely smaller than the area of the sheet-like region where the heat source is present. Therefore, it is necessary to reuse the etching method once again, and the etching method uses structural elements generally smaller than those used in collision, and alternatively, 1 × 5 structural elements may be used. At this time, the sheet-shaped area without the heat source is easily corroded due to the relatively small area, and the part with the heat source is not corroded due to the fact that the area of the sheet-shaped area is larger than that of the current structural element. Through the expansion etching step, only the areas where the heat source exists are left in the whole image and connected into a sheet shape, and then the target area is obtained.
Step S702, a heat source area is determined in the infrared image according to the position information of the target area.
Since the binarized image is a binarized image corresponding to the heat source region, after the target region in the binarized image is determined, the heat source region can be determined in the infrared image based on the position information of the target region.
For example, when the target area is obtained and the target area is a rectangular area, the coordinate information of the pixels at the four corners of the target area may be specified, the coordinate information may be used as the position information of the target area, and then the pixels corresponding to the position information may be specified based on the infrared image, and the heat source area may be specified in the infrared image.
By the method in the embodiment, the heat source area in the infrared image can be positioned by adopting a binarization and expansion corrosion method, and the method has the advantages of small calculated amount, good real-time performance and strong external noise resistance.
As shown in fig. 6, according to an embodiment of another aspect of the present application, there is also provided an infrared image heat source region detecting device including:
the acquisition module 1 is used for acquiring an infrared image needing to be subjected to heat source position determination;
the corresponding module 2 is used for determining color bands corresponding to all pixels in the infrared image, wherein the color bands are used for indicating temperature ranges, the temperature difference of the temperature ranges corresponding to the color bands is the same, and for each color band, the color of the pixel corresponding to the color band is one of all colors included in the color band;
the proportion module 3 is used for obtaining the pixel proportion of all pixels corresponding to each color band in all pixels of the infrared image by determining the pixels in the infrared image corresponding to each color band;
and the determining module 4 is used for determining that a heat source area exists in the infrared image when the pixel ratio corresponding to each color band is judged to meet the preset requirement.
Specifically, the specific process of implementing the functions of each module in the apparatus according to the embodiment of the present invention may refer to the related description in the method embodiment, and is not described herein again.
According to another embodiment of the present application, there is also provided an electronic apparatus including: as shown in fig. 7, the electronic device may include: the system comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 complete communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501 is configured to implement the steps of the above-described method embodiments when executing the program stored in the memory 1503.
The bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
The embodiment of the present application further provides a computer-readable storage medium, where the storage medium includes a stored program, and when the program runs, the method steps of the above method embodiment are executed.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. An infrared image heat source area detection method is characterized by comprising the following steps:
acquiring an infrared image needing to be subjected to heat source position determination;
determining color bands corresponding to pixels in the infrared image, wherein the color bands are used for indicating temperature ranges, the temperature difference of the temperature range corresponding to each color band is the same, and the color of the pixel corresponding to each color band is one of all colors included in the color bands;
obtaining the pixel proportion of all pixels corresponding to each color band in all pixels of the infrared image by determining the pixels in the infrared image corresponding to each color band;
and when the pixel proportion corresponding to each color band is judged to meet the preset requirement, determining that a heat source area exists in the infrared image.
2. The method of claim 1, wherein prior to said determining bands corresponding to respective pixels in the infrared image, the method further comprises:
determining a temperature bar for identifying the infrared image, wherein each color in the temperature bar is to indicate a unique temperature;
and uniformly dividing the temperature strips according to the number of preset color bands to obtain at least two color bands.
3. The method of claim 1, wherein the determining the color band corresponding to each pixel in the infrared image comprises:
performing the following steps for any one of the pixels in the infrared image:
calculating the sum of a red value, a green value and a blue value in the RBG value of the color of the pixel to obtain the color component sum of the pixel;
for each color bar, calculating the color component sum of each color included by the color bar according to the RBG value of each color included by the color bar; calculating the average value of the color component sums of the color bands according to the number of the colors included in the color bands to obtain the average value of the color components of the color bands;
and determining the color band corresponding to the pixel in all the color bands based on the color components of the pixel and the average value of the color components of each color band.
4. The method of claim 1, wherein determining that a heat source region exists in the infrared image when the pixel proportion corresponding to each color band is determined to meet a preset requirement comprises:
determining a first color band set in all the color bands according to the pixel proportion corresponding to each color band, wherein the sum of the pixel proportions of the color bands in the first color band set is greater than or equal to a first preset threshold value, and the temperature indicated by the color bands in the first color band set is higher than the temperatures indicated by other color bands except the first color band set in the infrared image;
determining a second color band set in all the color bands according to the pixel occupation ratio of each color band, wherein the sum of the pixel occupation ratios of the color bands in the second color band set is greater than or equal to a second preset threshold value, and the temperature indicated by the color bands in the second color band set is lower than the temperature indicated by other color bands except the second color band set in the infrared image;
determining that the heat source region exists in the infrared image when a color band difference between a first target color band in the first color band set and a second target color band in the second color band set is greater than or equal to a third preset threshold, wherein the first target color band is a color band with the lowest indicated temperature in all color bands in the first color band set, the second target color band is a color band with the highest indicated temperature in all color bands in the second color band set, the color band difference is used for indicating the number of color bands separated between the first target color band and the second target color band, and the temperature indicated by the separated color bands is lower than the temperature indicated by the first target color band and higher than the temperature indicated by the second target color band.
5. The method of claim 4, wherein after the determining that the heat source region is present in the infrared image, the method further comprises:
and determining the heat source area in the infrared image according to the distribution condition of target pixels in the infrared image, wherein the target pixels are pixels corresponding to color bands in the first color band set.
6. The method of claim 5, wherein the determining the heat source region in the infrared image according to the distribution of the target pixels in the infrared image comprises:
determining the remaining pixels in the infrared image except the target pixel;
determining a saturation value of the target pixel and determining a saturation value of the remaining pixels;
performing binarization processing on the infrared image to obtain a binarized image, wherein the pixel value of a first pixel corresponding to the target pixel in the binarized image is a first preset value after the saturation component value of the target pixel is binarized, and the pixel value of a second pixel corresponding to the target pixel in the binarized image is a second preset value after the saturation component value of the residual pixel is binarized;
and determining the heat source area in the infrared image based on the first pixel and the second pixel in the binary image.
7. The method according to claim 6, wherein the determining the heat source region in the infrared image based on the first pixel and the second pixel in the binarized image comprises:
determining a target area in the binary image according to a first preset value of the first pixel and a second preset value of the second pixel by using an expansion corrosion method, wherein the density of the first pixel assigned as the first preset value in the target area is higher than a preset threshold value;
and determining the heat source area in the infrared image according to the position information of the target area.
8. An infrared image heat source region detecting device, comprising:
the acquisition module is used for acquiring an infrared image needing to be subjected to heat source position determination;
the infrared image processing device comprises a corresponding module, a processing module and a display module, wherein the corresponding module is used for determining color bands corresponding to pixels in the infrared image, the color bands are used for indicating temperature ranges, the temperature difference of the temperature ranges corresponding to the color bands is the same, and the color of the pixel corresponding to the color band is one of all colors included in the color bands for each color band;
the proportion module is used for obtaining the pixel proportion of all the pixels corresponding to each color band in all the pixels of the infrared image by determining the pixels in the infrared image corresponding to each color band;
and the determining module is used for determining that a heat source area exists in the infrared image when the pixel occupation ratio corresponding to each color band meets the preset requirement.
9. An electronic device, comprising: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory is used for storing a computer program;
the processor, when executing the computer program, implementing the method of any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any of the preceding claims 1 to 7.
CN202110601321.7A 2021-05-31 2021-05-31 Infrared image heat source area detection method and device, electronic device and storage medium Pending CN113269760A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110601321.7A CN113269760A (en) 2021-05-31 2021-05-31 Infrared image heat source area detection method and device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110601321.7A CN113269760A (en) 2021-05-31 2021-05-31 Infrared image heat source area detection method and device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN113269760A true CN113269760A (en) 2021-08-17

Family

ID=77233623

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110601321.7A Pending CN113269760A (en) 2021-05-31 2021-05-31 Infrared image heat source area detection method and device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN113269760A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180031425A1 (en) * 2016-07-27 2018-02-01 Fujitsu Limited Heat source detection device and heat source detection method
CN110501914A (en) * 2018-05-18 2019-11-26 佛山市顺德区美的电热电器制造有限公司 A kind of method for safety monitoring, equipment and computer readable storage medium
CN111784678A (en) * 2020-07-03 2020-10-16 中煤航测遥感集团有限公司 Temperature acquisition method, device and equipment based on thermal infrared image and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180031425A1 (en) * 2016-07-27 2018-02-01 Fujitsu Limited Heat source detection device and heat source detection method
CN110501914A (en) * 2018-05-18 2019-11-26 佛山市顺德区美的电热电器制造有限公司 A kind of method for safety monitoring, equipment and computer readable storage medium
CN111784678A (en) * 2020-07-03 2020-10-16 中煤航测遥感集团有限公司 Temperature acquisition method, device and equipment based on thermal infrared image and storage medium

Similar Documents

Publication Publication Date Title
WO2021057848A1 (en) Network training method, image processing method, network, terminal device and medium
CN107784654B (en) Image segmentation method and device and full convolution network system
US11455805B2 (en) Method and apparatus for detecting parking space usage condition, electronic device, and storage medium
WO2016127883A1 (en) Image area detection method and device
CN110544258A (en) Image segmentation method and device, electronic equipment and storage medium
CN105445607B (en) A kind of electrical equipment fault detection method drawn based on thermoisopleth
CN108596054A (en) A kind of people counting method based on multiple dimensioned full convolutional network Fusion Features
JP3538147B2 (en) Representative color specification method using reliability
JP2013047678A (en) Method for creating paint color database, retrieval method using database, and system, program and recording medium therefor
JP5409910B2 (en) Non-product image identification
CN110443783B (en) Image quality evaluation method and device
CN108765407A (en) A kind of portrait picture quality determination method and device
CN116309409A (en) Weld defect detection method, system and storage medium
CN108564638B (en) Method and device for determining people flow hot area based on geographic imagery
CN108419045B (en) Monitoring method and device based on infrared thermal imaging technology
Li et al. Color constancy using achromatic surface
CN113284066B (en) Automatic cloud detection method and device for remote sensing image
Sun et al. Exposing splicing forgery based on color temperature estimation
CN112492191B (en) Image acquisition method, device, equipment and medium
CN113269760A (en) Infrared image heat source area detection method and device, electronic device and storage medium
CN105574844A (en) Radiation response function estimation method and device
CN113361637A (en) Potential safety hazard identification method and device for base station room
CN113395407A (en) Image processing apparatus, image processing method, and computer readable medium
CN104700396B (en) The method and system of the parameter for estimating the volume of traffic is determined from image
CN117522749B (en) Image correction method, apparatus, computer device, and storage medium

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