CN116977227A - Image smoothing method and device based on local structure variation - Google Patents

Image smoothing method and device based on local structure variation Download PDF

Info

Publication number
CN116977227A
CN116977227A CN202311229577.5A CN202311229577A CN116977227A CN 116977227 A CN116977227 A CN 116977227A CN 202311229577 A CN202311229577 A CN 202311229577A CN 116977227 A CN116977227 A CN 116977227A
Authority
CN
China
Prior art keywords
smoothing
image
result
smoothness
smoothed
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.)
Granted
Application number
CN202311229577.5A
Other languages
Chinese (zh)
Other versions
CN116977227B (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.)
Fujian Chengzhe Automation Technology Co ltd
Original Assignee
Fujian Chengzhe Automation Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Chengzhe Automation Technology Co ltd filed Critical Fujian Chengzhe Automation Technology Co ltd
Priority to CN202311229577.5A priority Critical patent/CN116977227B/en
Publication of CN116977227A publication Critical patent/CN116977227A/en
Application granted granted Critical
Publication of CN116977227B publication Critical patent/CN116977227B/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
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/40Analysis of texture
    • G06T7/41Analysis of texture based on statistical description of texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the technical field of image processing, and provides an image smoothing method and device based on local structure variation, wherein the method firstly acquires an image to be smoothed; then inputting the image to be smoothed into a target smoothing model based on local structure variation, and solving the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed; and finally, carrying out weighted fusion on initial smoothing results with different smoothness corresponding to the image to be smoothed, and determining a final smoothing result of the image to be smoothed. According to the target smoothing model, edge protection smoothing can be achieved due to the existence of the structure regularization term and the texture regularization term, the structure and the texture in the image to be smoothed can be distinguished better by combining the introduction of the structure intensity parameter and the texture intensity parameter, and the obtained final smoothing result can reduce the loss of important information to the greatest extent by carrying out weighted fusion on the initial smoothing results with different smoothness obtained by solving the target smoothing model.

Description

Image smoothing method and device based on local structure variation
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image smoothing method and apparatus based on local structure degradation.
Background
With the increasing development of technology, the image processing method is clear and is quasi to become a new standard in the field of image processing. Because of limitations of the device itself and the external environment, various disturbances often exist in the acquired image, affecting the acquisition of information, and thus there is a need to remove the disturbances while preserving the image structure.
In recent years, studies on edge protection smoothness have given a solution to this need, and have been widely used in actual production and life. However, these schemes have a common defect that small-scale details are easy to be regarded as interference filtering, and this defect limits the application of edge-protection smoothing in the fields of high-precision tips such as military, medicine and remote sensing.
Disclosure of Invention
The invention provides an image smoothing method and device based on local structure variation, which are used for solving the defects in the prior art.
The invention provides an image smoothing method based on local structure variation, which comprises the following steps:
acquiring an image to be smoothed;
inputting the image to be smoothed into a target smoothing model based on local structure variation, and solving the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed;
carrying out weighted fusion on initial smoothing results with different smoothness corresponding to the image to be smoothed, and determining a final smoothing result of the image to be smoothed;
the target smoothing model comprises a data fidelity term, a structure regularization term and a texture regularization term, wherein the data fidelity term is determined based on an input image and an output image, and the structure regularization term is based on L of a structure strength parameter 1 Determining a product of a norm and a gradient of the output image, the texture regularization term based on L of a texture intensity parameter 1 Determining a product of a norm and a gradient of the output image;
the structural strength parameter is determined based on gradient values of all pixel points in a block of the output image and pixel point gradient average values in the block, and the texture strength parameter is determined based on Gaussian filtering results of the pixel point gradient average values.
According to the image smoothing method based on local structure variation provided by the invention, the target smoothing model is solved to obtain the initial smoothing results with different smoothness corresponding to the image to be smoothed, and the method comprises the following steps:
l of the structural Strength parameter 1 Norms and L of the texture intensity parameter 1 The norms are respectively subjected to equivalent substitution in an absolute value form, and a first substitution result and a second substitution result are obtained;
decomposing the first substitution result and the second substitution result respectively to obtain a first decomposition result and a second decomposition result, and substituting the first decomposition result and the second decomposition result into the target smoothing model to obtain an alternative smoothing model;
and converting the alternative smoothing model into a matrix form, and solving the alternative smoothing model in the matrix form to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed.
According to the image smoothing method based on local structure variation, the structure regularization term corresponds to a first coefficient, and the texture regularization term corresponds to a second coefficient;
solving the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed, and further comprising:
obtaining an initial smoothing result with a first smoothness and an initial smoothing result with a second smoothness by adjusting the first coefficient and the second coefficient and solving a target smoothing model corresponding to different combinations of the first coefficient and the second coefficient; the first smoothness is less than the second smoothness;
correspondingly, carrying out weighted fusion on initial smoothing results with different smoothness corresponding to the image to be smoothed, and determining a final smoothing result of the image to be smoothed, wherein the method comprises the following steps:
and determining a structural mask based on the initial smoothing result with the first smoothness, and carrying out weighted fusion on the initial smoothing result with the first smoothness and the initial smoothing result with the second smoothness based on the structural mask to obtain the final smoothing result.
According to the image smoothing method based on local structure variation provided by the invention, a structure mask is determined based on an initial smoothing result with the first smoothness, and the method comprises the following steps:
converting an initial smoothing result having the first smoothness into a binary image;
and filling the hole area in the binary image based on morphological operation, identifying isolated noise in the binary image, and eliminating the isolated noise to obtain the structural mask.
According to the image smoothing method based on local structure variation provided by the invention, based on the structure mask, the initial smoothing result with the first smoothness and the initial smoothing result with the second smoothness are subjected to weighted fusion to obtain the final smoothing result, and the method comprises the following steps:
calculating a texture mask based on the structure mask;
and taking the structural mask as the weight of the initial smoothing result with the first smoothness, taking the texture mask as the weight of the initial smoothing result with the second smoothness, and carrying out weighted fusion on the initial smoothing result with the first smoothness and the initial smoothing result with the second smoothness to obtain the final smoothing result.
According to the image smoothing method based on local structural variation, the structural strength parameter is expressed based on the following formula:
the texture intensity parameter is expressed based on the following formula:
wherein ,representing the structural strength parameter,/->Representing the texture intensity parameter,/->Representing the output image,/->Is pixel dot +.>Gradient values at>The expression size is +.>Block of->Indicates the block proportion->Representing the number of pixels in the block, < >>Representative standard deviation is->Is used for the filtering of the filter(s),representing the gradient mean of the pixels within the block.
According to the image smoothing method based on local structure variation, the target smoothing model is expressed based on the following formula:
wherein ,representing the output image,/->Representing the input image,/->Representing said data fidelity item, +.>Representing the structural regularization term, +.>Representing the texture regularization term, +.>Representing the structural strength parameter,/->Representing the texture intensity parameter,/->Representing the gradient of the output image, +.>Representing a first coefficient corresponding to said structural regularization term,>representing a second coefficient corresponding to said texture regularization term,>represents L 1 Norms.
The invention also provides an image smoothing device based on local structure variation, comprising:
the image acquisition module is used for acquiring an image to be smoothed;
the model solving module is used for inputting the image to be smoothed into a target smoothing model based on local structure variation, and solving the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed;
the weighted fusion module is used for carrying out weighted fusion on the initial smoothing results with different smoothness corresponding to the image to be smoothed and determining the final smoothing result of the image to be smoothed;
the target smoothing model comprises a data fidelity term, a structure regularization term and a texture regularization term, wherein the data fidelity term is determined based on an input image and an output image, and the structure regularization term is based on L of a structure strength parameter 1 Determining a product of a norm and a gradient of the output image, the texture regularization term based on L of a texture intensity parameter 1 Determining a product of a norm and a gradient of the output image;
the structural strength parameter is determined based on gradient values of all pixel points in a block of the output image and pixel point gradient average values in the block, and the texture strength parameter is determined based on Gaussian filtering results of the pixel point gradient average values.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the image smoothing method based on local structural degradation as described in any one of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the image smoothing method based on local structure variations as described in any of the above.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the image smoothing method based on local structure variations as described in any of the above.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides an image smoothing method and device based on local structure variation, wherein the method firstly obtains an image to be smoothed; then inputting the image to be smoothed into a target smoothing model based on local structure variation, and solving the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed; and finally, carrying out weighted fusion on the initial smoothing results with different smoothness corresponding to the image to be smoothed, and determining the final smoothing result of the image to be smoothed. According to the target smoothing model, edge-preserving smoothing can be achieved due to the existence of the structure regularization term and the texture regularization term, the structure and the texture in the image to be smoothed can be distinguished better by combining the introduction of the structure intensity parameter and the texture intensity parameter, the initial smoothing results with different smoothness obtained by solving the target smoothing model are subjected to weighted fusion, the loss of important information, especially image details, can be reduced to the greatest extent while interference is removed, the possibility that small-scale details are regarded as interference can be further reduced, the quality of the final smoothing results is improved, and guarantee is provided for the accurate identification of subsequent images.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to these drawings without inventive effort.
FIG. 1 is a flow chart of an image smoothing method based on local structure variation provided by the invention;
fig. 2 is a schematic structural diagram of an image smoothing device based on local structural degradation provided by the present invention;
fig. 3 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 is a flow chart of an image smoothing method based on local structure degradation according to an embodiment of the present invention, as shown in fig. 1, the method includes:
s1, acquiring an image to be smoothed;
s2, inputting the image to be smoothed into a target smoothing model based on local structure variation, and solving the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed;
s3, carrying out weighted fusion on initial smoothing results with different smoothness corresponding to the image to be smoothed, and determining a final smoothing result of the image to be smoothed;
the target smoothing model comprises a data fidelity term, a structure regularization term and a texture regularization term, wherein the data fidelity term is determined based on an input image and an output image, and the structure regularization term is based on L of a structure strength parameter 1 Determining a product of a norm and a gradient of the output image, the texture regularization term based on L of a texture intensity parameter 1 Determining a product of a norm and a gradient of the output image;
the structural strength parameter is determined based on gradient values of all pixel points in a block of the output image and pixel point gradient average values in the block, and the texture strength parameter is determined based on Gaussian filtering results of the pixel point gradient average values.
Specifically, in the image smoothing method based on local structure degradation provided in the embodiment of the present invention, the execution subject is an image smoothing device based on local structure degradation, and the device may be configured in a computer, where the computer may be a local computer or a cloud computer, and the local computer may be a computer, a tablet, or the like, and is not limited herein specifically.
Step S1 is first executed to obtain an image to be smoothed. The image to be smoothed may be an image under uniform light that needs to be smoothed, for example, an image under uniform illumination acquired in various application scenes.
And then, executing step S2, inputting the image to be smoothed into a target smoothing model based on local structure variation, and solving the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed.
The target smoothing model may include a data fidelity term, a structure regularization term, and a texture regularization term, which may be determined based on the input image and the output image, e.g., a square of a difference between the input image and the output image may be used as the data fidelity term. The structural regularization term may be based on L of the structural strength parameter 1 The product of the norm and the gradient of the output image determines that the texture regularization term may be based on L of the texture intensity parameter 1 The product of the norm and the gradient of the output image is determined.
The target smoothing model can be expressed as the following formula (1):
; (1)
wherein ,representing the output image,/->Representing the input image,/->Representing said data fidelity item, +.>Representing the structural regularization term, +.>Representing the texture regularization term, +.>Representing the structural strength parameter,/->Representing the texture intensity parameter,/->Representing the gradient of the output image, +.>Representing a first coefficient corresponding to said structural regularization term,>representing a second coefficient corresponding to said texture regularization term,>represents L 1 Norms.
In the embodiment of the invention, the structural strength parameter can be determined by the gradient value of each pixel point in the block of the output image and the gradient mean value of the pixel points in the block, for example, as shown in the formula (2), and the texture strength parameter can be determined by the Gaussian filtering result of the gradient mean value of the pixel points, for example, as shown in the formula (3).
; (2)
; (3)
wherein ,is pixel dot +.>Ladder at the positionMetric value->The expression size is +.>Is used for the block of the (c),indicates the block proportion->Representing the number of pixels in the block, < >>Representative standard deviation is->Gaussian filtering of>Representing the gradient mean of the pixels within the block.
It will be appreciated that the structural strength parametersCan be seen as a measure of the structure, i.e. for measuring the structural strength of the input image. Structural strength parameter->By the introduction of the method, the target smoothing model can realize accurate discrimination of the structural strength of the image to be smoothed. At the same time, texture intensity parameter->Can be seen as a measure of texture, i.e. for measuring the intensity of the texture of the input image. Texture intensity parameter->By the introduction of the method, the target smoothing model can realize accurate discrimination of the texture intensity of the image to be smoothed.
From a statistical perspective, knotsStructural strength parameterAnd texture intensity parameter->Local variance and local mean are introduced respectively. The local variance can measure the fluctuation degree of the pixel value, the fluctuation of the structural area with edges is smaller, the fluctuation of the texture area with frequent oscillation is larger, and the structural strength parameter is +.>The noise peak is not determined as a structure because of the lower sensitivity of (a). It should be noted that the edges cannot be effectively maintained when the texture amplitude is the same for both the structure and the vicinity. Affected by local mean, texture intensity parameter +.>The appearance on texture is relatively more prominent on structure, and at the edges this property still exists.
Based on this, parameters due to structural strength in the object smoothing modelAnd texture intensity parameter->The structure in the image to be smoothed can be highlighted, the local structure can be kept, and due to the existence of the structure regularization term and the texture regularization term, the difference between the structure and the texture can be increased through the form of local structure degradation so as to better distinguish the structure and the texture.
That is, parameters due to structural strength in the object smoothing modelAnd texture intensity parameter->Is introduced and existence of structural regularization term and texture regularization termThe structure and texture of the image to be smoothed may be distinguished by a form of local structural deterioration.
When solving the target smoothing model, the initial smoothing result with different smoothness can be obtained by setting different parameter combinations of the target smoothing model. Here, the parameters of the target smoothing model may include a first coefficient and a second coefficient, where different values of the first coefficient and the second coefficient may enable the initial smoothing result obtained by the solution to have different smoothness.
In the model solving process, different values of the first coefficient and the second coefficient can be given first, then each block in the image to be smoothed is traversed, and initial smoothing results with different smoothness corresponding to the different values of the first coefficient and the second coefficient are obtained at each block in an iterative solving mode.
Finally, step S3 is executed, where the initial smoothing results with different smoothness obtained by the target smoothing model are weighted and fused, so that a final smoothing result of the image to be smoothed can be determined, for example, the weight of the initial smoothing result with different smoothness can be given first, and the initial smoothing result with different smoothness is weighted by using the corresponding weight, so as to obtain the final smoothing result. Here, since a plurality of initial smoothing results having different smoothness are comprehensively considered, the loss of important information, particularly image details, can be minimized while the interference is removed by the final smoothing result.
The image smoothing method based on local structure variation provided by the embodiment of the invention comprises the steps of firstly obtaining an image to be smoothed; then inputting the image to be smoothed into a target smoothing model based on local structure variation, and solving the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed; and finally, carrying out weighted fusion on the initial smoothing results with different smoothness corresponding to the image to be smoothed, and determining the final smoothing result of the image to be smoothed. According to the target smoothing model, edge protection smoothing can be achieved due to the existence of the structure regularization term and the texture regularization term, the structure and the texture in the image to be smoothed can be distinguished better by combining the introduction of the structure intensity parameter and the texture intensity parameter, the initial smoothing results with different smoothness obtained by solving the target smoothing model are subjected to weighted fusion, the loss of important information, especially image details, can be reduced to the greatest extent while interference is removed from the obtained final smoothing result, the possibility that small-scale texture details are regarded as interference can be further reduced, the quality of the final smoothing result is improved, and guarantee is provided for the accurate identification of the subsequent image.
On the basis of the above embodiment, the image smoothing method based on local structure variation provided in the embodiment of the present invention solves the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed, including:
l of the structural Strength parameter 1 Norms and L of the texture intensity parameter 1 The norms are respectively subjected to equivalent substitution in an absolute value form, and a first substitution result and a second substitution result are obtained;
decomposing the first substitution result and the second substitution result respectively to obtain a first decomposition result and a second decomposition result, and substituting the first decomposition result and the second decomposition result into the target smoothing model to obtain an alternative smoothing model;
and converting the alternative smoothing model into a matrix form, and solving the alternative smoothing model in the matrix form to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed.
In particular, when solving the target smoothing model, due toThe norms are difficult to calculate directly and need to be converted to equivalent form. Here, the equivalent substitution is carried out using the absolute value form, the structural strength parameter +.>There is a conversion process as in equation (4):
; (4)
the texture intensity parameter has a conversion process as shown in formula (5):
; (5)
wherein , and />Ensuring that denominator is not 0 for minimum positive value, +.>Calculated for absolute values.
For the first alternative result, < >>Is the second alternative result.
Observing the first substitution result and the second substitution result, and decomposing the first substitution result and the second substitution result into two parts for facilitating subsequent representation, wherein the first substitution result can be decomposed into a first decomposition result as shown in a formula (6):
; (6)
the second substitution result may be decomposed into a second decomposition result as shown in formula (7):
; (7)
substituting the first decomposition result and the second decomposition result into the target smoothing model, and since the two-dimensional image needs to be calculated by sparse solution subsequently, the two-dimensional image needs to be calculated、/> and />Equally divide into->Horizontal direction and->In the vertical direction, the target smoothing model of the overwriting formula (1) obtains an alternative smoothing model as follows:
; (8)
wherein ,is->Is>Is->Y-direction component of>Is->Is>Is->Y-direction component of>Is->Is>Is->Is defined as the y-direction component of (2).
To facilitate further derivation and calculation, the alternative smoothing model is converted into a matrix form, as shown in equation (9):
; (9)
wherein , and />Toeplitz matrix representing discrete gradient operators in the horizontal x-direction and in the vertical y-direction,、/>、/> and />Diagonal values of (2) are respectively equal to +.>、/>、/> and />Corresponding to the above.
Further, the minimized iterative solution to equation (9) may be performed by taking equation (9) equal to 0 in a linear form as shown in equation (10) below:
; (10)
wherein 1 represents an identity matrix,is->The weight matrix of the secondary iteration is +.>And (5) obtaining a smooth result for the t-th iteration.
Finally, by giving different values of the first coefficient and the second coefficient, initial smoothing results with different smoothness corresponding to the image to be smoothed can be obtained.
In the embodiment of the invention, a process of carrying out iterative solution on the target smooth model is provided, and the rapid and accurate solution on the target smooth model can be realized.
On the basis of the above embodiment, in the image smoothing method based on local structure variation provided in the embodiment of the present invention, the structure regularization term corresponds to a first coefficient, and the texture regularization term corresponds to a second coefficient;
solving the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed, and further comprising:
obtaining an initial smoothing result with a first smoothness and an initial smoothing result with a second smoothness by adjusting the first coefficient and the second coefficient and solving a target smoothing model corresponding to different combinations of the first coefficient and the second coefficient; the first smoothness is less than the second smoothness;
correspondingly, carrying out weighted fusion on initial smoothing results with different smoothness corresponding to the image to be smoothed, and determining a final smoothing result of the image to be smoothed, wherein the method comprises the following steps:
and determining a structural mask based on the initial smoothing result with the first smoothness, and carrying out weighted fusion on the initial smoothing result with the first smoothness and the initial smoothing result with the second smoothness based on the structural mask to obtain the final smoothing result.
Specifically, by applying a first coefficient toAnd a second coefficient->Make an adjustment and solve for a first coefficient +.>And a second coefficient->Target smoothing model of different combinations of (a) to obtain an initial smoothing result +.>And an initial smoothing result with a second smoothness +.>
Wherein the first smoothness is less than the second smoothness, e.g., the first smoothness is a low smoothness and the second smoothness is a high smoothness. The initial smoothing result with the first smoothness may be an initial smoothing result with residual texture regions, intact texture, clear texture edges, and the initial smoothing result with the second smoothness may be an initial smoothing result with clean texture regions, lost texture. The texture area remains intact and the texture area remains clean and the texture is lost, both by manual confirmation, or by parameterization and device confirmation, not specifically limited herein.
Further, in determining the final smoothing result of the image to be smoothed, the structure mask B may be determined first using the initial smoothing result having the first smoothness. The structural mask B can be obtained by performing binarization processing on an initial smoothing result with first smoothness, filling holes and removing isolated noise. Thereafter, in combination with the structural mask B, for an initial smoothing result having a first smoothnessAnd an initial smoothing result with a second smoothness +.>And carrying out weighted fusion to obtain a final smooth result. The final smoothing result comprehensively considers the initial smoothing results with different smoothness, reserves the details of small scale and has the optimal smoothing effect.
Here, the structural mask B may be taken as an initial smoothing result with a first smoothnessWeight of (1) and structure mask B +.>As an initial smoothing result with a second smoothness +.>Weight of (2) for initial smoothing result with first smoothness +.>And an initial smoothing result with a second smoothness +.>And carrying out weighted fusion to obtain a final smooth result S, wherein the final smooth result S is shown in a formula (11):
。 (11)
it can be appreciated that the difference between 1 and the structural mask BIs a texture mask.
In the embodiment of the invention, the final smoothing result S obtained by weighting and fusing can be more accurate by taking the structural mask and the texture mask as the weights of the initial smoothing result with the first smoothness and the initial smoothing result with the second smoothness respectively.
On the basis of the foregoing embodiment, the image smoothing method based on local structure degradation provided in the embodiment of the present invention determines a structure mask based on an initial smoothing result having the first smoothness, including:
converting an initial smoothing result having the first smoothness into a binary image;
and filling the hole area in the binary image based on morphological operation, identifying isolated noise in the binary image, and eliminating the isolated noise to obtain the structural mask.
Specifically, in calculating the structural mask B, the initial smoothing result with the first smoothness may be first obtainedAnd converting into a binary image. Here, this can be achieved by an inter-class variance method (OTSU algorithm). In order to ensure the accuracy of subsequent processing, a texture region can be selected by means of manual interaction such as clicking and the like, and binary image inversion is carried out on part of the images. After binarization, it is desirable that the structure area value is 1 and the texture area value is 0, butThe structural area value is 0 and the texture area value is 1 after the partial image is binarized due to the difference of the pixel values of the image. Therefore, it is necessary to invert the partial image having the texture region value of 0 and the texture region value of 1 to have the texture region value of 1 and the texture region value of 0, so that the influence on the structure mask can be avoided.
Thereafter, holes appear in the structural areas, which are affected by the pixel value size and the balance structure and texture strength, and the texture areas produce residues in the form of isolated noise. The hole area in the binary image can be filled by morphological operation, isolated noise in the binary image is determined by dividing the connected domain and setting a pixel quantity threshold value, and the isolated noise is eliminated to obtain the structural mask B. Here, the connected domain below the threshold in the binary image may be determined as the isolated noise, and the isolated noise may be eliminated by setting the pixel value in the connected domain corresponding to the isolated noise to 0.
In summary, in the embodiment of the present invention, the required information is obtained through the initial smoothing results with different smoothness, so that the loss of important information, especially the image details, is reduced to the maximum extent while the interference is removed. The embodiment of the invention aims to provide a method for processing interference images in batches under uniform light, solves the problem that the current edge-protection smoothing scheme cannot keep image details, can meet the increasing demand of image information, and further expands the application field of edge-protection smoothing.
As shown in fig. 2, on the basis of the above embodiment, an image smoothing device based on local structural degradation is provided in an embodiment of the present invention, including:
an image acquisition module 21 for acquiring an image to be smoothed;
the image smoothing module 22 is configured to input the image to be smoothed into a target smoothing model based on local structure variation, solve the target smoothing model, obtain an initial smoothing result of the image to be smoothed, and determine a final smoothing result of the image to be smoothed based on the initial smoothing result;
wherein the target smoothing model comprisesA data fidelity term, a structure regularization term, and a texture regularization term, the data fidelity term determined based on the input image and the output image, the structure regularization term based on L of the structural strength parameter 1 Determining a product of a norm and a gradient of the output image, the texture regularization term based on L of a texture intensity parameter 1 Determining a product of a norm and a gradient of the output image;
the structural strength parameter is determined based on gradient values of all pixel points in a block of the output image and pixel point gradient average values in the block, and the texture strength parameter is determined based on Gaussian filtering results of the pixel point gradient average values.
On the basis of the above embodiment, the image smoothing module is specifically configured to:
l of the structural Strength parameter 1 Norms and L of the texture intensity parameter 1 The norms are respectively subjected to equivalent substitution in an absolute value form, and a first substitution result and a second substitution result are obtained;
decomposing the first substitution result and the second substitution result respectively to obtain a first decomposition result and a second decomposition result, and substituting the first decomposition result and the second decomposition result into the target smoothing model to obtain an alternative smoothing model;
and converting the alternative smoothing model into a matrix form, and solving the alternative smoothing model in the matrix form to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed.
On the basis of the embodiment, the structure regularization term corresponds to a first coefficient, and the texture regularization term corresponds to a second coefficient;
the image smoothing module is further specifically configured to:
obtaining an initial smoothing result with a first smoothness and an initial smoothing result with a second smoothness by adjusting the first coefficient and the second coefficient and solving a target smoothing model corresponding to different combinations of the first coefficient and the second coefficient; the first smoothness is less than the second smoothness;
and determining a structural mask based on the initial smoothing result with the first smoothness, and carrying out weighted fusion on the initial smoothing result with the first smoothness and the initial smoothing result with the second smoothness based on the structural mask to obtain the final smoothing result.
On the basis of the above embodiment, the image smoothing module is further specifically configured to:
converting an initial smoothing result having the first smoothness into a binary image;
and filling the hole area in the binary image based on morphological operation, identifying isolated noise in the binary image, and eliminating the isolated noise to obtain the structural mask.
On the basis of the above embodiment, the image smoothing module is further specifically configured to:
calculating a texture mask based on the structure mask;
and taking the structural mask as the weight of the initial smoothing result with the first smoothness, taking the texture mask as the weight of the initial smoothing result with the second smoothness, and carrying out weighted fusion on the initial smoothing result with the first smoothness and the initial smoothing result with the second smoothness to obtain the final smoothing result.
On the basis of the above embodiment, the structural strength parameter is expressed based on the formula (2), and the texture strength parameter is expressed based on the formula (3).
On the basis of the above embodiment, the target smoothing model is expressed based on formula (1).
Specifically, the functions of each module in the image smoothing device based on local structure variation provided in the embodiment of the present invention are in one-to-one correspondence with the operation flows of each step in the above method embodiment, and the achieved effects are consistent.
Fig. 3 illustrates a physical schematic diagram of an electronic device, as shown in fig. 3, where the electronic device may include: processor (Processor) 310, communication interface (Communications Interface) 320, memory (Memory) 330 and communication bus 340, wherein Processor 310, communication interface 320, memory 330 accomplish communication with each other through communication bus 340. The processor 310 may invoke logic instructions in the memory 330 to perform the image smoothing method based on local structure degradation provided in the embodiments described above.
Further, the logic instructions in the memory 330 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, which includes a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and when the computer program is executed by a processor, the computer can execute the image smoothing method based on local structure degradation provided by the above methods.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the image smoothing method based on local structure degradation provided by the methods described above.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. An image smoothing method based on local structural degradation, comprising:
acquiring an image to be smoothed;
inputting the image to be smoothed into a target smoothing model based on local structure variation, and solving the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed;
carrying out weighted fusion on initial smoothing results with different smoothness corresponding to the image to be smoothed, and determining a final smoothing result of the image to be smoothed;
the target smoothing model comprises a data fidelity term, a structure regularization term and a texture regularization term, wherein the data fidelity term is determined based on an input image and an output image, and the structure regularization term is based on L of a structure strength parameter 1 Determining a product of a norm and a gradient of the output image, the texture regularization term based on L of a texture intensity parameter 1 Determining a product of a norm and a gradient of the output image;
the structural strength parameter is determined based on gradient values of all pixel points in a block of the output image and pixel point gradient average values in the block, and the texture strength parameter is determined based on Gaussian filtering results of the pixel point gradient average values.
2. The image smoothing method based on local structure variation as claimed in claim 1, wherein solving the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed comprises:
l of the structural Strength parameter 1 Norms and L of the texture intensity parameter 1 The norms are respectively subjected to equivalent substitution in an absolute value form, and a first substitution result and a second substitution result are obtained;
decomposing the first substitution result and the second substitution result respectively to obtain a first decomposition result and a second decomposition result, and substituting the first decomposition result and the second decomposition result into the target smoothing model to obtain an alternative smoothing model;
and converting the alternative smoothing model into a matrix form, and solving the alternative smoothing model in the matrix form to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed.
3. The image smoothing method based on local structure variation according to claim 1, wherein the structure regularization term corresponds to a first coefficient, and the texture regularization term corresponds to a second coefficient;
solving the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed, and further comprising:
obtaining an initial smoothing result with a first smoothness and an initial smoothing result with a second smoothness by adjusting the first coefficient and the second coefficient and solving a target smoothing model corresponding to different combinations of the first coefficient and the second coefficient; the first smoothness is less than the second smoothness;
correspondingly, carrying out weighted fusion on initial smoothing results with different smoothness corresponding to the image to be smoothed, and determining a final smoothing result of the image to be smoothed, wherein the method comprises the following steps:
and determining a structural mask based on the initial smoothing result with the first smoothness, and carrying out weighted fusion on the initial smoothing result with the first smoothness and the initial smoothing result with the second smoothness based on the structural mask to obtain the final smoothing result.
4. The image smoothing method based on local structure variations as claimed in claim 3, wherein determining a structure mask based on an initial smoothing result having the first smoothness comprises:
converting an initial smoothing result having the first smoothness into a binary image;
and filling the hole area in the binary image based on morphological operation, identifying isolated noise in the binary image, and eliminating the isolated noise to obtain the structural mask.
5. The image smoothing method based on local structure deterioration according to claim 3, wherein weighting and fusing an initial smoothing result having the first smoothness and an initial smoothing result having the second smoothness based on the structure mask to obtain the final smoothing result, comprises:
calculating a texture mask based on the structure mask;
and taking the structural mask as the weight of the initial smoothing result with the first smoothness, taking the texture mask as the weight of the initial smoothing result with the second smoothness, and carrying out weighted fusion on the initial smoothing result with the first smoothness and the initial smoothing result with the second smoothness to obtain the final smoothing result.
6. The image smoothing method based on local structural degradation of any one of claims 1-5, wherein the structural strength parameter is expressed based on the following formula:
the texture intensity parameter is expressed based on the following formula:
wherein ,representing the structural strength parameter,/->Representing the texture intensity parameter,/->The image of the output is represented by a representation,is pixel dot +.>Gradient values at>The expression size is +.>Block of->Indicates the block proportion->Representing the number of pixels in the block, < >>Representative standard deviation is->Is used for the filtering of the filter(s),representing the gradient mean of the pixels within the block.
7. The image smoothing method based on local structure degradation according to any one of claims 1 to 5, wherein the target smoothing model is expressed based on the following formula:
wherein ,representing the output image,/->Representing the input image,/->Representing the data-fidelity term in question,representing the structural regularization term, +.>Representing the texture regularization term, +.>Representing the structural strength parameter,/->Representing the texture intensity parameter,/->Representing the gradient of the output image, +.>Representing a first coefficient corresponding to said structural regularization term,>representing a second coefficient corresponding to said texture regularization term,>represents L 1 Norms.
8. An image smoothing apparatus based on local structural deterioration, comprising:
the image acquisition module is used for acquiring an image to be smoothed;
the model solving module is used for inputting the image to be smoothed into a target smoothing model based on local structure variation, and solving the target smoothing model to obtain initial smoothing results with different smoothness corresponding to the image to be smoothed;
the weighted fusion module is used for carrying out weighted fusion on the initial smoothing results with different smoothness corresponding to the image to be smoothed and determining the final smoothing result of the image to be smoothed;
the target smoothing model comprises a data fidelity term, a structure regularization term and a texture regularization term, wherein the data fidelity term is determined based on an input image and an output image, and the structure regularization term is based on L of a structure strength parameter 1 Determining a product of a norm and a gradient of the output image, the texture regularization term based on L of a texture intensity parameter 1 Determining a product of a norm and a gradient of the output image;
the structural strength parameter is determined based on gradient values of all pixel points in a block of the output image and pixel point gradient average values in the block, and the texture strength parameter is determined based on Gaussian filtering results of the pixel point gradient average values.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the local structure degradation based image smoothing method of any one of claims 1-7 when the program is executed.
10. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the local structure variation-based image smoothing method according to any one of claims 1-7.
CN202311229577.5A 2023-09-22 2023-09-22 Image smoothing method and device based on local structure variation Active CN116977227B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311229577.5A CN116977227B (en) 2023-09-22 2023-09-22 Image smoothing method and device based on local structure variation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311229577.5A CN116977227B (en) 2023-09-22 2023-09-22 Image smoothing method and device based on local structure variation

Publications (2)

Publication Number Publication Date
CN116977227A true CN116977227A (en) 2023-10-31
CN116977227B CN116977227B (en) 2023-12-15

Family

ID=88471637

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311229577.5A Active CN116977227B (en) 2023-09-22 2023-09-22 Image smoothing method and device based on local structure variation

Country Status (1)

Country Link
CN (1) CN116977227B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106920222A (en) * 2017-03-13 2017-07-04 苏州大学 A kind of image smoothing method and device
US20190333237A1 (en) * 2016-07-19 2019-10-31 Fotonation Limited Systems and methods for providing depth map information
CN111223049A (en) * 2020-01-07 2020-06-02 武汉大学 Remote sensing image variation fusion method based on structure-texture decomposition
CN113870149A (en) * 2021-10-21 2021-12-31 重庆邮电大学 Non-local total variation image restoration method based on smooth structure tensor self-adaption
CN116739943A (en) * 2023-07-17 2023-09-12 中国科学院福建物质结构研究所 Image smoothing method and target contour extraction method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190333237A1 (en) * 2016-07-19 2019-10-31 Fotonation Limited Systems and methods for providing depth map information
CN106920222A (en) * 2017-03-13 2017-07-04 苏州大学 A kind of image smoothing method and device
CN111223049A (en) * 2020-01-07 2020-06-02 武汉大学 Remote sensing image variation fusion method based on structure-texture decomposition
CN113870149A (en) * 2021-10-21 2021-12-31 重庆邮电大学 Non-local total variation image restoration method based on smooth structure tensor self-adaption
CN116739943A (en) * 2023-07-17 2023-09-12 中国科学院福建物质结构研究所 Image smoothing method and target contour extraction method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李孟航: "基于L_0测度优化的图像平滑和去模糊应用研究", 优秀硕士毕业论文 *

Also Published As

Publication number Publication date
CN116977227B (en) 2023-12-15

Similar Documents

Publication Publication Date Title
Hosotani et al. Image denoising with edge-preserving and segmentation based on mask NHA
CN110956615B (en) Image quality evaluation model training method and device, electronic equipment and storage medium
CN109271707B (en) Simulation energy spectrum curve simulation method for simulating nuclear energy spectrum line
CN110348425B (en) Method, device and equipment for removing shading and computer readable storage medium
Zhang et al. Multi-focus image fusion with alternating guided filtering
CN108460783A (en) A kind of cerebral magnetic resonance image organizational dividing method
CN114862861B (en) Lung lobe segmentation method and device based on few-sample learning
CN114972339A (en) Data enhancement system for bulldozer structural member production abnormity detection
De los Reyes et al. Bilevel optimization methods in imaging
CN115170548A (en) Leather defect automatic detection method and device based on unsupervised learning
CN117408905B (en) Medical image fusion method based on multi-modal feature extraction
CN111402173A (en) Hybrid noise removing method and device, electronic equipment and storage medium
CN117934348A (en) Metal artifact removing method and device based on generation of countermeasure network
CN116977227B (en) Image smoothing method and device based on local structure variation
CN106023097A (en) Iterative-method-based flow field image preprocessing algorithm
CN113470058A (en) Gravel particle size distribution measuring method and device
El Hassani et al. Efficient image denoising method based on mathematical morphology reconstruction and the Non-Local Means filter for the MRI of the head
Wei et al. Image denoising based on improved gaussian mixture model
CN111803060B (en) Electrocardio artifact signal removing method and device
CN116052234A (en) Image quality evaluation method, device, electronic equipment and computer program product
CN116993629B (en) Smoothing method and device based on image decomposition, electronic equipment and storage medium
CN115037641B (en) Network traffic detection method and device based on small sample, electronic equipment and medium
Mu et al. A method of radiographic image quality enhancement
CN118735812A (en) Texture perception smoothing method and device based on local extremely poor
Reyes et al. Bilevel Optimization Methods in Imaging

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