[go: up one dir, main page]

CN113344801A - Image enhancement method, system, terminal and storage medium applied to gas metering facility environment - Google Patents

Image enhancement method, system, terminal and storage medium applied to gas metering facility environment Download PDF

Info

Publication number
CN113344801A
CN113344801A CN202110239313.2A CN202110239313A CN113344801A CN 113344801 A CN113344801 A CN 113344801A CN 202110239313 A CN202110239313 A CN 202110239313A CN 113344801 A CN113344801 A CN 113344801A
Authority
CN
China
Prior art keywords
image
value
brightness
processed
denoised
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
CN202110239313.2A
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 Gas Group Co Ltd
Original Assignee
Beijing Gas Group 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 Gas Group Co Ltd filed Critical Beijing Gas Group Co Ltd
Priority to CN202110239313.2A priority Critical patent/CN113344801A/en
Publication of CN113344801A publication Critical patent/CN113344801A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The application provides an image enhancement method, a system, a terminal and a storage medium applied to a gas metering facility environment, wherein the method comprises the following steps: acquiring a picture frame through video streaming, and determining an image to be processed; performing noise estimation on the image to be processed based on the Filter-Base, and determining a noise estimation value; judging whether the noise estimation value is larger than a preset noise threshold value, if so, denoising the image to be processed by using a fast non-local uniform value denoising algorithm; performing brightness estimation on the denoised image to determine a brightness estimation value; judging whether the brightness estimated value is larger than a preset brightness threshold value, if so, performing enhancement processing on the denoised image by using a Retinex algorithm to obtain an enhanced image; according to the method, the image under the environment of the gas metering facility is denoised and enhanced through the rapid non-local uniform value denoising algorithm and the multi-scale Retinex algorithm, and the problem of weak quality images caused by factors such as illumination, foggy days and dust and terminal miniaturization is solved.

Description

Image enhancement method, system, terminal and storage medium applied to gas metering facility environment
Technical Field
The present application relates to the field of computer vision technologies, and in particular, to an image enhancement method, system, terminal, and storage medium applied in a gas metering facility environment.
Background
The gas metering facility plays a very important role in gas transmission and distribution service, and influences whether regional gas can be normally supplied or not. In recent years, the situation that a gas metering facility is damaged frequently occurs, the phenomenon is relieved along with the installation of a monitoring system, but the situation that the gas metering facility is damaged also occurs occasionally, due to the influence of a special position where the gas metering facility is located, video data collected by a video terminal is easily interfered by resolution, field illumination, scattered dust and other external influence factors, the image quality is weakened, a plurality of destructive behaviors occur in fog and low illumination, and great difficulty is brought to the inquiry and evidence obtaining of video monitoring.
CN101459763B A digital image enhancement method discloses a rapid digital image enhancement method, which combines gamma correction and enhancement of an image, and adopts segmented straight line processing to store segmented points after combination; the segmentation point value can be directly called for the current image and the rear frame to calculate to obtain the whole mapping table; the gamma correction and enhancement of the image are realized, the calculation amount is reduced, and the processing efficiency is improved. However, when the method is applied to the environment of the gas computing facility, the processing effect is poor, the calculation amount is reduced, and the definition of the image is reduced.
CN105469373B Retinex image enhancement method and system, the invention provides a Retinex image enhancement method and system. The method comprises the steps of carrying out multiple mean value filtering iterations on a video source image acquired by a camera to generate an image illumination component, and obtaining an image reflection component according to the source image and the image illumination component; correcting the image illumination component and the image reflection component; and calculating to obtain an image enhanced by the Retinex image according to the corrected image illumination component and the image reflection component. The method can improve the illumination and brightness direction, but has low noise aiming at terminal dust and fog and poor treatment effect.
CN201210157662 an image enhancement method, the invention provides an image enhancement method, which respectively carries out reversible transformation on brightness dimensions of a visible light image and an infrared image to obtain contrast information and texture information of the visible light image and the infrared image; calculating a mask according to the saturation of the visible light image and the brightness of the visible light image; migrating the visible light image and the infrared image by using a mask, and calculating contrast information for enhancing the visible light image; migrating the visible light image and the infrared image by using a mask, and calculating texture information for enhancing the visible light image; reversible inverse transformation is carried out to obtain the brightness of the enhanced visible light image; and obtaining the enhanced visible light image according to the brightness of the enhanced visible light image and the saturation and hue mixture of the visible light image. The image enhancement method has a good implementation effect, but because the processing calculation amount is relatively large, the image enhancement requirement under the monitoring video is not met.
Therefore, an image enhancement method, a system, a terminal and a storage medium applied in a gas metering facility environment are needed to solve the problems of poor quality images caused by factors such as illumination, fog, dust and sand and the like and terminal miniaturization, improve the effectiveness of video monitoring and better play the role of video monitoring.
Disclosure of Invention
Aiming at the defects of the prior art, the application provides an image enhancement method, a system, a terminal and a storage medium applied to a gas metering facility environment, solves the problem of weak quality images caused by factors such as illumination, foggy weather, sand and dust and terminal miniaturization in the prior art, improves the effectiveness of video monitoring, and better plays a role in video monitoring.
In order to solve the above technical problem, in a first aspect, the present application provides an image enhancement method applied in a gas metering facility environment, including:
acquiring a picture frame through video streaming, and determining an image to be processed;
performing noise estimation on the image to be processed based on the Filter-Base, and determining a noise estimation value;
judging whether the noise estimation value is larger than a preset noise threshold value, if so, denoising the image to be processed by using a fast non-local uniform value denoising algorithm;
performing brightness estimation on the denoised image to determine a brightness estimation value;
and judging whether the brightness estimated value is larger than a preset brightness threshold value, if so, performing enhancement processing on the denoised image by using a Retinex algorithm to obtain an enhanced image.
Optionally, the performing noise estimation on the image to be processed based on the Filter-Base, and determining a noise estimation value includes: performing noise estimation on the image to be processed by the following formula to determine a noise estimation value:
Figure BDA0002961529920000031
Figure BDA0002961529920000032
Figure BDA0002961529920000033
wherein σnThe noise estimate is the magnitude of the noise, W is the image width, H is the image height, imageI refers to the image pixels, I (x, y) refers toThe image pixel points are convolution symbols, and N is an inner core kernel; the kernel is masked L by two filter operators1,L2And (4) forming.
Optionally, the determining whether the noise estimation value is greater than a preset noise threshold value, and if so, denoising the image to be processed by using a fast non-local uniform value denoising algorithm, including:
judging whether the noise estimation value is larger than a preset noise threshold value or not;
if yes, acquiring N pixel points of the image to be processed, and setting a search window and a domain window in the image to be processed, wherein Ds is used as the radius of the search window, the size of the search window is DxD, and D is 2Ds + 1; the neighborhood window takes ds as a radius, the size of the neighborhood window is dxd, and d is 2ds + 1;
and the domain window slides in the search window, the weight of the pixel is determined according to the similarity between adjacent domains, and the value of the pixel point of the denoised image is obtained.
Optionally, the determining the weight of the pixel according to the similarity between the neighboring domains to obtain the value of the pixel point of the denoised image includes:
setting a noisy image as v, setting the denoised image as u%, and calculating a gray value calculation formula at a pixel point x in u%:
Figure BDA0002961529920000034
wherein, the weight w (x, y) represents the similarity between the pixel points x and y, and the weight w (x, y) is the distance between the rectangular areas V (x) and V (y) with x and y as the center.
Optionally, the weight w (x, y) is calculated by the following formula:
Figure BDA0002961529920000041
h=kσn 2
wherein Z (x) is a normalized coefficient, h is a smooth coefficient, and k is a de-noising coefficient (k)>0),σnIs the noise estimate.
Optionally, the determining the weight of the pixel according to the similarity between the neighboring domains to obtain the value of the pixel point of the denoised image includes:
constructing an integral image about pixel difference values:
Figure BDA0002961529920000042
wherein S ist(z)=||v(x)-v(x+t)||2,St(z) represents the pixel difference, and x1 and x2 are two pixel points;
and the matrix multithreading operation is utilized to realize algorithm acceleration and enhance the image.
Optionally, the performing brightness estimation on the denoised image to determine a brightness estimation value includes:
converting the denoised image from an RGB format into an HSV format, namely hue (H), saturation (S) and lightness (V);
extracting lightness V and calculating the mean value thereof to obtain a brightness estimated value sigmal
Optionally, the determining whether the brightness estimation value is greater than a preset brightness threshold, if so, performing enhancement processing on the denoised image by using a Retinex algorithm to obtain an enhanced image includes:
judging whether the brightness estimated value is larger than a preset brightness threshold value or not;
if yes, performing Retinex transformation on the denoised image by using a transformation formula r (x, y) -logS (x, y) -log [ F (x, y) -S (x, y) ];
performing exponential operation on the processed result R (x, y) to obtain an enhanced image R (x, y);
wherein S (x, y) is the original input image, which represents the convolution operator, and F (x, y) is a gaussian function.
Optionally, the determining whether the brightness estimation value is greater than a preset brightness threshold, if so, performing enhancement processing on the denoised image by using a Retinex algorithm to obtain an enhanced image includes:
judging whether the brightness estimated value is larger than a preset brightness threshold value or not;
if yes, performing Retinex transformation on the denoised image by using a multi-scale transformation formula r (x, y) ═ r (x, y) + weight (i) (logS (x, y) -log [ F (x, y) × S (x, y) ]);
performing exponential operation on the processed result R (x, y) to obtain an enhanced image R (x, y);
wherein, S (x, y) is the original input image, which represents the convolution operator, F (x, y) is the gaussian function, weight (i) represents the weight corresponding to each scale, and the sum of the weights of the scales is 1.
Optionally, the mathematical formula of the gaussian function is:
Figure RE-GDA0003192657200000051
Figure BDA0002961529920000052
Figure BDA0002961529920000053
wherein, the sigma is the standard deviation of the Gaussian functionlFor the luminance estimation, t is the illumination enhancement coefficient and k is a constant.
In a second aspect, the present application further provides an image enhancement system for use in a gas metering facility environment, comprising:
the image acquisition unit is configured to acquire a picture frame through a video stream and determine an image to be processed;
the noise estimation unit is configured to perform noise estimation on the image to be processed based on the Filter-Base and determine a noise estimation value;
the image denoising unit is configured for judging whether the noise estimation value is larger than a preset noise threshold value, and if so, denoising the image to be processed by using a fast non-local uniform value denoising algorithm;
the brightness estimation unit is configured to perform brightness estimation on the denoised image and determine a brightness estimation value;
and the image enhancement unit is configured to judge whether the brightness estimation value is greater than a preset brightness threshold value, and if so, enhance the denoised image by using a Retinex algorithm to obtain an enhanced image.
Optionally, the noise estimation unit is specifically configured to:
performing noise estimation on the image to be processed by the following formula to determine a noise estimation value:
Figure BDA0002961529920000061
Figure BDA0002961529920000062
Figure BDA0002961529920000063
wherein σnThe method comprises the steps of (1) estimating the noise, wherein W is the image width, H is the image height, image pixels are indicated by image I, image pixel points are indicated by I (x, y), a convolution symbol is indicated by I, and N is an inner core kernel; the kernel is masked L by two filter operators1,L2And (4) forming.
Optionally, the image denoising unit is specifically configured to:
judging whether the noise estimation value is larger than a preset noise threshold value or not;
if yes, acquiring N pixel points of the image to be processed, and setting a search window and a domain window in the image to be processed, wherein Ds is used as the radius of the search window, the size of the search window is DxD, and D is 2Ds + 1; the neighborhood window takes ds as a radius, the size of the neighborhood window is dxd, and d is 2ds + 1;
and the domain window slides in the search window, the weight of the pixel is determined according to the similarity between adjacent domains, and the value of the pixel point of the denoised image is obtained.
Optionally, the image denoising unit is further specifically configured to:
setting a noisy image as v, setting the denoised image as u%, and calculating a gray value calculation formula at a pixel point x in u%:
Figure BDA0002961529920000064
wherein, the weight w (x, y) represents the similarity between the pixel points x and y, and the weight w (x, y) is the distance between the rectangular areas V (x) and V (y) with x and y as the center.
Optionally, the image denoising unit is further specifically configured to:
constructing an integral image about pixel difference values:
Figure BDA0002961529920000071
wherein S ist(z)=||v(x)-v(x+t)||2,St(z) represents the pixel difference, and x1 and x2 are two pixel points;
and the matrix multithreading operation is utilized to realize algorithm acceleration and enhance the image.
Optionally, the brightness estimation unit is specifically configured to:
converting the denoised image from an RGB format into an HSV format, namely hue (H), saturation (S) and lightness (V);
extracting lightness V and calculating the mean value thereof to obtain a brightness estimated value sigmal
Optionally, the image enhancement unit is specifically configured to:
judging whether the brightness estimated value is larger than a preset brightness threshold value or not;
if yes, performing Retinex transformation on the denoised image by using a transformation formula r (x, y) -logS (x, y) -log [ F (x, y) -S (x, y) ];
performing exponential operation on the processed result R (x, y) to obtain an enhanced image R (x, y);
wherein S (x, y) is the original input image, which represents the convolution operator, and F (x, y) is a gaussian function.
Optionally, the image enhancement unit is further specifically configured to:
judging whether the brightness estimated value is larger than a preset brightness threshold value or not;
if yes, performing Retinex transformation on the denoised image by using a multi-scale transformation formula r (x, y) ═ r (x, y) + weight (i) (logS (x, y) -log [ F (x, y) × S (x, y) ]);
performing exponential operation on the processed result R (x, y) to obtain an enhanced image R (x, y);
wherein, S (x, y) is the original input image, which represents the convolution operator, F (x, y) is the gaussian function, weight (i) represents the weight corresponding to each scale, and the sum of the weights of the scales is 1.
In a third aspect, the present application provides a terminal, comprising:
a processor, a memory, wherein,
the memory is used for storing a computer program which,
the processor is used for calling and running the computer program from the memory so as to make the terminal execute the method of the terminal.
In a fourth aspect, the present application provides a computer storage medium having instructions stored thereon, which when executed on a computer, cause the computer to perform the method of the above aspects.
Compared with the prior art, the method has the following beneficial effects:
according to the method, the image under the environment of the gas metering facility is denoised and enhanced through the rapid non-local uniform value denoising algorithm and the multi-scale Retinex algorithm, the problem of weak quality images caused by factors such as illumination, fog, dust and sand and the like and terminal miniaturization is solved, the low-illumination, fog-containing and dust-containing images can be effectively enhanced, the effectiveness of video monitoring is improved, and the effect of video monitoring is better played.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart of an image enhancement method applied in a gas metering facility environment according to an embodiment of the present application;
FIG. 2 is a flow chart of another image enhancement method applied in a gas metering facility environment according to an embodiment of the present application;
fig. 3 is a schematic diagram of image enhancement by a Retinex algorithm according to an embodiment of the present disclosure;
FIG. 4 is a flowchart of an image enhancement method applied in a gas metering facility environment according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an image enhancement system applied in a gas metering facility environment according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of a terminal system 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.
Referring to fig. 1, fig. 1 is a flowchart of an image enhancement method applied in a gas metering facility environment according to an embodiment of the present application, where the method 100 includes:
s101: acquiring a picture frame through video streaming, and determining an image to be processed;
s102: performing noise estimation on the image to be processed based on the Filter-Base, and determining a noise estimation value;
s103: judging whether the noise estimation value is larger than a preset noise threshold value, if so, denoising the image to be processed by using a fast non-local uniform value denoising algorithm;
s104: performing brightness estimation on the denoised image to determine a brightness estimation value;
s105: and judging whether the brightness estimated value is larger than a preset brightness threshold value, if so, enhancing the denoised image by utilizing a Retinex algorithm to obtain an enhanced image.
Based on the foregoing embodiment, as an optional embodiment, the S102 performs noise estimation on the image to be processed based on Filter-Base, and determines a noise estimation value, including:
performing noise estimation on the image to be processed by the following formula to determine a noise estimation value:
Figure BDA0002961529920000091
Figure BDA0002961529920000092
Figure BDA0002961529920000101
wherein σnThe method comprises the steps of (1) estimating the noise, wherein W is the image width, H is the image height, image pixels are indicated by image I, image pixel points are indicated by I (x, y), a convolution symbol is indicated by I, and N is an inner core kernel; the kernel is masked L by two filter operators1,L2And (4) forming.
Based on the foregoing embodiment, as an optional embodiment, the S103 determines whether the noise estimation value is greater than a preset noise threshold, and if so, denoises the to-be-processed image by using a fast non-local uniform value denoising algorithm, including:
judging the noise estimation value sigmanWhether or not it is greater than a preset noise threshold value mun
If yes, rapidly denoising the image by using a non-local uniform value, namely acquiring N pixel points of the image to be processed, and setting a search window and a domain window in the image to be processed, wherein the search window takes Ds as a radius, the size of the search window is DxD, and D is 2Ds + 1; the neighborhood window takes ds as a radius, the size of the neighborhood window is dxd, and d is 2ds + 1;
and the domain window slides in the search window, the weight of the pixel is determined according to the similarity between adjacent domains, and the value of the pixel point of the denoised image is obtained.
Based on the foregoing embodiment, as an optional embodiment, the determining a weight of a pixel according to similarity between neighboring domains to obtain a value of a pixel point of a denoised image includes:
setting a noisy image as v, setting the denoised image as u%, and calculating a gray value calculation formula at a pixel point x in u%:
Figure BDA0002961529920000102
wherein, the weight w (x, y) represents the similarity between the pixel points x and y, and the weight w (x, y) is the distance between the rectangular areas V (x) and V (y) with x and y as the center.
Specifically, the execution process of the fast non-local uniform value denoising algorithm is shown in fig. 3, the rectangular areas centered on x and y are v (x), v (y), the weight w (x, y) represents the similarity between the pixel points x and y, and the value is determined by the distances of the rectangular areas v (x), v (y) centered on x and y.
Based on the foregoing embodiment, as an optional embodiment, the weight w (x, y) is calculated by the following formula:
Figure BDA0002961529920000111
h=kσn 2
wherein Z (x) is a normalized coefficient, h is a smooth coefficient, and k is a de-noising coefficient (k)>0),σnIs the noise estimate.
It should be noted that h is a smoothing parameter, which controls the attenuation degree of the gaussian function, and the larger h, the flatter the change of the gaussian function, and the higher the denoising level, but at the same time, the more blurred the image will be. The smaller h, the more edge detail components remain, but too many noise points remain.
Based on the foregoing embodiment, as an optional embodiment, the determining a weight of a pixel according to similarity between neighboring domains to obtain a value of a pixel point of a denoised image includes:
constructing an integral image about pixel difference values:
Figure BDA0002961529920000112
wherein S ist(z)=||v(x)-v(x+t)||2,St(z) represents the pixel difference, and x1 and x2 are two pixel points;
and the matrix multithreading operation is utilized to realize algorithm acceleration and enhance the image.
The purpose of constructing the integral image of the pixel difference values is to accelerate arithmetic operation and realize enhancement processing on the image. The NL-means algorithm calculates the similarity between two rectangles with the time O (d)2) For each pixel point, it needs to be calculated and D in the search window2Similarity between pixels with a complexity of O (ND)2d2) When the distance between two fields is calculated after the integral image is constructed, the algorithm complexity is reduced to O (ND)2)。
Based on the foregoing embodiment, as an optional embodiment, the S104 performs luminance estimation on the denoised image to determine a luminance estimation value, including:
converting the denoised image from an RGB format into an HSV format, namely hue (H), saturation (S) and lightness (V);
extracting lightness V and calculating the mean value thereof to obtain a brightness estimated value sigmal
Based on the foregoing embodiment, as an optional embodiment, the S105 determines whether the brightness estimation value is greater than a preset brightness threshold, and if so, performs enhancement processing on the denoised image by using a Retinex algorithm to obtain an enhanced image, including:
judging whether the brightness estimated value is larger than a preset brightness threshold value or not;
if yes, performing Retinex transformation on the denoised image by using a transformation formula r (x, y) -logS (x, y) -log [ F (x, y) -S (x, y) ];
performing exponential operation on the processed result R (x, y) to obtain an enhanced image R (x, y);
wherein S (x, y) is the original input image, which represents the convolution operator, and F (x, y) is a gaussian function.
Compared with the conventional image enhancement method, the image enhancement method adds the brightness estimation value and the illumination enhancement coefficient, improves the algorithm, can adaptively enhance the image illumination, and realizes the adaptive enhancement by setting the threshold value.
It should be noted that, as shown in fig. 3, fig. 3 is a schematic diagram of image enhancement by a Retinex algorithm provided in the embodiment of the present application, and a basic assumption of Retinex theory is that an original image S is a product of an illumination image L and a reflectivity image R, which can be expressed as follows:
S(x,y)=L(x,y)×R(x,y),
where S (x, y) is the original image, L (x, y) is the luminance image, and R (x, y) is the reflection image.
The purpose of Retinex enhancement is to resolve the reflection component R (x, y) by estimating the luminance component L (x, y) in the input original image R (x, y), and to improve the visual effect of the image by eliminating the influence of illumination unevenness. Therefore, R (x, y) can be obtained by converting the image into the logarithmic domain, and the enhanced image R (x, y) can be obtained by performing exponential operation on R (x, y).
Based on the foregoing embodiment, as an optional embodiment, the S105 determines whether the brightness estimation value is greater than a preset brightness threshold, and if so, performs enhancement processing on the denoised image by using a Retinex algorithm to obtain an enhanced image, including:
judging whether the brightness estimated value is larger than a preset brightness threshold value or not;
if yes, performing Retinex transformation on the denoised image by using a multi-scale transformation formula r (x, y) ═ r (x, y) + weight (i) (logS (x, y) -log [ F (x, y) × S (x, y) ]);
performing exponential operation on the processed result R (x, y) to obtain an enhanced image R (x, y);
wherein, S (x, y) is the original input image, which represents the convolution operator, F (x, y) is the gaussian function, weight (i) represents the weight corresponding to each scale, and the sum of the weights of the scales is 1.
In addition, compared with a single-scale Retinex transform algorithm, color enhancement and color constancy can be realized by using a pyramid large, medium and small multi-scale Retinex transform design, and the multi-scale Retinex transform design usually uses three scales, and it is generally assumed that weights of the scales are equal, that is, w1, w2, w3 and 1/3.
Optionally, the mathematical formula of the gaussian function is:
Figure RE-GDA0003192657200000141
Figure BDA0002961529920000132
Figure BDA0002961529920000133
wherein, the sigma is the standard deviation of the Gaussian functionlFor the luminance estimation, t is the illumination enhancement coefficient and k is a constant.
It should be noted that the value of the gaussian function standard deviation σ may affect the effect of the Retinex algorithm on the low-illumination color image after processing. When the value of sigma is larger, the range of the action of the Gaussian function on the image pixel is larger, the influence of the surrounding pixels on the image pixel is smaller, the detailed information expression of the processed image is not obvious, the dynamic compression function of the image is weakened, the processed image has a better smoothing effect, and the color information of the image can be well expressed; when the value of sigma is smaller, the edge detail information can be well highlighted, the dynamic compression function of the image is enhanced, but the color information of the image cannot be well reserved.
Specifically, as shown in fig. 4, fig. 4 is a flowchart of an image enhancement method applied in a gas metering facility environment according to an embodiment of the present application:
s201: acquiring a picture frame through video streaming, and determining an image to be processed;
s202: performing noise estimation on the image to be processed based on the Filter-Base, and determining a noise estimation value;
s203: judging whether the noise estimation value is larger than a preset noise threshold value or not; if yes, executing S204, otherwise executing S205;
s204: denoising the image to be processed by utilizing a fast non-local uniform value denoising algorithm;
s205: performing brightness estimation on the image to determine a brightness estimation value;
s206: judging whether the brightness estimated value is larger than a preset brightness threshold value, if so, executing S207, otherwise, executing S208;
s207: enhancing the denoised image by utilizing a Retinex algorithm;
s208: and outputting the enhanced image.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an image enhancement system applied in a gas metering facility environment according to an embodiment of the present application, where the system 500 includes:
an image obtaining unit 501, configured to obtain a picture frame through a video stream, and determine an image to be processed;
a noise estimation unit 502 configured to perform noise estimation on the image to be processed based on the Filter-Base, and determine a noise estimation value;
an image denoising unit 503 configured to determine whether the noise estimation value is greater than a preset noise threshold, and if so, denoise the to-be-processed image by using a fast non-local uniform value denoising algorithm;
a brightness estimation unit 504 configured to perform brightness estimation on the denoised image to determine a brightness estimation value;
and the image enhancement unit 505 is configured to determine whether the brightness estimation value is greater than a preset brightness threshold, and if so, perform enhancement processing on the denoised image by using a Retinex algorithm to obtain an enhanced image.
Based on the foregoing embodiment, as an optional embodiment, the noise estimation unit 502 is specifically configured to:
performing noise estimation on the image to be processed by the following formula to determine a noise estimation value:
Figure BDA0002961529920000141
Figure BDA0002961529920000142
Figure BDA0002961529920000151
wherein σnThe method comprises the steps of (1) estimating the noise, wherein W is the image width, H is the image height, image pixels are indicated by image I, image pixel points are indicated by I (x, y), a convolution symbol is indicated by I, and N is an inner core kernel; the kernel is masked L by two filter operators1,L2And (4) forming.
Based on the foregoing embodiment, as an optional embodiment, the image denoising unit 503 is specifically configured to:
judging whether the noise estimation value is larger than a preset noise threshold value or not;
if yes, acquiring N pixel points of the image to be processed, and setting a search window and a domain window in the image to be processed, wherein Ds is used as the radius of the search window, the size of the search window is DxD, and D is 2Ds + 1; the neighborhood window takes ds as a radius, the size of the neighborhood window is dxd, and d is 2ds + 1;
and the domain window slides in the search window, the weight of the pixel is determined according to the similarity between adjacent domains, and the value of the pixel point of the denoised image is obtained.
Based on the foregoing embodiment, as an optional embodiment, the image denoising unit 503 is further specifically configured to:
setting a noisy image as v, setting the denoised image as u%, and calculating a gray value calculation formula at a pixel point x in u%:
Figure BDA0002961529920000152
wherein, the weight w (x, y) represents the similarity between the pixel points x and y, and the weight w (x, y) is the distance between the rectangular areas V (x) and V (y) with x and y as the center.
Based on the foregoing embodiment, as an optional embodiment, the image denoising unit 503 is further specifically configured to:
constructing an integral image about pixel difference values:
Figure BDA0002961529920000153
wherein S ist(z)=||v(x)-v(x+t)||2,St(z) represents the pixel difference, and x1 and x2 are two pixel points;
and the matrix multithreading operation is utilized to realize algorithm acceleration and enhance the image.
Based on the foregoing embodiment, as an optional embodiment, the luminance estimating unit 504 is specifically configured to:
converting the denoised image from an RGB format into an HSV format, namely hue (H), saturation (S) and lightness (V);
extracting lightness V and calculating the mean value thereof to obtain a brightness estimated value sigmal
Based on the foregoing embodiment, as an optional embodiment, the image enhancement unit 505 is specifically configured to:
judging whether the brightness estimated value is larger than a preset brightness threshold value or not;
if yes, performing Retinex transformation on the denoised image by using a transformation formula r (x, y) -logS (x, y) -log [ F (x, y) -S (x, y) ];
performing exponential operation on the processed result R (x, y) to obtain an enhanced image R (x, y);
wherein S (x, y) is the original input image, which represents the convolution operator, and F (x, y) is a gaussian function.
Based on the foregoing embodiment, as an optional embodiment, the image enhancement unit 505 is further specifically configured to:
judging whether the brightness estimated value is larger than a preset brightness threshold value or not;
if yes, performing Retinex transformation on the denoised image by using a multi-scale transformation formula r (x, y) ═ r (x, y) + weight (i) (logS (x, y) -log [ F (x, y) × S (x, y) ]);
performing exponential operation on the processed result R (x, y) to obtain an enhanced image R (x, y);
wherein, S (x, y) is the original input image, which represents the convolution operator, F (x, y) is the gaussian function, weight (i) represents the weight corresponding to each scale, and the sum of the weights of the scales is 1.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a terminal system 600 according to an embodiment of the present disclosure, where the terminal system 600 may be used to execute the image enhancement method applied in a gas metering facility environment according to the embodiment of the present disclosure.
The terminal system 600 may include: a processor 601, a memory 602, and a communication unit 603. The components communicate via one or more buses, and those skilled in the art will appreciate that the architecture of the servers shown in the figures is not intended to be limiting and may be a bus architecture, a star architecture, a combination of more or less components than those shown, or a different arrangement of components.
The memory 602 may be used for storing instructions executed by the processor 601, and the memory 602 may be implemented by any type of volatile or non-volatile storage terminal or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The execution instructions in the memory 602, when executed by the processor 601, enable the terminal system 600 to perform some or all of the steps in the method embodiments described below.
The processor 601 is a control center of the storage terminal, connects various parts of the entire electronic terminal using various interfaces and lines, and performs various functions of the electronic terminal and/or processes data by operating or executing software programs and/or modules stored in the memory 602 and calling data stored in the memory. The processor may be composed of an Integrated Circuit (IC), for example, a single packaged IC, or may be composed of multiple packaged ICs with the same or different functions. For example, the processor 601 may include only a Central Processing Unit (CPU). In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
A communication unit 603 configured to establish a communication channel so that the storage terminal can communicate with other terminals. And receiving user data sent by other terminals or sending the user data to other terminals.
The present application also provides a computer storage medium, wherein the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments provided by the present invention when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
According to the method, the image under the environment of the gas metering facility is denoised and enhanced through the rapid non-local uniform value denoising algorithm and the multi-scale Retinex algorithm, the problem of weak quality images caused by factors such as illumination, fog, dust and sand and the like and terminal miniaturization is solved, the low-illumination, fog-containing and dust-containing images can be effectively enhanced, the effectiveness of video monitoring is improved, and the effect of video monitoring is better played.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system provided by the embodiment, the description is relatively simple because the system corresponds to the method provided by the embodiment, and the relevant points can be obtained by referring to the description of the method part.
The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are 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 like elements in a process, method, article, or apparatus that comprises the element.

Claims (13)

1. An image enhancement method applied to the environment of a gas metering facility is characterized by comprising the following steps:
acquiring a picture frame through video streaming, and determining an image to be processed;
performing noise estimation on the image to be processed based on the Filter-Base, and determining a noise estimation value;
judging whether the noise estimation value is larger than a preset noise threshold value, if so, denoising the image to be processed by using a fast non-local uniform value denoising algorithm;
performing brightness estimation on the denoised image to determine a brightness estimation value;
and judging whether the brightness estimated value is larger than a preset brightness threshold value, if so, enhancing the denoised image by utilizing a Retinex algorithm to obtain an enhanced image.
2. The image enhancement method applied to the environment of the gas metering facility, according to claim 1, wherein the noise estimation is performed on the image to be processed based on Filter-Base, and the determining of the noise estimation value comprises: performing noise estimation on the image to be processed by the following formula to determine a noise estimation value:
Figure FDA0002961529910000011
Figure FDA0002961529910000012
Figure FDA0002961529910000013
wherein σnThe method comprises the steps of (1) estimating the noise, wherein W is the image width, H is the image height, image pixels are indicated by image I, image pixel points are indicated by I (x, y), a convolution symbol is indicated by I, and N is an inner core kernel; the kernel is masked by two filter operators L1,L2And (4) forming.
3. The method as claimed in claim 1, wherein the determining whether the noise estimation value is greater than a preset noise threshold value, and if so, denoising the image to be processed by using a fast non-local uniform value denoising algorithm includes:
judging whether the noise estimation value is larger than a preset noise threshold value or not;
if yes, acquiring N pixel points of the image to be processed, and setting a search window and a field window in the image to be processed, wherein Ds is used as the radius of the search window, the size of the search window is DxD, and D is 2Ds + 1; the neighborhood window takes ds as a radius, the size of the neighborhood window is dxd, and d is 2ds + 1;
and the domain window slides in the search window, the weight of the pixel is determined according to the similarity between adjacent domains, and the value of the pixel point of the denoised image is obtained.
4. The image enhancement method applied to the environment of the gas metering facility, as claimed in claim 3, wherein the determining the weight of the pixel according to the similarity between the neighboring domains to obtain the value of the pixel point of the denoised image comprises:
setting a noisy image as v, setting the denoised image as u%, and calculating a gray value calculation formula at a pixel point x in u%:
Figure FDA0002961529910000021
wherein, the weight w (x, y) represents the similarity between the pixel points x and y, and the weight w (x, y) is the distance between the rectangular areas V (x) and V (y) with x and y as the center.
5. The image enhancement method applied to the environment of the gas metering facility, according to claim 4, wherein the weight w (x, y) is calculated by the formula:
Figure FDA0002961529910000022
h=kσn 2
wherein Z (x) is a normalized coefficient, h is a smooth coefficient, and k is a de-noising coefficient (k)>0),σnIs the noise estimate.
6. The image enhancement method applied to the environment of the gas metering facility, as claimed in claim 4, wherein the determining the weight of the pixel according to the similarity between the neighboring domains to obtain the value of the pixel point of the denoised image comprises:
constructing an integral image about pixel difference values:
Figure FDA0002961529910000023
wherein S ist(z)=||v(x)-v(x+t)||2,St(z) represents the pixel difference, and x1 and x2 are two pixel points;
and the matrix multithreading operation is utilized to realize algorithm acceleration and enhance the image.
7. The method as claimed in claim 1, wherein the performing a brightness estimation on the denoised image to determine a brightness estimation value includes:
converting the denoised image from an RGB format into an HSV format, namely hue (H), saturation (S) and lightness (V);
extracting lightness V and calculating the mean value thereof to obtain a brightness estimated value sigmal
8. The method as claimed in claim 1, wherein the determining whether the brightness estimation value is greater than a preset brightness threshold value, if so, performing enhancement processing on the denoised image by using a Retinex algorithm to obtain an enhanced image includes:
judging whether the brightness estimated value is larger than a preset brightness threshold value or not;
if yes, performing Retinex transformation on the denoised image by using a transformation formula r (x, y) -logS (x, y) -log [ F (x, y) -S (x, y) ];
performing exponential operation on the processed result R (x, y) to obtain an enhanced image R (x, y);
wherein S (x, y) is the original input image, which represents the convolution operator, and F (x, y) is a gaussian function.
9. The method as claimed in claim 1, wherein the determining whether the brightness estimation value is greater than a preset brightness threshold value, if so, performing enhancement processing on the denoised image by using a Retinex algorithm to obtain an enhanced image includes:
judging whether the brightness estimated value is larger than a preset brightness threshold value or not;
if yes, performing Retinex transformation on the denoised image by using a multi-scale transformation formula r (x, y) ═ r (x, y) + weight (i) (logS (x, y) -log [ F (x, y) × S (x, y) ]);
performing exponential operation on the processed result R (x, y) to obtain an enhanced image R (x, y);
wherein, S (x, y) is the original input image, which represents the convolution operator, F (x, y) is the gaussian function, weight (i) represents the weight corresponding to each scale, and the sum of the weights of the scales is 1.
10. The image enhancement method applied to the environment of the gas metering facility according to any one of claims 8 or 9, wherein the mathematical formula of the gaussian function is as follows:
Figure RE-FDA0003192657190000041
Figure RE-FDA0003192657190000042
Figure RE-FDA0003192657190000043
wherein, the sigma is the standard deviation of the Gaussian functionlFor the luminance estimation, t is the illumination enhancement coefficient and k is a constant.
11. An image enhancement system for use in a gas metering facility environment, comprising:
the image acquisition unit is configured to acquire a picture frame through a video stream and determine an image to be processed;
the noise estimation unit is configured for carrying out noise estimation on the image to be processed based on the Filter-Base and determining a noise estimation value;
the image denoising unit is configured to judge whether the noise estimation value is larger than a preset noise threshold value, and if so, denoise the image to be processed by using a fast non-local uniform value denoising algorithm;
the brightness estimation unit is configured to perform brightness estimation on the denoised image and determine a brightness estimation value;
and the image enhancement unit is configured to judge whether the brightness estimated value is greater than a preset brightness threshold value, and if so, enhance the denoised image by using a Retinex algorithm to obtain an enhanced image.
12. A terminal, comprising:
a processor;
a memory for storing instructions for execution by the processor;
wherein the processor is configured to perform the method of any one of claims 1-10.
13. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-10.
CN202110239313.2A 2021-03-04 2021-03-04 Image enhancement method, system, terminal and storage medium applied to gas metering facility environment Pending CN113344801A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110239313.2A CN113344801A (en) 2021-03-04 2021-03-04 Image enhancement method, system, terminal and storage medium applied to gas metering facility environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110239313.2A CN113344801A (en) 2021-03-04 2021-03-04 Image enhancement method, system, terminal and storage medium applied to gas metering facility environment

Publications (1)

Publication Number Publication Date
CN113344801A true CN113344801A (en) 2021-09-03

Family

ID=77467714

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110239313.2A Pending CN113344801A (en) 2021-03-04 2021-03-04 Image enhancement method, system, terminal and storage medium applied to gas metering facility environment

Country Status (1)

Country Link
CN (1) CN113344801A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112946232A (en) * 2021-02-04 2021-06-11 成都秦川物联网科技股份有限公司 Natural gas energy metering data acquisition method and system
CN115100084A (en) * 2022-08-26 2022-09-23 天津市联大通讯发展有限公司 Intelligent image enhancement camera shooting method for port complex illumination environment
CN115311161A (en) * 2022-08-11 2022-11-08 北京百度网讯科技有限公司 Image enhancement method, device, equipment and storage medium based on artificial intelligence
CN115797212A (en) * 2022-12-07 2023-03-14 国网福建省电力有限公司经济技术研究院 Image noise reduction method and device and storage medium
US12196728B2 (en) 2021-02-04 2025-01-14 Chengdu Qinchuan Iot Technology Co., Ltd. Systems and methods for measuring energy of natural gas components

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050636A (en) * 2014-06-05 2014-09-17 华侨大学 Method for enhancing granularity-controllable low-illuminance image
CN106530250A (en) * 2016-11-07 2017-03-22 湖南源信光电科技有限公司 Low illumination color image enhancement method based on improved Retinex
CN107273809A (en) * 2017-05-22 2017-10-20 哈尔滨工程大学 A kind of method of the real-time autonomous classification of fishing net under water for power buoy
CN109598680A (en) * 2018-10-19 2019-04-09 浙江工业大学 Shearing wave conversion medicine CT image denoising method based on quick non-local mean and TV-L1 model
CN111444809A (en) * 2020-03-23 2020-07-24 华南理工大学 An abnormal target detection method for transmission lines based on improved YOLOv3
CN111783744A (en) * 2020-07-31 2020-10-16 上海仁童电子科技有限公司 Operation site safety protection detection method and device
CN111918095A (en) * 2020-08-05 2020-11-10 广州市百果园信息技术有限公司 Dim light enhancement method and device, mobile terminal and storage medium
CN111985449A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Recognition method, device, equipment and computer medium for rescue scene images

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050636A (en) * 2014-06-05 2014-09-17 华侨大学 Method for enhancing granularity-controllable low-illuminance image
CN106530250A (en) * 2016-11-07 2017-03-22 湖南源信光电科技有限公司 Low illumination color image enhancement method based on improved Retinex
CN107273809A (en) * 2017-05-22 2017-10-20 哈尔滨工程大学 A kind of method of the real-time autonomous classification of fishing net under water for power buoy
CN109598680A (en) * 2018-10-19 2019-04-09 浙江工业大学 Shearing wave conversion medicine CT image denoising method based on quick non-local mean and TV-L1 model
CN111444809A (en) * 2020-03-23 2020-07-24 华南理工大学 An abnormal target detection method for transmission lines based on improved YOLOv3
CN111783744A (en) * 2020-07-31 2020-10-16 上海仁童电子科技有限公司 Operation site safety protection detection method and device
CN111918095A (en) * 2020-08-05 2020-11-10 广州市百果园信息技术有限公司 Dim light enhancement method and device, mobile terminal and storage medium
CN111985449A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Recognition method, device, equipment and computer medium for rescue scene images

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112946232A (en) * 2021-02-04 2021-06-11 成都秦川物联网科技股份有限公司 Natural gas energy metering data acquisition method and system
US12196728B2 (en) 2021-02-04 2025-01-14 Chengdu Qinchuan Iot Technology Co., Ltd. Systems and methods for measuring energy of natural gas components
CN115311161A (en) * 2022-08-11 2022-11-08 北京百度网讯科技有限公司 Image enhancement method, device, equipment and storage medium based on artificial intelligence
CN115311161B (en) * 2022-08-11 2023-11-17 北京百度网讯科技有限公司 Image enhancement methods, devices, equipment and storage media based on artificial intelligence
CN115100084A (en) * 2022-08-26 2022-09-23 天津市联大通讯发展有限公司 Intelligent image enhancement camera shooting method for port complex illumination environment
CN115797212A (en) * 2022-12-07 2023-03-14 国网福建省电力有限公司经济技术研究院 Image noise reduction method and device and storage medium

Similar Documents

Publication Publication Date Title
US11113795B2 (en) Image edge processing method, electronic device, and computer readable storage medium
CN113344801A (en) Image enhancement method, system, terminal and storage medium applied to gas metering facility environment
CN110706174B (en) Image enhancement method, terminal device and storage medium
Galdran et al. On the duality between retinex and image dehazing
CN110717878B (en) Image fusion method and device, computer equipment and storage medium
CN109064426B (en) A method and device for suppressing glare and enhancing images in low-light images
CN107408296B (en) Real-time noise for high dynamic range images is eliminated and the method and system of image enhancement
US9142009B2 (en) Patch-based, locally content-adaptive image and video sharpening
CN110717922A (en) A method and device for evaluating image clarity
KR101456445B1 (en) Apparatus and method for image defogging in HSV color space and recording medium storing program for executing method of the same in computer
WO2023273868A1 (en) Image denoising method and apparatus, terminal, and storage medium
JPWO2016189901A1 (en) Image processing apparatus, image processing method, program, recording medium recording the same, video photographing apparatus, and video recording / reproducing apparatus
CN109035287A (en) Foreground image extraction method and device, moving vehicle recognition methods and device
CN106504205A (en) A kind of image defogging method and terminal
CN114596210A (en) Noise estimation method, device, terminal equipment and computer readable storage medium
CN111915497A (en) Image black and white enhancement method and device, electronic equipment and readable storage medium
Kang et al. Simultaneous image enhancement and restoration with non-convex total variation
CN111311610A (en) Image segmentation method and terminal device
CN105243651B (en) Image edge enhancement method based on approximating variances and dark-coloured block pixels statistics information
Han et al. Automatic illumination and color compensation using mean shift and sigma filter
CN115272362A (en) Method and device for segmenting effective area of digital pathology full-field image
CN114648448B (en) Image enhancement method, device, equipment and storage medium
CN113438386A (en) Dynamic and static judgment method and device applied to video processing
CN112581411B (en) Image defogging method and terminal
CN115512118A (en) Image processing method and device

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210903

RJ01 Rejection of invention patent application after publication