Image enhancement method and system based on improved Retinex

文档序号:154372 发布日期:2021-10-26 浏览:38次 中文

阅读说明:本技术 一种基于改进Retinex的图像增强方法和系统 (Image enhancement method and system based on improved Retinex ) 是由 程德强 徐进洋 张云鹤 寇旗旗 王晓艺 韩成功 于 2021-08-13 设计创作,主要内容包括:本发明提出了一种基于改进Retinex的图像增强方法和系统,其主要的目的是解决传统Retinex增强方法的效果差,速度慢,效率低等问题,可以较好地解决图像细节和颜色保真度的冲突问题,改善光晕现象,所述装置包括图像采集单元,基于华为海思Hi3519AV100处理器的FEA3519A-C图像处理核心板,PC端控制单元和图像输出模块。(The invention provides an image enhancement method and system based on improved Retinex, and mainly aims to solve the problems of poor effect, low speed, low efficiency and the like of the traditional Retinex enhancement method, well solve the problem of conflict between image details and color fidelity and improve the halo phenomenon.)

1. An image enhancement method for improving Retinex is characterized in that: the method comprises the following steps:

a. converting the image to be processed from the RGB domain to the HSV domain;

b. for the V component, carrying out wavelet decomposition on the V component to decompose a high-frequency component and a low-frequency component;

c. for low-frequency components, a multi-channel bilateral filtering Retinex method is adopted for processing;

d. for the high-frequency component, carrying out image sharpening processing by adopting a Laplacian operator;

e. wavelet reconstruction is carried out on the processed high-frequency component and the processed low-frequency component to form a new V component;

f. for the S component, processing by adopting a segmented logarithmic stretching method;

g. and converting the image from the HSV domain to the RGB domain to obtain a finally processed image.

2. The method of claim 1, wherein: the step a converts the image from the RGB domain to the HSV domain.

3. The method of claim 1, wherein: and b, performing two-dimensional wavelet transformation on the V component to obtain a high-frequency component and a low-frequency component, wherein a decomposition formula is as follows:

4. the method of claim 1, wherein: and c, performing multi-channel bilateral filtering Retinex processing on the low-frequency component to eliminate the halo phenomenon, wherein the weight function of the filter is defined as: w [ (x, y), (x ', y')]=ws[(x,y),(x',y')]×wR[(x,y),(x',y')]。

5. The method of claim 1, wherein: and d, sharpening the high-frequency component to highlight the edge information of the image.

6. The method of claim 1, wherein: and f, carrying out piecewise linear processing on the S component:

the processing formula is as follows:

S(x′,y′)=a×lg[1+S(x,y)](ii) a Wherein α represents a stretch coefficient, defined as

7. A system for improving a Retinex image enhancement method is characterized in that: the system comprises an image acquisition module, an image processing module and an image output module, wherein:

the image acquisition module is used for image acquisition work under different environments;

the image processing module is used for carrying out mathematical processing on the acquired image;

and the image output module is used for displaying the processing result.

8. The system of claim 7, wherein the image enhancement method further comprises: the image acquisition module is used for converting the acquired image from an RGB domain to an HSV domain.

9. The system of claim 7, wherein the image enhancement method further comprises: the image processing module is used for processing the S component and the V component.

10. The system of claim 7, wherein the image enhancement method further comprises: the image output module is used for converting the image from the HSV domain to the RGB domain and performing printing display.

Technical Field

The invention belongs to the technical field of image enhancement, and particularly relates to an image enhancement method and system based on improved Retinex.

Background

With the rapid development of computer vision, smart cities gradually appear in the visual field of people, and the smart cities are distributed in various aspects of human clothes, food and habitation, so that the life of people is more convenient. The computer vision technology is the core supporting the development of smart cities, the image processing is the foundation of the computer vision, and the research on images and videos gradually becomes the topic of the heat of researchers. The environment in nature is often not ideal, the quality of the obtained image is not high, processing of low quality images may result in errors in results, and economic losses may be caused seriously. It is therefore particularly important to enhance the image to obtain a higher quality image. The image enhancement method is to add some information or transform data to the original image by some means to selectively highlight interesting features in the image or to suppress (mask) some unwanted features in the image to match the image to the visual response characteristics. By performing enhancement processing on the image, the computer can be made to operate faster and more stably.

In the image enhancement process, the reason for image quality degradation is not analyzed, and the mainstream enhancement method mainly comprises the following steps of:

the image enhancement algorithm of the airspace is to carry out linear or nonlinear transformation on space pixel points of the image, so that the gray value of the image is stretched, and the effect of image enhancement is achieved; the frequency domain image enhancement algorithm is to take an image as a two-dimensional signal, convert the signal to a frequency domain through Fourier transform or other transform, and perform filtering operation on the image by adopting different filters so as to achieve the effect of image enhancement.

The existing mainstream image enhancement method mainly has the following defects:

firstly, the method comprises the following steps: the image is operated in the RGB domain, and the correlation among colors is large, so that the image detail and the color fidelity are not fully realized.

Secondly, the method comprises the following steps: due to the self limitation of the Gaussian filter, only space factors are considered, and brightness factors are not considered, so that a 'halo' phenomenon can be generated at a place with sudden depth of field, and the processed effect is poor.

Thirdly, the method comprises the following steps: the image enhancement algorithm with a slightly better effect needs to perform complex operation, has a low processing speed and poor real-time performance, so an image enhancement method and an image enhancement system based on improved Retinex need to be designed to solve the problems.

Disclosure of Invention

The present invention aims to provide an image enhancement method and system based on improved Retinex, which can solve the above problems.

The technical scheme adopted by the invention is as follows:

an image enhancement method for improving Retinex, which comprises the following steps:

a. converting the image to be processed from the RGB domain to the HSV domain;

b. for the V component, carrying out wavelet decomposition on the V component to decompose a high-frequency component and a low-frequency component;

c. for low-frequency components, a multi-channel bilateral filtering Retinex method is adopted for processing;

d. for the high-frequency component, carrying out image sharpening processing by adopting a Laplacian operator;

e. wavelet reconstruction is carried out on the processed high-frequency component and the processed low-frequency component to form a new V component;

f. optimizing the S component by adopting a segmented logarithmic stretching method;

g. and converting the image from the HSV domain to the RGB domain to obtain a final processed image.

The invention is further improved in that: step a, converting the image from RGB domain to HSV domain

The invention is further improved in that: and b, performing two-dimensional wavelet transformation on the V component to obtain a high-frequency component and a low-frequency component, wherein the adopted formula is as follows:

the invention is further improved in that: the above-mentionedAnd c, performing multi-channel bilateral filtering Retinex processing on the low-frequency component, wherein the weight function of the filter is defined as: w [ (x, y), (x ', y')]=ws[(x,y),(x',y')]×wR[(x,y),(x',y')]。

The invention is further improved in that: and d, sharpening the high-frequency component to highlight the edge information of the image.

The invention is further improved in that: and f, performing piecewise linear processing on the S component.

The processing formula is as follows: s (x ', y') ═ a × lg [1+ S (x, y)](ii) a Wherein a represents a stretch coefficient defined as

The invention is further improved in that: the system comprises an image acquisition module, an image processing module and an image output module, wherein:

the image acquisition module is used for image acquisition work under different environments;

the image processing module is used for carrying out mathematical processing on the acquired image;

and the image output module is used for displaying the processing result.

The invention is further improved in that: the image acquisition module is used for converting the acquired image from the RGB domain to the HSV domain.

The invention is further improved in that: the image processing module is used for processing the S component and the V component.

The invention is further improved in that: the image output module is used for converting the image from the HSV domain to the RGB domain and performing printing display.

Has the advantages that:

firstly, the method comprises the following steps: for the problem that the image details and the color fidelity after the enhancement processing cannot be both complete, the method provides that the operation is carried out in an HSV domain, because HSV can well distinguish hue components from brightness components, and the proportion of the colors of the original image is not changed during the processing.

Secondly, the method comprises the following steps: for the problem of generating a 'halo' phenomenon at a place with sudden depth of field, the method adopts a brand-new bilateral filter to replace a traditional Gaussian filter for filtering, performs wavelet decomposition on an image, and solves the defect that the bilateral filter stores too much high-frequency information. Meanwhile, in order to adapt to the condition that different input images generate different halos, the method adopts a multi-channel combination method for processing so as to achieve a better processing effect.

Thirdly, the method comprises the following steps: for the problems of low operation speed and low efficiency, the method divides the image into different parts, adopts different processing methods for the different parts, greatly improves the processing speed and has better real-time performance.

Drawings

Fig. 1 is a classification of the image enhancement method of the present invention.

Fig. 2 is a schematic diagram of an image enhancement system based on improved Retinex according to the present invention.

Fig. 3 is a block diagram of the present invention.

FIG. 4 is a processing method of multi-channel fusion

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments.

The invention provides a traditional single-scale Retinex (SSR) image enhancement method, which adopts a Gaussian filter to respectively filter three channels of RGB of an image, and finally synthesizes the processed three channels of the image into a new image.

The basic assumption of Retinex theory is based on a reflected illumination model. The image S observed by the observer, corresponding to the product of the incident light L and the object reflectivity R, can be expressed as:

S(x,y)=L(x,y)R(x,y) (1)

the image collected by the imaging device is S (x, y), and the ideal image to be obtained is the image R (x, y) reflected from the object, and the relation between S (x, y) and L (x, y) must be clarified by separating the reflected component R (x, y) from S (x, y), which requires mathematical approximation. The most classical estimation method is to represent the incident light component L (x, y) by the convolution of a gaussian function with the component S (x, y) entering the observer' S eye:

L(x,y)=G(x,y)*S(x,y) (2)

g (x, y) is a defined gaussian function, expressed as:

wherein c represents the filter radius of the Gaussian function, and K is a constant defined by the normalization condition

∫∫G(x,y)dxdy=1 (4)

To determine, c and K can also be expressed as:

where δ is the standard deviation, also called the scale parameter

The logarithm operation is carried out on the left side and the right side of the relational expression to obtain:

Ri(x,y)=lnSi(x,y)-ln[G(x,y)*Si(x,y)] (5)

in the formula, i represents three channels of images R, G and B, and the final image can be synthesized by respectively operating the three channels.

We can observe that only one parameter controlling the gaussian filter is the spatial factor c, when c is small, the details of the processed image are prominent, but the color of the image is unnatural; when c is larger, the color of the processed image is natural, but the details of the image are not enough, and because the Gaussian filter is only weighted average in space during convolution, a halo phenomenon can also be generated at the place where the depth of field is suddenly changed.

In order to improve the defect of the single-scale Retinex method, based on the single-scale Retinex algorithm, a plurality of images with different scales are processed simultaneously, and finally, the final image result is obtained by weighting, so that the limitation brought by the single-scale Retinex model is improved, the method is called as a multi-scale (MSR) Retinex image enhancement method, and the principle definition formula is as follows:

in the above formula, N represents the number of scales; omeganExpressed as a scale weighting coefficient and satisfies

Although the method can relieve the contradiction between the image details and the color fidelity to a certain extent, if the weighting coefficient value is not proper, more serious color distortion can be generated. Meanwhile, the complexity of the algorithm is improved, and the problem of halo phenomenon is not solved.

Scheme of the invention

The invention discloses a novel image enhancement method and a novel image enhancement system, and mainly aims to solve the problems of poor effect, low speed, low efficiency and the like of the traditional Retinex enhancement method. The method can better solve the conflict problem of image details and color fidelity and improve the halo phenomenon.

The device comprises an image acquisition unit, an FEA3519A-C image processing core board based on a Wagness Hi3519AV100 processor, a PC end control unit and an image output module, and the structure of the image acquisition unit is schematically shown in FIG. 2.

The method mainly comprises the following four parts: 1. converting an image to be processed from an RGB domain to an HSV domain; 2. filtering the V domain, replacing a traditional Gaussian filter with a multi-channel bilateral filter for low-frequency components to improve the conflict problem of details and colors and the generated halo phenomenon, and performing smoothing and sharpening processing on high-frequency components to highlight the edge information of the image; 3. performing self-adaptive logarithmic stretching operation on the S domain, changing the saturation of the image and improving the visual effect; 4. and converting the processed HSV image into an RGB image, and finally synthesizing into a new image. The following is an illustration of the present invention:

a first part: converting images to be processed onto HSV fields

When performing operation processing on pixels of an image, the most common method is to decompose the image into an RGB three-channel image, process each channel separately, and synthesize the image into a final result image. Although the method is simple and easy to use, the three channels have strong correlation, and the change of the data of the three channels can cause color scale maladjustment of the finally synthesized image to cause color distortion. The present invention does not use the conventional RGB three-channel domain, but converts the RGB domain to the HSV domain. The HSV model is different from the RGB model and is respectively represented by H, S, V three parameters, H represents the wavelength of the color and is called hue; s represents the vividness of the color, called saturation; v denotes the brightness of the color, called intensity.

The HSV model has the following two characteristics: first, the intensity component V is independent of color. Second, hue H and saturation S are substantially the same as the way human eyes perceive color, substantially reflecting the basic properties of human perception of color. The two characteristics can keep the original color proportion of the processed image, and avoid the phenomenon of color distortion of the image to a great extent.

R, G, B three values are set to real numbers of 0 to 1, max represents the maximum of three, min represents the minimum of three; h ranges from 0 to 360 degrees, S and V are real numbers from 0 to 1, with the following conversions from RGB to HSV:

a second part: wavelet transformation, bilateral filtering and sharpening processing are carried out on the V component

The image halo phenomenon is caused by the self limitation of the Gaussian filter, a new filter is selected to replace the traditional Gaussian filter, the filter meets the space action of the Gaussian filter, and meanwhile, the similarity of the brightness is also considered, and the filter is called as a bilateral filter. However, the bilateral filter stores excessive high-frequency information of the edges in the processing process, and high-frequency noise of the image is not filtered, so that the bilateral filter is only suitable for filtering low-frequency parts. In order to separate the high frequency component and the low frequency component of the image, the invention uses a two-dimensional discrete wavelet transformation method to separate the high frequency and the low frequency of the image to be processed.

1. Two-dimensional wavelet decomposition:

the expression of the two-dimensional discrete wavelet decomposition is:

in the above formula, the first and second carbon atoms are,low frequency coefficients representing the image;three high-frequency coefficients of the image are shown, which are respectively represented as H, V and D; m, N represents the width and height of the image,representing a two-dimensional wavelet scale function;wavelet function representing horizontal, vertical and diagonal directions, separating high-frequency component and low-frequency component of image, and performing bilateral filtering on low-frequency componentAnd smoothing and sharpening the high-frequency component to enable the image to achieve a good processing effect.

2. And (3) filtering the low-frequency component:

the weight function w of the bilateral filter is defined as:

w[(x,y),(x',y')]=ws[(x,y),(x',y')]×wR[(x,y),(x',y')] (11)

in the definitional formula, (x, y) is the pixel currently being processed, Ω is the domain of the pixel (x, y) and (x ', y') is ∈ Ω, ws[(x,y),(x',y')]Is a space factor, wR[(x,y),(x',y')]Is a luminance factor, and the expressions are respectively:

in the above two expressions, δSAnd deltaRRespectively, the spatial parameter and the luminance parameter, V (x, y) represents the gray value of the pixel corresponding to the intensity component V, and similarly, V (x ', y') represents the gray value of the pixel in the neighborhood. It is clear from the expression that the bilateral filter is also a weighted average of the pixels, but the variation of the intensity component is also taken into account in the weighting process.

Its principle can be summarized as follows: two pixels are not only spatially close, but also similar in intensity characteristics.

According to the model of the reflected illumination, the incident component of the image can be represented as a convolution of a bilateral filter function with the image component received by the imaging device:

in the above equation, L (x, y) represents an incident component, the weighting coefficient of the bilateral filter is a product of a spatial factor and an intensity factor, the spatial factor in the filter and the spatial factor in the gaussian filter are concepts, and the spatial factor is gradually decreased as the distance from the center point of the pixel increases; the intensity factor mainly reflects the change of the intensity value among the pixels, the intensity factor is smaller when the difference of the intensity values is larger, and when the difference of the intensity values of the pixels in the neighborhood is small enough, the bilateral filter can be equivalent to a Gaussian filter.

According to the formula of the reflection illumination model, the image reflection component can be obtained as follows:

R(x,y)=lnV(x,y)-lnL(x,y) (15)

the reflection component R (x, y) is a new intensity component V (x, y) processed by the algorithm, the method is continuously improved on the basis of the bilateral filter, and a multi-channel fusion processing method is adopted, which is shown in figure 4, so that the method can adapt to a multivariate application scene;

different parameters are respectively set for three different bilateral filters to achieve the multichannel processing effect, and the parameters are set as follows;

filter 1 is deltaS1And deltaR1(ii) a The filter 2 is 1.3 x δS1And 1.3. deltaR1(ii) a The filter 3 is 1.5 x δS1And 1.5 × δR1

3. Smoothing and sharpening the high-frequency component:

in order to highlight the image contour, the invention firstly adopts a histogram equalization method to increase the image contrast, and then carries out sharpening processing on the image to further highlight the image detail and contour.

The basic idea of the histogram equalization process is to change the histogram from a narrow range of gray scale intervals to a wider range of gray scale intervals, resulting in a more "uniform" distribution. Histogram equalization can also be understood as a method of non-linear stretching of an image, a process of re-assigning pixels. In the process of histogram equalization, the mapping principle is as follows:

in the above equation, n represents the total number of pixels in an image, and L represents the total number of gray levels.

The invention adopts a two-dimensional Laplacian operator to sharpen the image so as to highlight the edge information of the image, and the operator template is as follows:

1 1 1
1 -8 1
1 1 1

and a third part: performing adaptive logarithmic stretching operation on the S component

The core purpose of image enhancement is to enhance the contrast of the image, which is expressed as a tensile strength V. As the strength increases, the saturation tends to decrease, i.e. V is stretched and S decreases, and thus the visual effect decreases. Therefore, in order to maintain or enhance the original vividness of the processed image, we need to stretch the saturation S. Conventional linear stretching can cause the processed image to become very "stiff" due to the different saturation levels of the different regions. Therefore, the present invention selects the stretching coefficient according to the change of the strength V so as to achieve the best stretching effect.

The stretching formula is as follows:

S(x',y')=a×lg[1+S(x,y)] (17)

a is a stretching coefficient, S (x ', y') represents a saturation component after treatment, the magnitude of the coefficient is positively correlated with the stretching degree of the V component, and the method is defined as:

the fourth part: converting processed images from HSV domain to RGB domain

Firstly, reconstructing the processed wavelet coefficient, wherein the reconstructed result is the final V component, and the wavelet reconstruction formula is as follows:

and (3) inversely transforming the H, S, V component subjected to the algorithm processing into a R, G, B component to obtain a finally processed image, wherein the conversion formula is as follows:

in the above-mentioned formula,p=V×(1-S),

the invention has the beneficial effects that:

firstly, the method comprises the following steps: because the complexity of convolution operation far exceeds the complexity of linear transformation and nonlinear change, gaussian filtering is generally performed on three channels of RGB in the current image enhancement, and finally weighting operation is performed to obtain a new RGB image. The method performs multi-channel bilateral filtering processing on the V (brightness) component and performs logarithmic stretch operation on the S (saturation) component, thereby greatly reducing the complexity of the algorithm and remarkably improving the operation speed.

Secondly, the method comprises the following steps: the direct processing of the RGB three channels results in the change of the color proportion of the original image, and the distortion of the image. The invention does not directly process RGB three channels, but converts the image from RGB domain to HSV domain, and processes the intensity V on the basis of ensuring the color proportion of the original image.

Thirdly, the method comprises the following steps: in order to adapt to image input in different scenes, the invention adopts a multi-channel fusion processing method to achieve better processing effect in different scenes.

Fourthly: the invention carries out wavelet decomposition on the V component, carries out bilateral filtering processing on the low-frequency component, and carries out smoothing and sharpening processing on the high-frequency component, thereby further improving the performance of the algorithm.

The above are merely preferred embodiments of the present invention.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:去噪参数调试方法、装置、设备及计算机可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!