Image smoothing method and target contour extraction method
By combining the Laplacian operator, texture removal filtering, and adaptive median filtering, this image smoothing method solves the problems of noise and texture interference in existing technologies, and achieves efficient image smoothing and target contour extraction.
Patent Information
- Application Number
- CN202310874089.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-17
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2043-07-17
AI Technical Summary
Existing image smoothing methods cannot effectively remove noise and texture interference, resulting in poor smoothing effects and affecting the accuracy and robustness of subsequent target contour extraction.
An image smoothing method is adopted, which utilizes the Laplacian operator and texture removal filtering model, combined with adaptive median filtering. By solving the smoothing model and texture removal filtering model, high-quality smoothing results are obtained. The GrabCut algorithm and the improved Canny edge detection operator are combined to extract the target contour.
It significantly improves image smoothing, highlights salient structures, enhances the accuracy and robustness of target contour extraction, and strengthens the guarantee for subsequent applications.
Smart Images

Figure CN116739943B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an image smoothing processing method and a target contour extraction method. Background Technology
[0002] Image processing is now being used across various industries to improve efficiency. However, directly acquired images often contain interference due to equipment or external limitations, directly impacting subsequent work. Consequently, numerous image smoothing methods have been applied to address these issues.
[0003] Classic smoothing methods mostly utilize norm properties or Gaussian filtering to achieve smoothing, but these methods cannot effectively remove noise, texture, and other interferences, resulting in poor smoothing effects. Summary of the Invention
[0004] This invention provides an image smoothing processing method and a target contour extraction method to overcome the deficiencies in the prior art.
[0005] This invention provides an image smoothing processing method, comprising:
[0006] Obtain the image to be smoothed;
[0007] The image to be smoothed is substituted into the smoothing model, and the smoothing model is solved to obtain the first smoothing result corresponding to the image to be smoothed.
[0008] The smoothing model includes a first data fidelity term and a first regularization term. The first data fidelity term is determined based on a first target variable corresponding to the first smoothing result, the image to be smoothed, and the guide image. The first regularization term is the result obtained by applying the Laplacian operator to the first target variable. Norm; the guiding image is obtained by performing texture removal filtering on the image to be smoothed.
[0009] According to an image smoothing method provided by the present invention, the smoothing model is characterized based on the following formula:
[0010] ;
[0011] in, Let be the first target variable. For the image to be smoothed, The guide image, For the first data fidelity item, As a recovery factor, For the first regular expression term, For the Laplace operator, The result obtained by applying the Laplacian operator to the first target variable, As a smoothing factor, Indicates that solving makes smallest , for Norm.
[0012] According to an image smoothing method provided by the present invention, the smoothing model is solved to obtain a first smoothing result corresponding to the image to be smoothed, including:
[0013] Based on the auxiliary variable corresponding to the first regularization term, the smoothing model is updated to obtain the updated smoothing model;
[0014] Fix the first target variable, convert the updated smoothing model into a first sub-model, and solve the first sub-model to obtain the value of the auxiliary variable;
[0015] By fixing the values of the auxiliary variables, the updated smoothing model is converted into a second sub-model, and the second sub-model is solved to obtain the first smoothing result.
[0016] According to an image smoothing method provided by the present invention, the guiding image is obtained based on the following steps:
[0017] The image to be smoothed is substituted into the texture removal filtering model, and the texture removal filtering model is solved to obtain the guiding image;
[0018] The texture removal filtering model includes a second data fidelity term and a second regularization term. The second data fidelity term is determined based on the second target variable corresponding to the guiding image and the image to be smoothed, and the second regularization term is determined based on the gradient obtained by applying a local Gaussian kernel to the second target variable.
[0019] According to an image smoothing method provided by the present invention, the texture removal filtering model is characterized based on the following formula:
[0020] ;
[0021] in, The second target variable, For the second data fidelity item, As the second regularization term, It is a positive parameter. The scale parameter is represented as Local Gaussian kernel, The scale parameter is represented as Local Gaussian kernel, express The gradient in the x-direction, express The gradient in the y-direction. Indicates that solving makes smallest , for Norm, for Norm.
[0022] According to an image smoothing method provided by the present invention, the image to be smoothed is substituted into a smoothing model, comprising:
[0023] An adaptive median filter is applied to the image to be smoothed to obtain an adaptive median filter result, which is then substituted into the smoothing model.
[0024] The present invention also provides a method for extracting target contours, comprising:
[0025] Obtain the image to be processed;
[0026] Based on the above image smoothing method, the image to be processed is smoothed to obtain the second smoothing result corresponding to the image to be processed.
[0027] The second smoothing result is then used for image segmentation to obtain the segmentation result;
[0028] Contour extraction is performed on the segmentation results to obtain the contour information of the target object in the image to be processed.
[0029] According to a target contour extraction method provided by the present invention, contour extraction is performed on the segmentation result to obtain the contour information of the target object in the image to be processed, and then the method includes:
[0030] Based on the contour information, the target object is located.
[0031] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the image smoothing processing method or the target contour extraction method as described above.
[0032] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image smoothing processing method or the target contour extraction method as described above.
[0033] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the image smoothing processing method or the target contour extraction method as described above.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] The image smoothing processing method and target contour extraction method provided by this invention first obtain the image to be smoothed; then, the image to be smoothed is substituted into a smoothing model, and the smoothing model is solved to obtain the first smoothing result corresponding to the image to be smoothed. Benefiting from... The characteristics of the norm and the Laplacian operator, along with the pre-performed texture removal filtering, enable the smoothing model to effectively remove noise and texture interference, making the structure of the smoothed result more prominent and improving the smoothing effect. This provides a guarantee for the subsequent application of the smoothed result and enhances the accuracy and robustness of the subsequent contour extraction and localization process for target objects. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on the drawings described below without creative effort.
[0037] Figure 1 This is a flowchart illustrating the image smoothing processing method provided by the present invention;
[0038] Figure 2 This is a flowchart illustrating the target contour extraction method provided by the present invention;
[0039] Figure 3 This is a schematic diagram of the image smoothing processing device provided by the present invention;
[0040] Figure 4 This is a schematic diagram of the target contour extraction device provided by the present invention;
[0041] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0043] To address the technical problem that existing smoothing methods cannot effectively remove noise and texture interference, resulting in poor smoothing effects, this invention provides an image smoothing processing method, which is then applied to a target contour extraction method to improve the accuracy of target contour extraction.
[0044] Figure 1 This is a flowchart illustrating an image smoothing processing method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes:
[0045] S11, Obtain the image to be smoothed;
[0046] S12, Substitute the image to be smoothed into the smoothing model, and solve the smoothing model to obtain the first smoothing result corresponding to the image to be smoothed;
[0047] The smoothing model includes a first data fidelity term and a first regularization term. The first data fidelity term is determined based on a first target variable corresponding to the first smoothing result, the image to be smoothed, and the guide image. The first regularization term is obtained by applying the Laplacian operator to the first target variable. Norm; the guiding image is obtained by performing texture removal filtering on the image to be smoothed.
[0048] Specifically, the image smoothing processing method provided in this embodiment of the invention can be executed by a computer or an electronic device configured in the computer. The computer can be a local computer or a cloud computer. The local computer can be a computer, tablet, etc., and is not specifically limited here.
[0049] First, execute step S11 to acquire the image to be smoothed. This image, which needs to be smoothed, can be either a color image or a grayscale image. It can be acquired using an industrial camera or a regular camera.
[0050] Then, step S12 is executed, the image to be smoothed is substituted into the smoothing model, and the smoothing model is solved to obtain the first smoothing result corresponding to the image to be smoothed.
[0051] The smoothing model includes a first data fidelity term and a first regularization term. The first data fidelity term is determined based on the first target variable corresponding to the first smoothing result, the image to be smoothed, and the guide image. The first regularization term is obtained by applying the Laplacian operator to the first target variable. Norm; the guiding image is obtained by performing texture removal filtering on the image to be smoothed.
[0052] The smoothing model can be characterized based on the following formula:
[0053] ; (1)
[0054] in, As the first target variable, For the image to be smoothed, To guide the image, As the first data fidelity item, The recovery factor is , and is a constant. As the first regularization term, For the Laplace operator, The result obtained by applying the Laplace operator to the first objective variable, Here, is the smoothing factor, and is a constant. Indicates that solving makes smallest , for Norm.
[0055] It can be represented as:
[0056] ; (2)
[0057] in, For counting operators, , For the Laplace operator in the x-direction, For the Laplace operator in the y-direction, Formula (2) represents the calculation of the first objective variable that makes The number of non-zero pixels, p. The smoothing framework has the ability to preserve major edges and remove unimportant details, making salient structures easier to detect and more visually apparent, while the Laplacian operator can highlight regions in the image where the intensity changes rapidly. This first regularization term combines the advantages of both.
[0058] In this embodiment of the invention, the guiding image can be obtained by performing texture removal filtering on the image to be smoothed. The texture removal filtering operation can be implemented by nearest-neighbor sampling, linear texture filtering, trilinear filtering and anisotropic filtering, etc., and is not specifically limited here.
[0059] Solving formula (1) yields the first smoothing result for the image to be smoothed. Since... Norm calculation is complex, therefore, when solving smoothness models, a method can be introduced... The auxiliary variable corresponding to the norm is used, and an alternating minimization strategy is adopted to solve the auxiliary variable and the first objective variable successively to obtain the final smooth result.
[0060] The image smoothing method provided in this embodiment of the invention first obtains the image to be smoothed; then, it substitutes the image to be smoothed into a smoothing model and solves the smoothing model to obtain the first smoothing result corresponding to the image to be smoothed. Benefiting from... The characteristics of the norm and the Laplacian operator, along with the pre-performed texture removal filtering, enable the smoothing model to effectively remove noise and texture interference, making the structure of the smoothed result more prominent and improving the smoothing effect. This provides a guarantee for the subsequent application of the smoothed result and enhances the accuracy and robustness of the subsequent contour extraction and localization process for target objects.
[0061] Based on the above embodiments, the image smoothing processing method provided in this embodiment of the invention substitutes the image to be smoothed into a smoothing model, including:
[0062] An adaptive median filter is applied to the image to be smoothed to obtain an adaptive median filter result, which is then substituted into the smoothing model.
[0063] Specifically, to filter out noise while preserving the true features of the image to be smoothed as much as possible, an adaptive median filter can be applied to the image before it is fed into the smoothing model, yielding the adaptive median filter result. The introduction of adaptive median filtering can automatically adjust the size of the filter window while filtering out noise, without compromising the true features of the image. During the smoothing process, the size of the filter window can be automatically adjusted according to pre-set conditions, exhibiting good robustness to images containing significant noise.
[0064] Furthermore, substituting the adaptive median filtering result into the smoothing model, formula (1) can be transformed into formula (3):
[0065] (3)
[0066] in, This is the result of adaptive median filtering.
[0067] Based on the above embodiments, the image smoothing processing method provided in this embodiment of the invention can guide the image to be obtained based on the following steps:
[0068] The image to be smoothed is substituted into the texture removal filtering model, and the texture removal filtering model is solved to obtain the guiding image;
[0069] The texture removal filtering model includes a second data fidelity term and a second regularization term. The second data fidelity term is determined based on the second target variable corresponding to the guiding image and the image to be smoothed, and the second regularization term is determined based on the gradient obtained by applying a local Gaussian kernel to the second target variable.
[0070] Specifically, the guide image can be determined using a texture removal filtering model (RoG), which can be characterized by the following formula:
[0071] (4)
[0072] in, The second target variable, For the second data fidelity item, As the second regularization term, It is a positive parameter. The scale parameter is represented as Local Gaussian kernel, The scale parameter is represented as Local Gaussian kernel, express The gradient in the x-direction, express The gradient in the y-direction. Indicates that solving makes smallest , for Norm, for Norm.
[0073] The second data fidelity term minimizes the distance between the resulting guided image G and the image I to be smoothed. For the local Gaussian kernel used for scale selection, For the scale parameter, ( , ( ) represents the coordinates of the center point of the local Gaussian kernel. The texture removal filtering model can effectively remove textures of any scale while preserving other essential content, without distorting edges / structure, and it is highly efficient.
[0074] Based on the above embodiments, the image smoothing processing method provided in this embodiment of the invention solves the smoothing model to obtain a first smoothing result corresponding to the image to be smoothed, including:
[0075] Based on the auxiliary variable corresponding to the first regularization term, the smoothing model is updated to obtain the updated smoothing model;
[0076] Fix the first target variable, convert the updated smoothing model into a first sub-model, and solve the first sub-model to obtain the value of the auxiliary variable;
[0077] By fixing the values of the auxiliary variables, the updated smoothing model is converted into a second sub-model, and the second sub-model is solved to obtain the first smoothing result.
[0078] Specifically, when solving the smoothing model, one can... The method for solving models in Smoothing first introduces... Corresponding auxiliary variables , The component of the auxiliary variable in the x-direction. Let x be the component of the auxiliary variable in the x-direction. Then the smoothing model can be updated as follows:
[0079] (5)
[0080] in, , These are control coefficients used for control. and The similarity between them.
[0081] Subsequently, an alternating minimization strategy is used to optimize the updated smooth model. The alternating solution process is as follows.
[0082] First, fix the first objective variable, convert the updated smoothing model into the first sub-model, and solve the first sub-model to obtain the values of the auxiliary variables.
[0083] The first sub-model can be represented as:
[0084] ; (6)
[0085] By solving formula (6), we can obtain The unique solution is:
[0086] ; (7)
[0087] in, for The components of pixel p, for The components of pixel p, Let be the component of pixel p in the first target variable.
[0088] Then, by fixing the values of the auxiliary variables, the updated smoothing model is converted into a second sub-model, and the second sub-model is solved to obtain the first smoothing result.
[0089] The second sub-model can be represented as:
[0090] (8)
[0091] Since the second sub-model consists entirely of quadratic terms, the Fast Fourier Transform (FFT) can be used instead of matrix calculations to solve equation (8), resulting in a smoothed solution.
[0092] ; (9)
[0093] in, For Fast Fourier Transform, This is the inverse fast Fourier transform.
[0094] like Figure 2 As shown, based on the above embodiments, this embodiment of the invention also provides a target contour extraction method, including:
[0095] S21, Obtain the image to be processed;
[0096] S22, based on the image smoothing processing method provided in the above embodiments, the image to be processed is smoothed to obtain a second smoothing result corresponding to the image to be processed;
[0097] S23, perform image segmentation on the second smoothing result to obtain the segmentation result;
[0098] S24, extract the contour of the segmentation result to obtain the contour information of the target object in the image to be processed.
[0099] Specifically, the target contour extraction method provided in this embodiment of the invention can also be executed by a computer or an electronic device configured in the computer. The computer can be a local computer or a cloud computer. The local computer can be a computer, tablet, etc.
[0100] First, step S21 is executed to acquire the image to be processed. This image may contain target objects for which contour extraction is required. There may be one or more target objects, and their categories may include people, items, equipment, etc., without specific limitations. For example, a target object may be a QR code limited to a corner area, or an industrial assembly line product. The image to be processed can be either a color image or a grayscale image. It can be acquired using an industrial camera or a regular camera.
[0101] When the image to be processed requires image smoothing, step S22 is executed, that is, the image to be processed is smoothed using the image smoothing methods provided in the above embodiments to obtain the second smoothing result corresponding to the image to be processed. Detailed steps are described in the above embodiments and will not be repeated here.
[0102] Next, step S23 is executed to perform image segmentation on the second smoothed result, obtaining the segmentation result. This image segmentation process can be implemented using the GrabCut algorithm, an interactive image segmentation algorithm that only requires specifying a rough bounding box to enclose the target to achieve good segmentation. The specific steps are as follows:
[0103] First, the second smoothing result is mapped to a weighted ST network graph, and then the corresponding energy function is established. The weight of each edge is determined by the data term and smoothing term of the energy function. Finally, the maximum flow / minimum cut algorithm is used to segment the network graph. The minimum cut algorithm divides the second smoothing result into foreground and background nodes, and the energy equation is the sum of the weights of all the cut edges. Minimizing the energy function successfully achieves image segmentation, yielding the segmentation result.
[0104] Here, the energy function can be expressed as:
[0105] ; (10)
[0106] in, For the second smoothing result, The regional data term representing the energy function, This represents the smooth term of the energy function, i.e., the boundary term.
[0107] Subsequently, step S24 is executed. In order to obtain contour information with a single pixel width and high accuracy, the Canny edge detection operator can be used to extract the contour of the segmentation result to obtain the contour information of the target object in the image to be processed.
[0108] The Canny edge detection operator is currently the most theoretically complete edge detection algorithm. Common image processing tools such as Matlab and OpenCV have built-in Canny operator APIs that can be used directly. However, the Canny operator itself also has some drawbacks, which may lead to discontinuous edges, "oversegmentation," or the easy misidentification of noise as boundaries. To address these issues, the OTSU (Otsu binarization, Otsu inter-class variance method) algorithm and morphological methods (dilation, erosion, opening, closing operations, etc.) are used to further highlight contour information.
[0109] The main idea of the OTSU algorithm is to iterate through the data to find a threshold that divides the dataset into two classes. If a certain threshold maximizes the variance between the two classes, then that threshold is the optimal segmentation threshold. Applying the OTSU algorithm to the threshold selection of the traditional Canny edge detection operator achieves adaptive threshold selection. The improved Canny edge detection operator exhibits high edge localization accuracy, strong noise resistance, and adaptability, effectively filtering out some background and strong noise interference, thus improving image continuity.
[0110] The dilation operation is an operation that finds local maxima, and its effect is to gradually increase the highlighted areas in the segmentation result.
[0111] The erosion operation, in contrast to the dilation operation, is an operation that seeks a local minimum, causing the highlighted areas in the segmentation result to gradually decrease.
[0112] Opening operation: Perform N erosions followed by N dilations, which can be used to remove the few remaining small pixels.
[0113] Closing operation: After performing N dilations and then N erosions, the closing operation can connect the interrupted pixels.
[0114] Based on the segmentation results, appropriate opening / closing operations are selected to obtain the final contour information of the target object, so that the effective contour information of the target object can be extracted to the greatest extent.
[0115] The target contour extraction method provided in this embodiment of the invention first acquires the image to be processed; then, it smooths the image to be processed to obtain a second smoothing result corresponding to the image to be processed; subsequently, it performs image segmentation on the second smoothing result to obtain a segmentation result; finally, it extracts the contour information of the target object in the image to be processed by extracting the contour information of the target object from the segmentation result. Because this method uses the image smoothing processing method provided in the above embodiment, it can more objectively and effectively identify and extract the contour information of the target object, significantly preserving the contour structure of the detected target object, while improving background smoothness, making the target object more prominent, and improving the accuracy and robustness of subsequent target object detection and localization.
[0116] Based on the above embodiments, this embodiment of the invention also provides a target contour extraction method, which extracts contours from the segmentation results to obtain contour information of the target object in the image to be processed, and then includes:
[0117] Based on the contour information, the target object is located.
[0118] Specifically, after determining the contour information of the target object in the image to be processed, the contour information can be used to locate the target object.
[0119] Locating a target object involves determining its center point coordinates. This can be done by first fitting the contour information to obtain the smallest possible bounding area, which can be a rectangle or a circle. The center point coordinates of a single target object can be represented as... And there are:
[0120] ,in is the x-coordinate of the center point of the target object, and n is the total number of contour points on the contour. It is the x-coordinate of the i-th contour point on the contour. It is the weighting coefficient of the i-th contour point on the contour, and , It is the distance between the i-th point on the contour and the center point of the fitted outer perimeter;
[0121] ,in is the ordinate of the center point of the target object, and n is the total number of contour points on the contour. It is the ordinate of the i-th contour point on the contour. It is the weighting coefficient of the i-th contour point on the contour, and , It is the distance between the i-th point on the contour and the center point of the fitted periphery.
[0122] like Figure 3 As shown, based on the above embodiments, this embodiment of the invention provides an image smoothing processing apparatus, including:
[0123] The first image acquisition module 31 is used to acquire the image to be smoothed;
[0124] The first smoothing processing module 32 is used to substitute the image to be smoothed into the smoothing model and solve the smoothing model to obtain the first smoothing result corresponding to the image to be smoothed.
[0125] The smoothing model includes a first data fidelity term and a first regularization term. The first data fidelity term is determined based on a first target variable corresponding to the first smoothing result, the image to be smoothed, and the guide image. The first regularization term is the result obtained by applying the Laplacian operator to the first target variable. Norm; the guiding image is obtained by performing texture removal filtering on the image to be smoothed.
[0126] Specifically, the functions of each module in the image smoothing processing device provided in this embodiment of the invention correspond one-to-one with the operation flow of each step in the above-described image smoothing processing method embodiment, and the achieved effect is also the same. For details, please refer to the above embodiments, and this will not be repeated in this embodiment of the invention.
[0127] like Figure 4 As shown, based on the above embodiments, this embodiment of the invention provides a target contour extraction device, including:
[0128] The second image acquisition module 41 is used to acquire the image to be processed;
[0129] The second smoothing module 42 is used to smooth the image to be processed based on the image smoothing processing method provided in the above embodiments, and obtain the second smoothing result corresponding to the image to be processed.
[0130] Image segmentation module 43 is used to segment the second smoothing result to obtain a segmentation result;
[0131] The contour extraction module 44 is used to extract the contours of the segmentation results to obtain the contour information of the target object in the image to be processed.
[0132] Specifically, the functions of each module in the target contour extraction device provided in this embodiment of the invention correspond one-to-one with the operation flow of each step in the above-mentioned target contour extraction method embodiment, and the achieved effect is also the same. For details, please refer to the above embodiments, and this will not be repeated in this embodiment of the invention.
[0133] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communications interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute the image smoothing processing method or the target contour extraction method provided in the above embodiments.
[0134] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0135] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the image smoothing processing method or the target contour extraction method provided in the above embodiments.
[0136] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the image smoothing processing method or target contour extraction method provided in the above embodiments.
[0137] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An image smoothing method characterized by, The method comprises: obtaining a to-be-smoothed image; substituting the to-be-smoothed image into a smoothing model and solving the smoothing model to obtain a first smoothing result corresponding to the to-be-smoothed image; The smoothing model comprises a first data fidelity term and a first regularization term; the first data fidelity term is determined based on a first target variable corresponding to the first smoothing result, the image to be smoothed and a guide image; the first regularization term is a norm of a result obtained by applying a Laplace operator to the first target variable The guide image is obtained by performing texture removal filtering on the image to be smoothed. the texture removal filter comprises one of nearest point sampling, linear texture filtering, trilinear filtering, anisotropic filtering and a texture removal filtering model; the guide image is obtained based on the following steps: substituting the to-be-smoothed image into a texture removal filtering model and solving the texture removal filtering model to obtain the guide image; wherein the texture removal filtering model comprises a second data fidelity term and a second regularization term; the second data fidelity term is determined based on a second target variable corresponding to the guide image and the to-be-smoothed image, and the second regularization term is determined based on a result of applying a local Gaussian kernel to a gradient of the second target variable.
2. The image smoothing processing method according to claim 1, characterized by, the smoothing model is characterized by the following formula: ; in, Let be the first target variable. For the image to be smoothed, The guide image, For the first data fidelity item, As a recovery factor, For the first regular expression term, For the Laplace operator, The result obtained by applying the Laplacian operator to the first target variable, As a smoothing factor, Indicates that solving makes smallest , for Norm.
3. The image smoothing processing method according to claim 1, characterized by, solving the smoothing model to obtain the first smoothing result corresponding to the to-be-smoothed image comprises: updating the smoothing model based on an auxiliary variable corresponding to the first regularization term to obtain an updated smoothing model; fixing the first target variable, converting the updated smoothing model into a first sub-model, and solving the first sub-model to obtain a value of the auxiliary variable; fixing the value of the auxiliary variable, converting the updated smoothing model into a second sub-model, and solving the second sub-model to obtain the first smoothing result.
4. The image smoothing processing method according to claim 1, characterized by, the texture removal filtering model is characterized by the following formula: ; wherein, is the second target variable, is the second data fidelity term, is a second regularizer, is a positive parameter, denotes a local Gaussian kernel with scale parameter denotes a local Gaussian kernel with scale parameter denotes a gradient in the x-direction, denotes a gradient in the y-direction, denotes solving minimizes , , is the l2-norm, is the l1-norm.
5. The image smoothing processing method according to any one of claims 1 to 4, characterized in that, substituting the to-be-smoothed image into a smoothing model comprises: performing adaptive median filtering on the to-be-smoothed image to obtain an adaptive median filtering result, and substituting the adaptive median filtering result into the smoothing model.
6. A method of extracting a target profile, characterized by, The method comprises: obtaining a to-be-processed image; performing smoothing processing on the to-be-processed image based on the image smoothing processing method according to any one of claims 1-5 to obtain a second smoothing result corresponding to the to-be-processed image; performing image segmentation on the second smoothing result to obtain a segmentation result; performing contour extraction on the segmentation result to obtain contour information of a target object in the to-be-processed image.
7. The target profile extraction method according to claim 6, characterized by, performing contour extraction on the segmentation result to obtain contour information of a target object in the to-be-processed image, and then comprising: positioning the target object based on the contour information.
8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the image smoothing processing method according to any one of claims 1-5 or the target contour extraction method according to claim 6 or 7. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the image smoothing processing method according to any one of claims 1-5 or the target contour extraction method according to claim 6 or 7.
Citation Information
Patent Citations
Image smoothing method and image smoothing device
CN106920222A
Relative Gaussian rate image smoothing method based on adaptive kernel estimation
CN114742728A