CN113689455B - Thermal fluid image processing method, system, terminal and medium - Google Patents

Thermal fluid image processing method, system, terminal and medium Download PDF

Info

Publication number
CN113689455B
CN113689455B CN202110742298.3A CN202110742298A CN113689455B CN 113689455 B CN113689455 B CN 113689455B CN 202110742298 A CN202110742298 A CN 202110742298A CN 113689455 B CN113689455 B CN 113689455B
Authority
CN
China
Prior art keywords
image
background
detected
pixel
gradient
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.)
Active
Application number
CN202110742298.3A
Other languages
Chinese (zh)
Other versions
CN113689455A (en
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.)
Shanghai Jiaotong University
Original Assignee
Shanghai Jiaotong University
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 Shanghai Jiaotong University filed Critical Shanghai Jiaotong University
Priority to CN202110742298.3A priority Critical patent/CN113689455B/en
Publication of CN113689455A publication Critical patent/CN113689455A/en
Application granted granted Critical
Publication of CN113689455B publication Critical patent/CN113689455B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/181Segmentation; Edge detection involving edge growing; involving edge linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a method and a system for processing a thermal fluid image, which are characterized in that firstly, the characteristic of a directional gradient histogram is extracted, then the characteristic difference of the directional gradient histogram is calculated, and then the operations of binarization, segmentation, contour extraction and the like are carried out. Meanwhile, a corresponding terminal and medium are provided. The invention can increase the difference of the target area to be detected and the background area by extracting the directional gradient histogram characteristics of the two areas. The invention can be applied to the field of image processing of thermal fluid, carries out target recognition, edge detection and segmentation on a region to be detected and a background region, has advantages under the conditions of small difference between the target to be detected and the background and frame-dependent change of the background, has low sensitivity to parameter setting and good universality, can be oriented to different cases, working conditions and optical systems, is easy to realize a program, has high processing speed and accurate and reliable result.

Description

Thermal fluid image processing method, system, terminal and medium
Technical Field
The invention relates to the technical field of thermal fluid image processing, in particular to a thermal fluid image processing method, a thermal fluid image processing system, a thermal fluid image processing terminal and a thermal fluid image processing medium based on directional gradient straight-square characteristics.
Background
The experimental data of the thermal fluid obtained based on the optical diagnosis technology is not only helpful for the mechanism research of the thermal fluid, but also has important significance for the establishment and calibration of the simulation model. Various optical measurement methods have been developed and applied to related property studies of thermal fluids, and have been widely applied to constant volume combustion bullets, optical engines, shock tubes, and rapid presses, etc. for measuring macroscopic and microscopic properties of thermal fluids, including but not limited to mie scattering, backlight, shadow, schlieren, laser induced fluorescence, uv/vis absorption and scattering techniques, etc., and for analysis of digital images obtained by these optical measurement methods, object recognition, edge detection, image segmentation, contour extraction are an indispensable step therein. For digital images measuring macroscopic or microscopic properties of a thermal fluid, if the segmentation is inaccurate, the extracted information may contain erroneous or unwanted information, so it is important to accurately divide the region of the object to be detected from the image obtained by the optical test.
The conventional thermal fluid image processing method generally calculates the difference between the image to be detected and the background image, then binarizes the difference by selecting a threshold value to complete image segmentation, and when the difference between the brightness values of the area to be detected and the background area is large, the method is simple and effective. However, at high ambient pressure and high ambient density (e.g., engine-like conditions), the spatial-temporal variation of the ambient density gradient will be converted into a variation of the texture in the image, the texture of the ambient gas becomes a complex time-varying background noise, making the image difficult to identify and segment, greatly increasing the difficulty of object identification, edge detection, image segmentation, contour extraction, in which case the desired effect will not be obtained simply by subtracting and selecting the threshold from the image to be detected and the background image, and therefore there is a need to develop better image segmentation methods. However, the currently developed processing methods for thermal fluid image segmentation have more or less problems and disadvantages: (1) more steps, complex treatment process and not simple enough; (2) In each step, a plurality of thresholds, correction factors and the like which are manually set are not convenient enough; (3) The processing result is very sensitive to the selection of threshold values and other parameters, and a slight incorrect setting can lead to an undesirable result; (4) Many methods deal only with relatively clean background or with little noise but no significant (ambient density 10 kg/m) 3 The following) when the difference in intensity between the area to be detected and the background area is not obvious, the identified boundary will be blurred; (5) The developed method has good effect when processing a certain case and working condition, but the condition of poor processing effect can occur when changing an environment, working condition and optical system, the threshold value and some manually set parameters need to be determined again, and the universality is not enough; (6) For images with high background noise or background changing along with frames, the processing effect is general and the accuracy is poor.
In summary, the existing thermal fluid image processing method has the problems of complex steps, inconvenient operation, insufficient universality, poor processing effect accuracy and the like, and no description or report of similar technology as the method is found at present, and similar data at home and abroad are not collected yet.
Disclosure of Invention
The invention provides a thermal fluid image processing method, a system, a terminal and a medium based on a directional gradient histogram feature, aiming at the defects in the prior art.
According to an aspect of the present invention, there is provided a thermal fluid image processing method including:
dividing a plurality of thermal fluid images arranged according to a time sequence into a to-be-detected image containing the thermal fluid to be detected and identified and a background image not containing the thermal fluid to be detected and identified, and respectively extracting the directional gradient histogram characteristics of each pixel point of the to-be-detected image and the background image;
Calculating the difference between the direction gradient straight graph characteristics of each pixel point in the to-be-detected graph and the background graph at the same position to obtain a difference graph of the direction gradient histogram characteristics;
and carrying out binarization processing on the difference map, judging whether each pixel point belongs to a target area, dividing the difference map into a target area and a background area according to a judging result, extracting the outline of the target area, and finishing the processing of the thermal fluid image.
Preferably, the extracting the directional gradient straight-square features of each pixel point of the to-be-detected image and the background image respectively includes:
for each pixel point (I, j) on the to-be-detected image I and the background image Bk, respectively taking the pixel point (I, j) as a center, acquiring an n multiplied by n region around the pixel point (I, j) as a primitive C (I, j) of the pixel point (I, j), and performing primitive segmentation on the to-be-detected image and the background image;
gamma correction is carried out on the gray value of each primitive C (i, j), and square root is taken to obtain:for each pixel C ' in each resulting primitive C ' (i, j) ' (i,j) (m, n) horizontal gradients G x(i,j) (m, n) and vertical gradient- >Is calculated; horizontal gradient G of the same pixel x(i,j) (m, n) and vertical gradient->Vector synthesis is carried out to obtain the gradient size and gradient direction of each pixel in the two-dimensional plane;
dividing the value range [0 DEG, 360 DEG ] of the gradient direction into N classes, wherein N is the dimension of the direction gradient straight-square diagram characteristic to be obtained, and each dimension corresponds to one latitude; each pixel C ' in the primitive C ' (i, j) ' (i,j) The gradient directions of (m, n) are respectively classified according to angles and divided into latitudes, the gradient magnitudes of all pixels divided into the same latitude are overlapped to obtain the value of the direction gradient histogram feature to be obtained in the latitude, and then the direction gradient histogram feature H corresponding to each primitive is obtained (i,j)
Preferably, the value of n×n is: (2z+1) × (2z+1), z being a positive integer.
Preferably, each pixel C ' in each primitive C ' (i, j) of the pair is obtained ' (i,j) (m, n) horizontal gradients G x(i,j) (m, n) comprising:
set pixel C' (i,j) The first side of (m, n) is positive, using the pixel C' (i,j) (m, n) positive side adjacent pixels C' (i,j) The value of (m, n+1) minus the pixel C' (i,j) (m, n) a pixel C 'adjacent to a second side opposite to the first side' (i,j) The value of (m, n-1) yields a horizontal gradient;
each pixel C ' in each primitive C ' (i, j) of the pair ' (i,j) (m, n) respectively performing vertical ladderDegree ofComprises the following steps:
set pixel C' (i,j) The third side of (m, n) is positive, using the pixel C' (i,j) Positive side adjacent pixel C 'of (m, n)' (i,j) The value of (m+1, n) minus the pixel C 'adjacent to the fourth side of the pixel opposite to the third side' (i,j) The value of (m-1, n) yields a vertical gradient.
Preferably, the gradient direction value range [0 °,360 ° ] is divided into N classes, where each class corresponds to a value range of (360/N) °, and the N classes include: [0 °,360/N °), [360/N °,2×360/N °), [2×360/n°,3×360/n°), … …, [ (N-1) ×360/n°,360 °.
Preferably, the method further comprises:
the direction gradient histogram characteristic H corresponding to each primitive (i,j) Normalization processing is carried out on all latitudes, so that the sum of values of the directional gradient histogram feature of each primitive on each latitude is 1, and a normalized directional gradient histogram feature Hn is obtained, wherein the value of the directional gradient histogram feature corresponding to each latitude
Preferably, the calculating the difference between the directional gradient histogram features of each pixel point of the to-be-detected image and the background image at the same position includes: calculating the directional gradient histogram feature Hn of the pixel points (i, j) at the same position on the diagram to be detected and the background diagram by adopting a p-step difference calculation method I (i, j) and Hn Bk Differences between (i, j):
wherein p is a positive integer, and i is each latitude of the directional gradient histogram feature.
Preferably, the value of p is 1, then:
Diff L1 =||Hn I -Hn Bk || 1 =∑ i |Hn I (i)-Hn Bk (i)| 1 ),Diff L1 ∈[0,2]。
preferably, the binarizing process is performed on the difference map, whether each pixel point belongs to a target area is judged, each pixel point is classified to obtain a target area and a background area, the difference map is divided, and the outline of the target area is extracted; the segmented background areas are used for dynamic background correction and update, and the extracted outlines are used for measurement and calculation of relevant characteristic parameters.
Preferably, the dynamic background correction update includes:
taking a last image Bk_01 before a to-be-detected image in a plurality of thermal fluid images arranged according to a time sequence as a first background image, and carrying out image processing on the basis of the first background image Bk_01 and a first to-be-detected image I_01 to detect a target area and a background area on the first to-be-detected image I_01 so as to finish the segmentation of the first to-be-detected image I_01;
pixels in a background area on the first to-be-detected image I_01 are placed at the same position in the first background image Bk_01 to finish background updating correction, and an image of the first background image Bk_01 after finishing background updating is the second background image Bk_02;
Acquiring a second background image Bk_02, and performing image processing based on the second image I_02 to be detected and the second background image Bk_02 to detect a target area and a background area on the second image I_02 to be detected, so as to finish the segmentation of the next image to be detected;
and so on until all the images to be detected in all the thermal fluid images are segmented.
According to another aspect of the present invention, there is provided a thermal fluid image processing system comprising:
the device comprises a direction gradient histogram feature extraction module, a detection module and a detection module, wherein the direction gradient histogram feature extraction module divides a plurality of thermal fluid images into a to-be-detected image containing thermal fluid to be detected and identified and a background image not containing thermal fluid to be detected and identified, and respectively extracts the direction gradient histogram features of each pixel point of the to-be-detected image and the background image;
the difference map calculation module calculates the difference between the directional gradient histogram features of each pixel point in the to-be-detected map and the background map at the same position to obtain a difference map of the directional gradient histogram features;
and the image processing module is used for carrying out binarization processing on the difference map, judging whether each pixel point belongs to a target area, dividing the difference map into the target area and a background area according to a judging result, extracting the outline of the target area and finishing the processing of the thermal fluid image.
According to a third aspect of the present invention there is provided a terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor when executing the program being operable to perform the method of any one of the preceding claims or to run the system of the preceding claims.
According to a fourth aspect of the present invention there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor is operable to perform a method of any of the above, or to run a system as described above.
Due to the adoption of the technical scheme, compared with the prior art, the invention has at least one of the following beneficial effects:
according to the method, the system, the terminal and the medium for processing the thermal fluid image, based on the characteristics of the directional gradient histogram (histogram of oriented gradient, HOG), the thermal fluid image with cleaner background and high background noise can be processed, the two images can be compared on the directional gradient histogram by extracting the HOG characteristics of the picture to be detected and the background picture, the difference of the HOG characteristics can be more clearly reflected to the difference of a target area and a background area than the original difference of brightness values, the difference and the distinguishing property between the target area and the background area are enlarged, the picture to be detected is conveniently segmented and the outline of a target object is conveniently extracted, the proposed method has low sensitivity to parameter setting, good universality, can be oriented to different cases, working conditions and optical systems, the program is easy to realize, the processing speed is high, and the processing result is accurate and reliable.
The method, the system, the terminal and the medium for processing the thermal fluid image can process the thermal fluid image (including the condition of clean background, high background noise, static background, dynamic background, different optical systems, testing methods and the like) under different conditions, the HOG characteristics of the picture to be detected and the HOG characteristics of the background picture can be compared on a direction gradient histogram by extracting the HOG characteristics, the difference of the HOG characteristics can reflect the difference between a target area and the background area more clearly than the original difference of brightness values, the difference and the distinguishing between the target area and the background area are amplified, and the picture to be detected is conveniently segmented and the outline of a target object is extracted.
The method, the system, the terminal and the medium for processing the thermal fluid image can finish difficult segmentation tasks when the background and the object to be detected have little difference on the image, and compared with the existing scheme, the method has the advantages of very good processing effect, low sensitivity to parameter setting, good universality, capability of facing different cases, working conditions and optical systems, easy realization of programs, high processing speed and accurate and reliable processing results.
Drawings
Other features, objects and advantages of the present invention will become more apparent upon reading of the detailed description of non-limiting embodiments, given with reference to the accompanying drawings in which:
FIG. 1 is a flowchart of a thermal fluid image processing method according to an embodiment of the invention.
FIG. 2 is a flowchart of a thermal fluid image processing method in accordance with a preferred embodiment of the present invention.
FIG. 3 is a schematic diagram of a thermal fluid image of a process object according to an embodiment of the present invention; wherein, (a) is an injection development image of the fuel spray of the engine, and (b) is a background image.
Fig. 4 is a schematic diagram of a direction gradient Histogram (HOG) feature extraction step in an embodiment of the invention.
Fig. 5 is a schematic diagram showing a step of calculating a direction gradient Histogram (HOG) feature difference in an embodiment of the present invention.
FIG. 6 is a diagram illustrating steps of binarization, segmentation, and contour extraction according to an embodiment of the present invention.
FIG. 7 is a schematic diagram showing the comparison between the effects of the thermal fluid image processing method and the effects of the conventional processing method (by making the difference between the brightness values of the background image and the image to be detected and then dividing by threshold selection) according to a preferred embodiment of the present invention;
FIG. 8 is a schematic diagram showing the components of a thermal fluid image processing system according to an embodiment of the present invention.
Detailed Description
The following describes embodiments of the present invention in detail: the embodiment is implemented on the premise of the technical scheme of the invention, and a detailed implementation mode and a specific operation process are given. It should be noted that variations and modifications can be made by those skilled in the art without departing from the spirit of the invention, which falls within the scope of the invention.
Fig. 1 is a flowchart of a thermal fluid image processing method according to an embodiment of the present invention.
As shown in fig. 1, the thermal fluid image processing method provided in this embodiment may include the following steps:
s100, dividing a plurality of thermal fluid images (image sequences) arranged according to a time sequence into a to-be-detected image containing thermal fluid to be detected and identified and a background image not containing thermal fluid to be detected and identified, and extracting the directional gradient histogram features of each pixel point of the to-be-detected image and the background image respectively;
s200, calculating differences among the directional gradient histogram features of each pixel point in the to-be-detected image and the background image at the same position to obtain a difference image of the directional gradient histogram features, namely a set of feature differences of each pixel point;
s300, binarizing the difference map, judging whether each pixel point belongs to a target area, dividing the difference map into the target area and a background area according to a judging result, extracting the outline of the target area, and finishing the processing of the thermal fluid image.
In S100 of this embodiment, as a preferred embodiment, extracting the directional gradient histogram features of each pixel point of the to-be-detected image and the background image respectively may include the following steps:
S101, each pixel point (I, j) on the image I to be detected and the background image Bk is respectively centered on the pixel point (I, j), and an n multiplied by n area around the pixel point (I, j) is obtained as a base element C (I, j) of the pixel point (I, j), and primitive segmentation is carried out on the image I to be detected and the background image;
s102, gamma correction is carried out on the gray value of each primitive C (i, j), and square root is taken to obtain:for each pixel C ' in each resulting primitive C ' (i, j) ' (i,j) (m, n) horizontal gradients G x(i,j) (m, n) and vertical gradient->Is calculated; horizontal gradient G of the same pixel x(i,j) (m, n) and vertical gradient->Vector synthesis is carried out to obtain the gradient size and gradient direction of each pixel point in the two-dimensional plane;
s103, dividing the value range [0 DEG, 360 DEG ] of the gradient direction into N classes, wherein N is the dimension of the gradient histogram feature of the direction to be obtained, and each dimension corresponds to one latitude; each pixel in the primitive C' (i, j)The gradient directions of (a) are respectively divided according to anglesClassifying into each latitude, and superposing the gradient magnitudes of all pixels divided into the same latitude to obtain the value of the direction gradient histogram feature to be obtained in the latitude, thereby obtaining the direction gradient histogram feature H corresponding to each primitive (i,j)
In S101 of this embodiment, as a preferred embodiment, the value of n×n may be: (2z+1) × (2z+1), z being a positive integer.
In a specific application example of the preferred embodiment, the value of n×n may be: 3×3, 5×5, 7×7, 9×9, 11×11, 13×13, … ….
In S101 of this embodiment, as a specific application example, the value of n×n may be preferably: 3X 3.
In S102 of this embodiment, as a preferred embodiment, for each pixel C ' in each primitive C ' (i, j) ' (i,j) (m, n) horizontal gradients G x(i,j) The calculation of (m, n) may comprise the steps of:
set pixel C' (i,j) The first side of (m, n) is positive, using the pixel C' (i,j) (m, n) positive side adjacent pixels C' (i,j) The value of (m, n+1) minus the pixel C' (i,j) (m, n) a pixel C 'adjacent to a second side opposite to the first side' (i,j) The value of (m, n-1) yields a horizontal gradient.
In S102 of this embodiment, as a preferred embodiment, for each pixel C ' in each primitive C ' (i, j) ' (i,j) (m, n) performing vertical gradient respectivelyMay comprise the steps of:
set pixel C' (i,j) The third side of (m, n) is positive, using the pixel C' (i,j) Positive side adjacent pixel C 'of (m, n)' (i,j) The value of (m+1, n) minus the pixel C 'adjacent to the fourth side of the pixel opposite to the third side' (i,j) The value of (m-1, n) yields a vertical gradient.
In S103 of this embodiment, as a preferred embodiment, the dimension N of the directional gradient histogram feature may divide the direction range of the gradient [0 °,360 ° ] into N classes, where each class corresponds to a value range of (360/N) °, and the N classes may be, but are not limited to: [0 °,360/N °), [360/N °,2×360/N °), [2×360/n°,3×360/n°), … …, [ (N-1) ×360/n°,360 °.
In the preferred embodiment, the purpose of classification is to obtain the directional gradient histogram feature, and then the obtained directional gradient histogram feature is used to calculate the difference between the directional gradient histogram features of each pixel point of the to-be-detected image and the background image at the same position.
In S103 of this embodiment, as a specific application example, the value of N may be selected from, but not limited to, 6 to 12, and further preferably, the value may be 9.
In S103 of this embodiment, as a preferred embodiment, it may further include:
the direction gradient histogram characteristic H corresponding to each primitive (i,j) Normalization processing is carried out on all latitudes, so that the sum of values of the directional gradient histogram feature of each primitive on each latitude is 1, and a normalized directional gradient histogram feature Hn is obtained, wherein the value of the directional gradient histogram feature corresponding to each latitude
In S200 of this embodiment, as a preferred embodiment, the difference between the histogram features of the directional gradient of each pixel point of the to-be-detected image and the background image at the same position is calculated, and the specific method is preferably but not limited to the following steps:
calculating the directional gradient histogram feature Hn of the pixel point (i, j) at the same position on the diagram to be detected and the background diagram by adopting a p-step difference calculation method I (i, j) and Hn Bk Differences between (i, j):
wherein p is a positive integer, and i is each latitude of the directional gradient histogram feature.
In S200 of this embodiment, as a preferred embodiment, 1 is recommended, but not limited to, and as a preferred solution, 1-step difference calculation is adopted, then:
Diff L1 =||Hn I -Hn Bk || 1 =∑ i |Hn I (i)-Hn Bk (i)| 1 ),Diff L1 ∈[0,2]。
in S300 of this embodiment, as a specific application example, binarization processing is performed on the difference map, whether each pixel belongs to a target area is determined, and classification is performed on each pixel to obtain a target area and a background area, segmentation of the difference map is completed, the segmented background area is used for dynamic background correction and update, the contour of the target area is extracted, and the extracted contour is used for measurement and calculation of relevant characteristic parameters.
In S300 of this embodiment, as a preferred embodiment, the dynamic background correction update includes:
Taking a last image Bk_01 before a to-be-detected image in a plurality of thermal fluid images (image sequences) arranged according to a time sequence as a first background image, and carrying out image processing on the basis of the first background image Bk_01 and the first to-be-detected image I_01 to detect a target area and a background area on the first to-be-detected image I_01 so as to finish segmentation of the first to-be-detected image I_01;
pixels in a background area on the first to-be-detected image I_01 are placed at the same position in the first background image Bk_01 to finish background updating correction, and an image of the first background image Bk_01 after finishing background updating is the second background image Bk_02;
acquiring a second background image Bk_02, and performing image processing based on the second image I_02 to be detected and the second background image Bk_02 to detect a target area and a background area on the second image I_02 to be detected, so as to finish the segmentation of the next image to be detected;
and so on until the segmentation of all the images to be detected in the image sequence is completed.
Fig. 2 is a flowchart of a thermal fluid image processing method according to a preferred embodiment of the present invention. The thermal fluid image processing method provided by the preferred embodiment is used for processing the digital image of the thermal fluid obtained by the optical test based on the directional gradient histogram characteristics, and performing target recognition, edge detection, segmentation and contour extraction on the region to be detected and the background region.
As shown in fig. 2, the thermal fluid image processing method provided in the preferred embodiment may include the following steps:
s1: the method mainly comprises the steps of dividing a primitive, calculating the gradient size and direction, classifying and superposing the direction histogram, and extracting HOG characteristics of each pixel point of a to-be-detected image and a background image (the to-be-detected image is an image containing thermal fluid to be detected and identified generally, and the background image is an image not containing thermal fluid to be detected and identified) respectively, so as to prepare for the subsequent second step of differential calculation.
S2: and (3) calculating the difference of the HOG characteristics of each pixel point of the to-be-detected image and the background image, wherein the difference of the HOG characteristics can reflect the difference between the to-be-detected area and the background area more clearly than the original difference of the brightness values, and the difference and the distinguishability between the to-be-detected area and the background area are amplified, so that the subsequent binarization, segmentation and contour extraction are facilitated.
S3: binarization, segmentation and contour extraction are carried out on the image with different reaction obtained in the step S2, namely, pixel points are classified into a target area and a background area, segmentation is completed, the segmented background area is used for dynamic background correction and updating, the contour of the target area can be extracted, and the extracted contour can be used for measuring and calculating related characteristic parameters.
The dynamic background correction update is specifically implemented by initially using the last image (excluding the object to be detected) before the image to be detected in the image sequence as the initial background (which may be labeled as bk_01, i.e. the first background image), performing image processing based on bk_01 and the first image to be detected (i_01) to detect the object region and the background region on i_01, completing segmentation, then placing the pixels in the background region on i_01 image at the same position in bk_01 to complete background update correction to obtain the second background image bk_02, performing next image segmentation based on the second image to be detected i_02 and the second background image bk_02, and so on, and using dynamic background correction update to better complete segmentation of all the image sequences one by one.
In a preferred embodiment, in step S1, a histogram of directional gradient (HOG) feature extraction is performed on each pixel (I, j) on the picture I to be detected and the background picture Bk, respectively, and when the HOG feature of each pixel is extracted, S1-a primitive division is performed, and a nearby n×n region (3×3,5×5,7×7, etc.) centered on the point (I, j) is selected as a primitive C (I, j) of the pixel (I, j), and for the pixel at the boundary, the surrounding may be complemented by a copy value or the like.
As a preferred embodiment, in step S1 direction gradient Histogram (HOG) feature extraction, the primitive size in S1-a. Primitive classification may be selected to be 3×3, which may reduce the amount of computation.
As a preferred embodiment, in step S1, the step of feature extraction of the histogram of gradient in the direction (HOG), gamma correction is usually performed on the gray values of the original image to take the square root before the calculation of the magnitude and direction of the gradientSubsequent gradient calculations are performed.
As a preferred embodiment, in step S1 direction gradient Histogram (HOG) feature extraction, after S1-a. Base-element partitioning, S1-b. Gradient magnitude and direction calculations are performed, first for each unit (pixel) C ' in each base element C ' (i, j) ' (i,j) (m, n) horizontal gradients G x(i,j) (m, n) and vertical gradientIs calculated by the computer.
As a preferred embodiment, in step S1-b. Gradient magnitude and direction calculation, in each cell (pixel) C' (i,j) (m, n) horizontal gradient G x(i,j) When (m, n) is calculated, the right is set positive, and the unit (pixel) C 'adjacent to the right side of the unit (pixel) is used' (i,j) The value of (m, n+1) minus the adjacent cell (pixel) C 'to the left of the cell (pixel)' (i,j) The value of (m, n-1) yields a horizontal gradient in the pair cell (pixel) C' (i,j) (m, n) vertical gradientIn calculation, a unit (pixel) C 'adjacent to the lower side of the unit (pixel) is used with the setting of the downward positive' (i,j) The value of (m+1, n) minus the upper adjacent cell (pixel) C 'of the cell (pixel)' (i,j) The value of (m-1, n) yields a vertical gradient.
As a preferred embodiment, in the step S1-b. Gradient magnitude and direction calculation, the calculated horizontal gradient and vertical gradient are vector-synthesized to obtain the gradient magnitude and direction in the two-dimensional plane, and may be represented by polar coordinates (ρ, θ), where ρ represents the magnitude of the synthesized gradient and θ represents the direction of the synthesized gradient, at which time the step S1-b. Gradient magnitude and direction calculation is completed, one gradient magnitude and direction for each unit (pixel) in the n×n primitive.
As a preferred embodiment, in the step S1 direction gradient Histogram (HOG) feature extraction, after calculation of the gradient magnitude and direction, S1-c direction histogram classification and superposition are performed, in which the value range [0 DEG, 360 DEG ] of the gradient direction is first divided into N classes, N being the dimension of the HOG feature, each dimension corresponding to a latitude, then the gradient direction of each unit (pixel) in the primitive obtained in the calculation of the gradient magnitude and direction is classified into each latitude according to the angle, then the gradient magnitude of all units (pixels) classified into the same class (latitude) is superimposed to obtain the value of the HOG feature at the latitude, through which the HOG corresponding to each primitive can be obtained Feature H (i,j)
In a preferred embodiment, in the step S1-c, the dimension of the HOG feature is set to 9 dimensions, and at this time, the 9 categories respectively correspond to the intervals of 40 ° in the range, and each unit may be classified into the corresponding latitude according to the range to which the gradient direction of each unit in the primitive belongs.
As a preferred embodiment, in step S1-c, the obtained HOG feature H may be normalized at all latitudes so that the sum of the values of the HOG feature of each primitive (pixel) at each latitude is 1, to obtain a normalized HOG feature Hn, where each latitude corresponds to a value
As a preferred embodiment, after the step S1 of extracting the feature of the histogram of gradient (HOG), the step S2 of computing the difference of the feature of the histogram of gradient (HOG) is performed to compute the HOG feature (Hn) of the pixel point at the same position (i, j) on the detected image and the background image I (i, j) and Hn Bk (i, j)) are used.
As a preferred embodiment, in the step S2 of the histogram of directional gradient (HOG) feature difference calculation, the difference calculation may be performed by calculating the p-order (Lp-norm) difference, which is expressed as Hn I -Hn Bk || p = (∑ i |Hn I (i)-Hn Bk (i)| p ) 1/p P is a positive integer, and i is the respective latitude of the HOG feature.
As a preferred embodiment, in the step of calculating the difference of the S2 direction gradient Histogram (HOG) feature, the difference calculation is performed by calculating the difference of the 1 st order (L1-norm) with the formula of Diff L1 =||Hn I -Hn Bk || 1 = ∑ i |Hn I (i)-Hn Bk (i)| 1 ),Diff L1 ∈[0,2]。
As a preferred embodiment, after the step S2 of computing the difference of the HOG feature of the histogram of the direction gradient (HOG), a difference map of HOG features of each pixel of the to-be-detected map and the background map is obtained, and then the step S3 of binarizing, segmenting, and extracting the contour is performed.
In the binarization, segmentation and contour extraction of step S3, the threshold selection may be performed by referring to the conventional threshold selection method of the image processing method.
The thermal fluid image processing method provided by the preferred embodiment has the following core ideas: the difference of the target area and the background area in the pixel brightness gradient direction is used for distinguishing the target area and the background area, the segmentation and the extraction of the outline are completed, when judging whether a pixel point belongs to a target/background to be detected, the judgment is not simply carried out through the brightness value at the point, the size and the direction of the gradient are calculated by combining the information of the pixel point and the surrounding pixel points, the binarization processing is carried out on the difference map of the direction gradient histogram characteristic, and whether each pixel belongs to the target area is judged, so that the method has advantages in edge detection and area identification under certain conditions.
In the processing process, a dynamic background correction updating mode is adopted to cope with the situation that the background area in the image sequence changes, and the dynamic background correction updating is executed after the processing and the segmentation of each image to be detected are completed and before the processing and the segmentation of the next image to be detected are carried out. In some measurements the background does not change much, which can be considered static, for static situations the average of several background maps can be used as background map; however, in some cases the background map varies significantly (e.g. high temperature and high pressure engine-like conditions), if the optical system is a schlieren method and even a density gradient can be seen, the movement of ambient gas in the image background is very pronounced, where a new (dynamic) background is required for each image.
The method for updating dynamic background correction comprises the following steps: initially using the last image before the image to be detected in the image sequence (excluding the object to be detected) as an initial background (which may be labeled bk_01), performing image processing based on Bk01 and the first image to be detected (i_01) to detect the target area and the background area on i_01, completing segmentation, then placing the pixels in the background area on the i_01 image at the same position in bk_01 to complete the background update correction, obtaining bk_02, performing the next image segmentation based on i_02 and bk_02, and so on, using dynamic background update correction to better complete segmentation of all the image sequences one by one.
The technical solutions provided by the above embodiments of the present invention are further described in detail below with reference to the accompanying drawings and a specific application example.
FIG. 3 is a schematic diagram of a thermal fluid image of a process object in an embodiment, where (a) is an injection development image of engine fuel spray, the optical test method is schlieren, and the image sequence is 50, the first is an initial background image (Bk) 01 ) Wherein, the fuel spray is not contained, and the rest 49 images (I) to be detected containing the fuel spray (namely the target to be detected) 01 ~I 49 ) Each picture has a pixel resolution of 112 x 400 and a gray value resolution of 8, i.e., [0,255 ]]. (b) is a background image. In some measurements the background does not change much, which can be considered static, for static situations the average of several background maps can be used as background map; however, in some cases the background map varies significantly (e.g. high temperature and high pressure engine-like conditions), if the optical system is a schlieren method and even a density gradient can be seen, the movement of ambient gas in the image background is very pronounced, where a new (dynamic) background is required for each image.
For a thermal fluid digital picture like that of fig. 1, the difficulty of identifying, edge detecting, segmenting, and extracting contours for the target region and the background region is as follows: (1) The target area to be detected (fuel spraying area) and the surrounding background area are relatively close in terms of brightness value (gray value), especially the difference of gray values of a gas phase area of fuel spraying and the background area is very small, and the target fuel spraying area is found out through direct subtraction comparison of the brightness value, so that the possible effect is poor; (2) Under the conditions of high ambient pressure, high ambient density and high ambient temperature similar to the working condition of an engine, a large amount of complex background noise appears in the background of the picture (as shown in (b) of fig. 3), and the complex texture structure is formed by the background noise, so that the difficulty of identifying and separating the target to be detected in the picture is greatly increased; (3) The background area of the picture is changed from frame to frame, since the air flow around the spray is also inevitably moving, which also increases the difficulty of image processing.
Referring to fig. 2, the method for processing a thermal fluid image provided by this specific application example can complete the task of segmenting a complex and difficult image similar to fig. 1, and includes 3 main steps, specifically as follows:
s1: the method mainly comprises the steps of dividing a primitive, calculating the gradient size and direction, classifying and superposing the direction histogram, and extracting HOG characteristics of each pixel point of a fuel spray image and a background image to be detected respectively so as to prepare for the subsequent second step of differential calculation.
S2: and (3) calculating the difference between HOG features of each pixel point of the fuel spray image and the background image to be detected, wherein the difference between the HOG features can more clearly reflect the difference between the area to be detected and the background area than the original difference of brightness values, and the difference and the differentiability between the HOG features and the background area are amplified, so that the follow-up binarization, segmentation and contour extraction are facilitated.
S3: binarization, segmentation and contour extraction are carried out on the image with different reactions obtained in the step S2, namely, pixel points are classified into a target spray area and a background area, segmentation is completed, the segmented background area is used for dynamic background correction and updating, the contour of the spray area can be extracted, and the extracted spray contour can be used for measuring and calculating spray related characteristic parameters.
In addition, a dynamic background correction updating mode is adopted in the processing process to cope with the situation that the background area in the image sequence changes, and the situation needs to be explained, wherein the background change is not large in some measurement, the situation can be considered to be static, and the average value of a plurality of background images can be used as the background image in the static situation; however, in some cases where the background map varies significantly (e.g., similar to the engine-like operation of FIG. 1), if the optical system is a schlieren method and even a density gradient can be seen, the ambient gas movement in the image background is very pronounced, at which time each imageA new (dynamic) background is required. After finishing S3 binarization, segmentation and contour extraction steps, the algorithm provided by the invention carries out dynamic background correction update, and initially uses the last image (excluding fuel spray) before the fuel spray image to be detected in the image sequence as an initial background (which can be marked as Bk) 01 ) Based on Bk01 and the first fuel spray image to be detected (I 01 ) Image processing to detect I 01 The target spray area and the background area are divided, and then I is carried out 01 Pixels in background areas on an image are placed at Bk 01 To complete background updating correction and obtain Bk 02 The next image segmentation will be based on I 02 And Bk 02 By analogy, the segmentation of all fuel spray image sequences can be better accomplished one by one using dynamic background correction updates.
In the thermal fluid image processing method provided by this specific application example, in the step S1 direction gradient Histogram (HOG) feature extraction, the HOG feature extraction is performed on each pixel (I, j) on the fuel spray image I to be detected and the background image Bk, respectively, and fig. 4 is a schematic diagram of the step S1 direction gradient Histogram (HOG) feature extraction step of the present invention, and this example is used to process the 49 th fuel spray image I to be detected 49 When extracting the diagram to be detected and the background diagram Bk 49 HOG characteristics of the 22 nd row and 207 th column pixels are taken as an example.
In the thermal fluid image processing method provided by this specific application example, when the HOG feature of each pixel is extracted, S1-a primitive division is performed, and a nearby n×n region (3×3,5×5, 7×7, etc.) centered on the point (i, j) is selected as a pixel (i, j) primitive C (i, j), and for the pixel at the boundary, the surrounding can be complemented by a copy value or the like. In this example, the primitive size is 3×3, and is shown in fig. 4 And->Specific values of (2). S1 is carried outBefore calculating the gradient magnitude and direction, gamma correction is performed on the gray value of the original image, taking the square root +.>Subsequent gradient calculations are performed as shown in fig. 4.
After the S1-a primitive is partitioned, the S1-b gradient magnitude and direction calculations are performed, the primitives are shown in FIG. 4The calculation of the horizontal gradient and the vertical gradient is respectively carried out on 9 units (pixels) in each primitive to obtain +.>And->Setting right positive when performing horizontal gradient calculation on a unit (pixel), subtracting the value of a unit (pixel) adjacent to the left side of the unit (pixel) from the value of a unit (pixel) adjacent to the right side of the unit (pixel) to obtain a horizontal gradient, setting down positive when performing vertical gradient calculation on the unit (pixel), and subtracting the value of a unit (pixel) adjacent to the upper side of the unit (pixel) from the value of a unit (pixel) adjacent to the lower side of the unit (pixel) to obtain a vertical gradient. For pixels at the boundary, the surrounding is filled up using the method of duplicate values in computing the gradient, as shown in FIG. 4, to compute the primitive +.>For example, the horizontal gradient of the upper left corner cell value 9.33 is obtained by subtracting the left side filled value (9.33) by the copy method from the right side pixel value (7.87) to obtain a horizontal gradient-1.46, the vertical gradient is obtained by subtracting the upper side filled value (9.33) by the copy method from the lower side value (11) to obtain a vertical gradient 1.67, and the calculation of the horizontal gradient and the vertical gradient of other cells can be similarly performed.
Next, the calculation will be performedVector synthesis is performed on the obtained horizontal gradient and vertical gradient to obtain the gradient magnitude and direction in the two-dimensional plane, and may be expressed in polar coordinates (ρ, θ), where ρ represents the magnitude of the synthesized gradient, and θ represents the direction of the synthesized gradient, to calculate the primitiveFor example, the horizontal gradient-1.46 and the vertical gradient 1.67 of the upper left corner element, the magnitude of the synthesized vector is +.>Vector synthesis of horizontal and vertical gradients for other elements with a vector direction at 131.2 ° to the horizontal may be similarly accomplished, where step S1-b. Gradient magnitude and direction calculations are accomplished, one for each element (pixel) in a 3 x 3 primitive, 9 vectors for each primitive, as shown in fig. 4.
After calculation of the gradient magnitude and direction, the S1-c direction histogram classification and superposition is performed, in this step, the gradient direction [0 °,360 ° ] is first divided into N classes, where N is the dimension of the HOG feature, each dimension corresponds to a latitude, in this example N is 9, where the 9 classes correspond to intervals with a range of 40 °, respectively, then the 9 gradient vectors in the primitive obtained in the calculation of the gradient magnitude and direction of S1-b are classified into each latitude according to the angle, and then all the gradient magnitudes classified into the same class (latitude) are superimposed to obtain the value of the HOG feature in the latitude, for example, in fig. 4, the fuel spray pattern I to be detected 49 HOG features corresponding to the middle pixels (22, 207) have 9 th latitude values of 2.01+1.55+3.78=7.34, and are obtained by superposition of 3 vectors within the range of [90 °,130 ° ] among 9 vectors in the primitive. Through the step, HOG characteristics corresponding to the fuel spray pattern base element to be detected can be obtainedHOG feature corresponding to background primitive +.>. The obtained HOG features may be normalized over all latitudes such that the sum of the values of the HOG features for each primitive (pixel) over each latitude is 1, resulting in a normalized HOG feature Hn, where the value for each latitude corresponds to->As shown in FIG. 4, HOG characteristics normalized by the map to be detected and the background map are obtained ∈ ->And->It can also be represented in the form of a histogram.
After the feature extraction of the S1 direction gradient Histogram (HOG), the method provided by the invention carries out the feature difference calculation of the S2 direction gradient Histogram (HOG), calculates the HOG feature (Hn) of the pixel point at the same position (i, j) on the fuel spray diagram to be detected and the background diagram I (i, j) and Hn Bk (i, j)) the difference calculation may be in the form of calculating the p-order (Lp-norm) difference, expressed as Hn I -Hn Bk || p = (∑ i |Hn I (i)-Hn Bk (i)| p ) 1/p P is a positive integer, and i is the respective latitude of the HOG feature.
As shown in FIG. 5, a schematic diagram of a step of calculating a difference of features of a direction gradient Histogram (HOG), in a step of calculating a difference of features of a S2 direction gradient Histogram (HOG), the difference calculation may be performed by calculating a 1 st order (L1-norm) difference, and the formula is Diff L1 =||Hn I -Hn Bk || 1 =∑ i |Hn I (i)-Hn Bk (i)| 1 ), Diff L1 The value range of (2) is [0,2 ]]The difference value of the HOG features of the spray pattern to be detected and the background pattern on the pixels (22, 207) in this example is 1.854 by />Juice is obtained by calculation.
After the difference calculation of the HOG characteristic of the gradient Histogram (HOG) in the direction of step S2, a difference graph of HOG characteristics of each pixel of the to-be-detected graph and the background graph can be obtained, as shown in the graph at the upper right corner in fig. 6, the resolution of the pixels is identical to that of the original graph, and is 112×400, and it can be obviously seen that the gray value of the to-be-detected object, namely the region where the fuel spray is located, is higher, the gray value of the background region is lower, the difference between the two is obvious, and the distinguishability is greatly increased compared with that of the original graph, which is also the essential principle of the core idea of the invention. The core idea is as follows: the difference of the target area and the background area in the pixel brightness gradient direction is used for distinguishing the target area and the background area, the segmentation extraction outline is completed, when judging whether a certain pixel point belongs to a target/background to be detected, the difference of the brightness values at the same position of the target area and the background area is different from the conventional method (carrying out binarization, contour extraction, segmentation and other operations based on the difference of the brightness values at the same position of the target area and the background area), the difference image of the gradient characteristics of the direction is subjected to binarization processing, and whether each pixel belongs to the target area is judged not only by judging the brightness value at the point but also by combining the information of the pixel point and the surrounding pixel points. The method provided by the patent performs operations such as binarization, contour extraction, segmentation and the like based on the difference between HOG features of the to-be-detected image and the background image, and has advantages in edge detection and region identification under certain conditions.
According to the difference map of the HOG features of the fuel spray map to be detected and the HOG features of the background map, step S3 of binarization, segmentation and contour extraction can be performed, in which the threshold selection in the step can refer to the threshold selection mode of the conventional image processing method, for example, the otsu threshold segmentation algorithm, in this example, the threshold value of the case when the HOG difference map of the 49 Zhang Ranyou spray image and the background image is processed is 0.88, the part of the two HOG features on the map with the difference value larger than 0.88 is identified as a fuel spray area, the part with the difference value not larger than 0.88 is the background area, then the target spray area can be obtained through conventional corrosion filling, and the contour of the target object fuel spray can be obtained by extracting the contour of the area, and the contour can be used for calculating the relevant characteristic parameters of spraying, such as penetration distance, cone angle, area and the like.
As before, the present invention adopts the dynamic background correction update mode in the processing process, as in FIG. 6, at I 49 After image segmentation is completed, pixels in the background area outside the spray contour are placed at Bk 49 To complete background updating correction and obtain Bk 50 The next image segmentation will be based on I 50 If appropriate) and Bk 50 Proceeding on the same thing, the segmentation of all image sequences can be better done one by one using dynamic background correction updates.
FIG. 7 shows the comparison of the effect of the image processing method according to the above embodiment of the present invention and the effect of the conventional processing method (by making the difference between the brightness values of the background image and the image to be detected and then dividing by threshold selection), the object to be processed is the image (I) shown in FIG. 3 (b) 49 ) The image processing method and specific steps in the above-described embodiments of the present invention are as described above, and the conventional method herein also employs dynamic background correction, the only difference between their image processing procedures is that the conventional method calculates only the difference in gray value between the background image of each pixel and the fuel spray image to be detected, whereas the method of the present invention calculates the difference in HOG characteristics, the threshold value in the conventional method is determined by Otsu's threshold value method (OTM), 2.5 times, 5 times the threshold value, and it can be seen from the figure that the spray profile (represented by continuous equigray profile lines in the figure) extracted by the conventional method is irregular and cluttered, and there is a large error in the edges (some pixels in the gas phase region of the spray are identified as the background instead of the spray) regardless of the selection of the threshold value. This is because the difference between the gray values of the spray area and the background area is small, so that it is difficult to obtain an accurate target spray profile by the conventional method.
As shown in fig. 7, compared with the conventional method, the method provided by the foregoing embodiment of the present invention recognizes that the divided fuel spray profile (represented by the continuous contour line with equal gray scale in the drawing) is more regular, and the result is more accurate, and in addition, the method provided by the foregoing embodiment of the present invention can obtain good effects when using different parameters (primitive size, HOG feature dimension, difference norm) in the image processing provided by the foregoing embodiment of the present invention, which indicates that the method provided by the foregoing embodiment of the present invention has good adaptability and is more versatile.
Fig. 8 is a schematic diagram of a thermal fluid image processing system according to an embodiment of the present invention.
As shown in fig. 8, the thermal fluid image processing system provided in this embodiment may include: the device comprises a direction gradient straight graph characteristic extraction module, a difference graph calculation module and an image processing module; wherein:
the thermal fluid image is divided into a to-be-detected image containing thermal fluid to be detected and identified and a background image not containing the thermal fluid to be detected and identified by the module, and the directional gradient histogram features of each pixel point of the to-be-detected image and the background image are respectively extracted;
The difference map calculation module calculates differences between the directional gradient histogram features of each pixel point of the map to be detected and the background map at the same position to obtain a difference map;
and the image processing module is used for carrying out binarization processing on the difference image, dividing the difference image into a target area and a background area, extracting the outline of the target area and finishing the processing of the thermal fluid image.
An embodiment of the present invention provides a terminal, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor is configured to execute the method according to any one of the foregoing embodiments of the present invention or to run the system according to any one of the foregoing embodiments of the present invention when the processor executes the program.
Optionally, a memory for storing a program; memory, which may include volatile memory (english) such as random-access memory (RAM), static random-access memory (SRAM), double data rate synchronous dynamic random-access memory (Double Data Rate Synchronous Dynamic Random Access Memory, DDR SDRAM), etc.; the memory may also include a non-volatile memory (English) such as a flash memory (English). The memory is used to store computer programs (e.g., application programs, functional modules, etc. that implement the methods described above), computer instructions, etc., which may be stored in one or more memories in a partitioned manner. And the above-described computer programs, computer instructions, data, etc. may be invoked by a processor.
The computer programs, computer instructions, etc. described above may be stored in one or more memories in partitions. And the above-described computer programs, computer instructions, data, etc. may be invoked by a processor.
A processor for executing the computer program stored in the memory to implement the steps in the method according to the above embodiment. Reference may be made in particular to the description of the embodiments of the method described above.
The processor and the memory may be separate structures or may be integrated structures that are integrated together. When the processor and the memory are separate structures, the memory and the processor may be connected by a bus coupling.
According to a fourth aspect of the present invention there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor is operative to perform a method according to any of the above embodiments of the present invention or to run a system according to any of the above embodiments of the present invention.
According to the thermal fluid image processing method, the thermal fluid image processing system, the thermal fluid image processing terminal and the thermal fluid image processing medium, digital images containing objects to be detected in the background can be processed based on the directional gradient histogram features, the directional gradient histogram features are firstly extracted, the steps of primitive division, gradient size and direction calculation, directional histogram classification superposition and the like are included, then the directional gradient histogram feature differences are calculated, binarization, segmentation, contour extraction and the like are further carried out, and the method covers algorithms for dynamic background correction and updating. The core idea is as follows: the difference between the target area and the background area can be increased by extracting the directional gradient histogram features of the two areas. The thermal fluid image processing method, the thermal fluid image processing system, the thermal fluid image processing terminal and the thermal fluid image processing medium provided by the embodiment of the invention can be applied to the field of thermal fluid image processing, target identification, edge detection and segmentation are carried out on a region to be detected and a background region, the thermal fluid image processing method, the thermal fluid image processing system and the thermal fluid image processing medium have the advantages that under the conditions that the difference between the target to be detected and the background is small and the background changes along with frames, the sensitivity of the thermal fluid image processing method, the thermal fluid image processing system and the thermal fluid image processing medium to parameter setting is low, the universality is good, the thermal fluid image processing method can be applied to different cases, working conditions and optical systems, the program is easy to realize, the processing speed is high, and the result is accurate and reliable.
It should be noted that, the steps in the method provided by the present invention may be implemented by using corresponding modules, devices, units, etc. in the system, and those skilled in the art may refer to the technical solutions of the method to implement the composition of the system, that is, the embodiments in the method may be understood as preferred examples for constructing the system, which are not described herein.
Those skilled in the art will appreciate that the invention provides a system and its individual devices that can be implemented entirely by logic programming of method steps, in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc., in addition to the system and its individual devices being implemented in pure computer readable program code. Therefore, the system and various devices thereof provided by the present invention may be considered as a hardware component, and the devices included therein for implementing various functions may also be considered as structures within the hardware component; means for achieving the various functions may also be considered as being either a software module that implements the method or a structure within a hardware component.
The foregoing describes specific embodiments of the present invention. It is to be understood that the invention is not limited to the particular embodiments described above, and that various changes and modifications may be made by one skilled in the art within the scope of the claims without affecting the spirit of the invention.

Claims (12)

1. A method of thermal fluid image processing, comprising:
dividing a plurality of thermal fluid images arranged according to a time sequence into a to-be-detected image containing the thermal fluid to be detected and identified and a background image not containing the thermal fluid to be detected and identified, and respectively extracting the directional gradient histogram characteristics of each pixel point of the to-be-detected image and the background image;
calculating the difference between the directional gradient histogram features of each pixel point in the to-be-detected image and the background image at the same position to obtain a difference image of the directional gradient histogram features;
performing binarization processing on the difference map, judging whether each pixel point belongs to a target area, dividing the difference map into a target area and a background area according to a judging result, extracting the outline of the target area, and finishing the processing of the thermal fluid image;
the extracting the directional gradient histogram features of each pixel point of the to-be-detected image and the background image respectively comprises the following steps:
for each pixel point (I, j) on the to-be-detected image I and the background image Bk, respectively taking the pixel point (I, j) as a center, acquiring an n multiplied by n region around the pixel point (I, j) as a primitive C (I, j) of the pixel point (I, j), and performing primitive segmentation on the to-be-detected image and the background image;
Gamma correction is carried out on the gray value of each primitive C (i, j), and square root is taken to obtain:for each pixel C ' in each resulting primitive C ' (i, j) ' (i,j) (m, n) horizontal gradients G x(i,j) (m, n) and vertical gradientIs calculated; will be identicalHorizontal gradient G of individual pixels x(i,j) (m, n) and vertical gradient->Vector synthesis is carried out to obtain the gradient size and gradient direction of each pixel point in the two-dimensional plane;
dividing the value range [0 DEG, 360 DEG ] of the gradient direction into N classes, wherein N is the dimension of the directional gradient histogram characteristic to be obtained, and each dimension corresponds to one latitude; each pixel C ' in the primitive C ' (i, j) ' (i,j) The gradient directions of (m, n) are respectively classified according to angles and divided into latitudes, the gradient magnitudes of all pixels divided into the same latitudes are overlapped to obtain the value of the obtained directional gradient histogram characteristic in the latitude, and then the directional gradient histogram characteristic H corresponding to each primitive is obtained (i,j)
2. The method of claim 1, wherein the value of n x n is: (2z+1) × (2z+1), z being a positive integer.
3. The method of thermal fluid image processing according to claim 1, wherein each pixel C ' in each primitive C ' (i, j) obtained by said pair ' (i,k) (m, n) horizontal gradients G x(i,j) (m, n) comprising:
set pixel C' (i,j) The first side of (m, n) is positive, using the pixel C' (i,j) (m, n) positive side adjacent pixels C' (i,j) The value of (m, n+1) minus the pixel C' (i,j) (m, n) a pixel C 'adjacent to a second side opposite to the first side' (i,j) The value of (m, n-1) yields a horizontal gradient;
each pixel C ' in each primitive C ' (i, j) of the pair ' (i,j) (m, n) performing vertical gradient respectivelyComprises the following steps:
set pixel C' (i,j) The third side of (m, n) is positive, using the pixel C' (i,j) Positive side adjacent pixel C 'of (m, n)' (i,j) The value of (m+1, n) minus the pixel C 'adjacent to the fourth side of the pixel opposite to the third side' (i,j) The value of (m-1, n) yields a vertical gradient.
4. The method according to claim 1, wherein the gradient direction is divided into N classes, where each class corresponds to a value range of (360/N) °, and the N classes include: [0 °,360/N °), [360/N °,2×360/N °), [2×360/n°,3×360/n°), … …, [ (N-1) ×360/n°,360 °.
5. The thermal fluid image processing method of claim 1, further comprising:
the direction gradient histogram characteristic H corresponding to each primitive (i,j) Normalization processing is carried out on all latitudes, so that the sum of values of the directional gradient histogram feature of each primitive on each latitude is 1, and a normalized directional gradient histogram feature Hn is obtained, wherein the value of the directional gradient histogram feature corresponding to each latitude
6. The method according to claim 1, wherein the calculating a difference between the directional gradient histogram features of each pixel point of the to-be-detected image and the background image at the same position includes: calculating the directional gradient histogram feature Hn of the pixel points (i, j) at the same position on the diagram to be detected and the background diagram by adopting a p-step difference calculation method I (i, j) and Hn Bk Differences between (i, j):
wherein p is a positive integer, and i is each latitude of the directional gradient histogram feature.
7. The method of claim 6, wherein the p is 1, then:
Diff L1 =||Hn I -Hn Bk || 1 =∑ i |Hn I (i)-Hn Bk (i)| 1 ),Diff L1 ∈[0,2]。
8. the method for processing a thermal fluid image according to claim 1, wherein the binarizing process is performed on the difference map, whether each pixel belongs to a target area is determined, each pixel is classified to obtain a target area and a background area, segmentation of the difference map is completed, and the outline of the target area is extracted; the segmented background areas are used for dynamic background correction updating, and the extracted outlines are used for measuring and calculating relevant characteristic parameters.
9. The method of thermal fluid image processing of claim 8, wherein the dynamic background correction update comprises:
taking a last image Bk_01 before a to-be-detected image in a plurality of thermal fluid images arranged according to a time sequence as a first background image, and carrying out image processing on the basis of the first background image Bk_01 and a first to-be-detected image I_01 to detect a target area and a background area on the first to-be-detected image I_01 so as to finish the segmentation of the first to-be-detected image I_01;
pixels in a background area on the first to-be-detected image I_01 are placed at the same position in the first background image Bk_01 to finish background updating correction, and an image of the first background image Bk_01 after finishing background updating is the second background image Bk_02;
acquiring a second background image Bk_02, and performing image processing based on the second image I_02 to be detected and the second background image Bk_02 to detect a target area and a background area on the second image I_02 to be detected, so as to finish the segmentation of the next image to be detected;
and so on until all the images to be detected in all the thermal fluid images are segmented.
10. A thermal fluid image processing system, comprising:
the device comprises a direction gradient histogram feature extraction module, a detection module and a detection module, wherein the direction gradient histogram feature extraction module divides a plurality of thermal fluid images into a to-be-detected image containing thermal fluid to be detected and identified and a background image not containing thermal fluid to be detected and identified, and extracts the direction gradient histogram features of each pixel point of the to-be-detected image and the background image respectively;
The difference map calculation module calculates the difference between the directional gradient histogram features of each pixel point in the to-be-detected map and the background map at the same position to obtain a difference map of the directional gradient histogram features;
the image processing module is used for carrying out binarization processing on the difference map, judging whether each pixel point belongs to a target area, dividing the difference map into a target area and a background area according to a judging result, extracting the outline of the target area and finishing the processing of the thermal fluid image;
the extracting the directional gradient histogram features of each pixel point of the to-be-detected image and the background image respectively comprises the following steps:
for each pixel point (I, j) on the to-be-detected image I and the background image Bk, respectively taking the pixel point (I, j) as a center, acquiring an n multiplied by n region around the pixel point (I, j) as a primitive C (I, j) of the pixel point (I, j), and performing primitive segmentation on the to-be-detected image and the background image;
gamma correction is carried out on the gray value of each primitive C (i, j), and square root is taken to obtain:for each primitive C 'obtained'Each pixel C 'in (i, j)' (i,j) (m, n) horizontal gradients G x(i,j) (m, n) and vertical gradientIs calculated; horizontal gradient G of the same pixel x(i,j) (m, n) and vertical gradient->Vector synthesis is carried out to obtain the gradient size and gradient direction of each pixel point in the two-dimensional plane;
dividing the value range [0 DEG, 360 DEG ] of the gradient direction into N classes, wherein N is the dimension of the directional gradient histogram characteristic to be obtained, and each dimension corresponds to one latitude; each pixel C ' in the primitive C ' (i, j) ' (i,j) The gradient directions of (m, n) are respectively classified according to angles and divided into latitudes, the gradient magnitudes of all pixels divided into the same latitudes are overlapped to obtain the value of the obtained directional gradient histogram characteristic in the latitude, and then the directional gradient histogram characteristic H corresponding to each primitive is obtained (i,j)
11. A terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor is operable to perform the method of any one of claims 1-9 or to run the system of claim 10 when the program is executed by the processor.
12. A computer readable storage medium having stored thereon a computer program, which when executed by a processor is operative to perform the method of any one of claims 1-9 or to run the system of claim 10.
CN202110742298.3A 2021-07-01 2021-07-01 Thermal fluid image processing method, system, terminal and medium Active CN113689455B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110742298.3A CN113689455B (en) 2021-07-01 2021-07-01 Thermal fluid image processing method, system, terminal and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110742298.3A CN113689455B (en) 2021-07-01 2021-07-01 Thermal fluid image processing method, system, terminal and medium

Publications (2)

Publication Number Publication Date
CN113689455A CN113689455A (en) 2021-11-23
CN113689455B true CN113689455B (en) 2023-10-20

Family

ID=78576820

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110742298.3A Active CN113689455B (en) 2021-07-01 2021-07-01 Thermal fluid image processing method, system, terminal and medium

Country Status (1)

Country Link
CN (1) CN113689455B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103197280A (en) * 2013-04-02 2013-07-10 中国科学院计算技术研究所 Access point (AP) location estimation method based on radio-frequency signal strength
CN103336965A (en) * 2013-07-18 2013-10-02 江西省电力公司检修分公司 Prospect and feature extraction method based on outline differences and principal direction histogram of block
CN105260709A (en) * 2015-09-28 2016-01-20 北京石油化工学院 Water meter detecting method, apparatus, and system based on image processing
CN108230365A (en) * 2017-12-26 2018-06-29 西安理工大学 SAR image change detection based on multi-source differential image content mergence
WO2019000653A1 (en) * 2017-06-30 2019-01-03 清华大学深圳研究生院 Image target identification method and apparatus
CN109214420A (en) * 2018-07-27 2019-01-15 北京工商大学 The high texture image classification method and system of view-based access control model conspicuousness detection
CN111612734A (en) * 2020-04-03 2020-09-01 苗锡奎 Background clutter characterization method based on image structure complexity

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103197280A (en) * 2013-04-02 2013-07-10 中国科学院计算技术研究所 Access point (AP) location estimation method based on radio-frequency signal strength
CN103336965A (en) * 2013-07-18 2013-10-02 江西省电力公司检修分公司 Prospect and feature extraction method based on outline differences and principal direction histogram of block
CN105260709A (en) * 2015-09-28 2016-01-20 北京石油化工学院 Water meter detecting method, apparatus, and system based on image processing
WO2019000653A1 (en) * 2017-06-30 2019-01-03 清华大学深圳研究生院 Image target identification method and apparatus
CN108230365A (en) * 2017-12-26 2018-06-29 西安理工大学 SAR image change detection based on multi-source differential image content mergence
CN109214420A (en) * 2018-07-27 2019-01-15 北京工商大学 The high texture image classification method and system of view-based access control model conspicuousness detection
CN111612734A (en) * 2020-04-03 2020-09-01 苗锡奎 Background clutter characterization method based on image structure complexity

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
赵露露.结合SVM底质分类的浅海光学遥感水深反演.《中国优秀硕士学位论文全文数据库 基础科学辑》.2021,第1-48页. *

Also Published As

Publication number Publication date
CN113689455A (en) 2021-11-23

Similar Documents

Publication Publication Date Title
CN106875381B (en) Mobile phone shell defect detection method based on deep learning
CN111476159A (en) Method and device for training and detecting detection model based on double-angle regression
Zhou et al. Exploring faster RCNN for fabric defect detection
CN112215217B (en) Digital image recognition method and device for simulating doctor to read film
CN104318559A (en) Quick feature point detecting method for video image matching
CN111739020A (en) Automatic labeling method, device, equipment and medium for periodic texture background defect label
CN112749673A (en) Method and device for intelligently extracting stock of oil storage tank based on remote sensing image
CN111626295A (en) Training method and device for license plate detection model
EP3376468B1 (en) Object detection device and object detection method
CN116228678A (en) Automatic identification and processing method for chip packaging defects
Jorge et al. Semi-automated extraction of longitudinal subglacial bedforms from digital terrain models–Two new methods
CN117037132A (en) Ship water gauge reading detection and identification method based on machine vision
CN113705564B (en) Pointer type instrument identification reading method
WO2022062853A1 (en) Remote sensing image registration method and apparatus, device, storage medium, and system
CN113689455B (en) Thermal fluid image processing method, system, terminal and medium
CN113436218A (en) SAR image edge detection method based on Gaussian filtering and mean filtering
Buck et al. Enhanced ship detection from overhead imagery
CN109470269B (en) Calibration method, calibration equipment and calibration system for space target measuring mechanism
CN116935369A (en) Ship water gauge reading method and system based on computer vision
CN111462099A (en) Image cell area positioning method based on rapid integral chart monitoring
CN114913500B (en) Pose determination method and device, computer equipment and storage medium
CN113033578B (en) Image calibration method, system, terminal and medium based on multi-scale feature matching
CN116128919A (en) Multi-temporal image abnormal target detection method and system based on polar constraint
CN116385915A (en) Water surface floater target detection and tracking method based on space-time information fusion
CN110751189B (en) Ellipse detection method based on perception contrast and feature selection

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
GR01 Patent grant
GR01 Patent grant