CN113793257A - Image processing method and device, electronic equipment and computer readable storage medium - Google Patents

Image processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN113793257A
CN113793257A CN202111084341.8A CN202111084341A CN113793257A CN 113793257 A CN113793257 A CN 113793257A CN 202111084341 A CN202111084341 A CN 202111084341A CN 113793257 A CN113793257 A CN 113793257A
Authority
CN
China
Prior art keywords
noise
image
region
parameter
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111084341.8A
Other languages
Chinese (zh)
Inventor
李章宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202111084341.8A priority Critical patent/CN113793257A/en
Publication of CN113793257A publication Critical patent/CN113793257A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map

Landscapes

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

Abstract

The embodiment of the application relates to the technical field of images, and discloses an image processing method and device, electronic equipment and a computer readable storage medium, wherein the method comprises the following steps: determining a noise estimation area in a foreground area of a first image; determining a first noise parameter corresponding to the noise estimation area, wherein the first noise parameter is used for representing the noise level of the noise estimation area; and superposing noise on the background area of the first blurred image according to the first noise parameter to obtain a second blurred image, wherein the first blurred image is an image obtained by blurring the background area of the first image. By implementing the embodiment of the application, the blurring effect of the image can be improved.

Description

Image processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of image technologies, and in particular, to an image processing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
With the continuous development of the shooting technology of the electronic equipment, after the electronic equipment shoots an image, the electronic equipment can process the shot image through functions such as background blurring and the like so as to meet the simple image processing requirement of a user.
In practice, it is found that a blurred image obtained through the current background blurring algorithm processing lacks blurring texture, and the blurring effect of the image is poor.
Disclosure of Invention
The embodiment of the application discloses an image processing method and device, electronic equipment and a computer readable storage medium, which can improve the blurring effect of an image.
A first aspect of an embodiment of the present application discloses an image processing method, including:
determining a noise estimation area in a foreground area of a first image;
determining a first noise parameter corresponding to the noise estimation area, wherein the first noise parameter is used for representing the noise level of the noise estimation area;
and superposing noise on a background area of a first blurred image according to the first noise parameter to obtain a second blurred image, wherein the first blurred image is an image obtained by blurring the background area of the first image.
A second aspect of the embodiments of the present application discloses an image processing apparatus, including:
a first determining unit configured to determine a noise estimation area in a foreground area of a first image;
a second determining unit, configured to determine a first noise parameter corresponding to the noise estimation region, where the first noise parameter is used to characterize a noise level of the noise estimation region;
and the superposition unit is used for superposing noise on a background area of a first blurred image according to the first noise parameter to obtain a second blurred image, wherein the first blurred image is an image obtained by blurring the background area of the first image.
A third aspect of the embodiments of the present application discloses an electronic device, including:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the image processing method disclosed by the first aspect of the embodiment of the application.
A fourth aspect of the embodiments of the present application discloses a computer-readable storage medium storing a computer program, where the computer program causes a computer to execute the image processing method disclosed in the first aspect of the embodiments of the present application.
A fifth aspect of embodiments of the present application discloses a computer program product, which, when run on a computer, causes the computer to perform part or all of the steps of any one of the methods of the first aspect of embodiments of the present application.
A sixth aspect of the present embodiment discloses an application publishing platform, where the application publishing platform is configured to publish a computer program product, where the computer program product, when running on a computer, causes the computer to perform part or all of the steps of any one of the methods in the first aspect of the present embodiment.
Compared with the related art, the embodiment of the application has the following beneficial effects:
the image processing method provided by the embodiment of the application can determine a noise estimation area in a foreground area of a first image, and determine the noise level of the noise estimation area, namely a first noise parameter; and then, according to the first noise parameter, superimposing noise on a background area of the first blurred image to obtain a second blurred image, wherein the first blurred image is an image obtained by blurring the background area of the first image. By implementing the method disclosed by the embodiment of the application, the noise with the same intensity can be superposed in the background area of the first virtual image corresponding to the first image based on the noise level of the foreground area of the first image, so that the noise of the foreground area and the noise of the background area of the processed second virtual image are consistent, and the virtual effect of the image is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1a is a schematic structural diagram of a shooting system disclosed in an embodiment of the present application;
FIG. 1b is a schematic diagram illustrating a foreground region and a background region according to an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart diagram of an image processing method disclosed in an embodiment of the present application;
FIG. 3 is a schematic flow chart diagram of another image processing method disclosed in the embodiments of the present application;
FIG. 4a is a schematic diagram for explaining a filtering process disclosed in an embodiment of the present application;
FIG. 4b is a schematic diagram of a first normal distribution disclosed in an embodiment of the present application;
FIG. 5 is a schematic diagram of a path of another image processing method disclosed in the embodiments of the present application;
FIG. 6 is a schematic structural diagram of an image processing apparatus disclosed in an embodiment of the present application;
fig. 7 is a schematic structural diagram of another image processing apparatus disclosed in an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first", "second", "third" and "fourth", etc. in the description and claims of the present application are used for distinguishing different objects, and are not used for describing a specific order. The terms "comprises," "comprising," and "having," and any variations thereof, of the embodiments of the present application, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The embodiment of the application discloses an image processing method and device, electronic equipment and a computer readable storage medium, which can improve the blurring effect of an image.
The technical solution of the present application will be described in detail with reference to specific examples.
In order to more clearly illustrate an image processing method and apparatus, an electronic device, and a computer-readable storage medium disclosed in the embodiments of the present application, an application scenario suitable for the image processing method is first introduced. The image processing method can be applied to various electronic devices, including but not limited to: portable electronic devices such as mobile phones and tablet computers, wearable devices such as smart watches and smart glasses, and electronic devices such as desktop computers and televisions.
As shown in fig. 1a, fig. 1a is a schematic structural diagram of a shooting system disclosed in an embodiment of the present application. The electronic device 100 may include a photographing system 200, and the photographing system 200 may include, but is not limited to, an image capturing apparatus 2001, an image processing apparatus 2002, a blurring processing apparatus 2003, a noise superimposing apparatus 2004, and an image storage apparatus 2005. The image capturing device 2001 may include, but is not limited to, a camera, an image sensing wafer, etc. for capturing image information; the Image Processing device 2002 may include, but is not limited to, an Image Signal Processor (ISP), a Coprocessor (CC), and the like, and is configured to perform Image Processing operations such as black level dead pixel correction, lens distortion correction, and scaling on the acquired Image information; the blurring processing device 2003 may be configured to perform blurring processing on the acquired image to obtain a blurred image; the noise superimposing means 2004 may include, but is not limited to, a noise estimation unit 2004a, a noise balancing unit 2004b, and a noise superimposing unit 2004c for superimposing noise on the blurred image; the image storage 2005 includes, but is not limited to, an album, a memory, and the like, for storing processed image information.
In one embodiment, the image capturing device 2001 may capture image information (including RAW image) and send the captured image information to the image processing device 2002 for image processing operations such as black level dead pixel correction, lens distortion correction, and scaling to obtain processed images (including images in YUV format and RGB format), and send the processed images to the blurring processing device 2003 for blurring processing (including but not limited to human blurring processing, depth information generation, image segmentation, background blurring processing, and the like) to obtain blurred images, and store the blurred images to the image storage device 2005.
The foreground area of the image can be clearer due to the virtual image obtained through virtual processing, and the background area presents a gradually-transitional virtual effect, so that the shooting effect of a professional camera can be simulated on electronic equipment such as a mobile phone and a tablet personal computer. However, in the process of background blurring the image, the noise in the background region of the image is smoothed, so that the noise levels of the foreground region and the background region of the generated blurred image are not consistent, and the blurred image lacks blurring texture.
Referring to fig. 1b, fig. 1b is a schematic diagram for explaining a foreground region and a background region disclosed in the embodiment of the present application. The foreground region of the image may refer to a region of the image corresponding to a person or an object in front of or near the leading edge of the subject in the first image, and correspondingly, the other regions of the first image except the foreground region are background regions. In the portrait image of a person shown in fig. 1b, the portrait region of the person is the foreground region 300. Correspondingly, the other regions of the image except the foreground region 300 are background regions 400.
By implementing the image processing method provided by the embodiment of the present application, the noise estimation unit 2004a may determine a noise estimation region in a foreground region of a first image (i.e., an original image acquired by the image acquisition device 2001), and determine a first noise parameter corresponding to the noise estimation region, where the first noise parameter is used to represent a noise level of the noise estimation region; the noise balancing unit 2004b may adjust the first noise parameter to obtain a second noise parameter that can more accurately represent the noise level of the noise evaluation area; further, the noise superimposing unit 2004c may superimpose noise on the background region of the first blurred image according to the second noise parameter to obtain a second blurred image in which the noise level of the background region and the foreground region are consistent, and then store the second blurred image in the image storage device 2005.
Therefore, by the method disclosed by the embodiment of the application, the noise with the same intensity can be superposed in the background area of the first virtual image corresponding to the first image based on the noise level of the foreground area of the first image, so that the noise of the foreground area and the noise of the background area of the processed second virtual image are consistent, and the virtual effect of the image is further improved.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating an image processing method according to an embodiment of the disclosure, where the image processing method can be applied to the electronic device or other execution bodies, and is not limited herein. The image processing method may include the steps of:
202. a noise estimation region is determined in a foreground region of the first image.
In this embodiment, the first image may be an unprocessed RAW image (for example, an image in RAW format) acquired by an image acquisition device (for example, a camera) of the electronic device, or an unprocessed RAW image sent by another electronic device, or an unprocessed RAW image downloaded by the electronic device from the internet, and in other embodiments, the first image may also be an image (for example, an image in YUV format, RGB format, etc.) processed by an image processor (for example, ISP, CC, etc.), which is not limited herein. The foreground region of the first image may refer to a region of the first image corresponding to a person or an object located in front of or near the leading edge of the subject, for example: in the person portrait image, the person portrait is the foreground area. Correspondingly, the other areas except the foreground area in the first image are background areas.
It will be appreciated that when the focus of the camera taking the first image is focused on the foreground region of the image, the foreground region of the first image may also be referred to as the in-focus region, i.e. the planar region on which the focus of the camera taking the first image can be focused. For example, in a portrait image of a person, the focal point of the camera is focused on the portrait of the person, so that the region corresponding to the portrait of the person is the in-focus region. Similarly, the other regions in the first image except the in-focus region are out-of-focus regions. The foreground region and the background region are used for explanation in the embodiments of the present application, and the embodiments of the present application should not be limited.
In the embodiment of the application, in order to facilitate subsequent estimation of the noise level of the foreground region of the first image, the noise evaluation region may be determined from the foreground region of the first image, and then the noise level of the foreground region of the first image may be subsequently represented by the noise level of the noise evaluation region. The noise level refers to the intensity of image noise, and the image noise refers to unnecessary or redundant interference information present in the image data.
Alternatively, the noise evaluation area may be a rectangular area in the foreground area, or a circular area, which is not limited herein. In one embodiment, the electronic device may obtain the in-focus coordinates of the first image and the target size (including length and width information, or radius information, etc.) of the noise evaluation region, and the electronic device may partition the noise evaluation region of the target size in the foreground region of the first image with the in-focus coordinates of the first image as the center. For example, a noise evaluation region having a length of 1cm and a width of 0.5cm is divided in the foreground region of the first image with the focus coordinate of the first image as the center, which is not limited herein.
204. And determining a first noise parameter corresponding to the noise estimation area, wherein the first noise parameter is used for representing the noise level of the noise estimation area.
In the embodiment of the application, the electronic device may characterize the noise level of the noise evaluation region by the first noise parameter. The first noise parameter may include, but is not limited to, a noise standard deviation, a noise variance, and the like, which may reflect a distribution of the image noise in the noise evaluation area.
In an embodiment, the electronic device may cut out a noise estimation region in the first image, and then perform filtering processing (including but not limited to Laplacian (Laplacian) filtering processing and mean filtering processing) on the noise estimation region to obtain a filtering result, so as to determine a noise standard deviation corresponding to the noise estimation region according to the filtering result.
206. And superposing noise on the background area of the first blurred image according to the first noise parameter to obtain a second blurred image, wherein the first blurred image is an image obtained by blurring the background area of the first image.
In this embodiment, the first blurring image may be an image obtained by blurring a background area of the first image. As described above, when the electronic device performs background blurring processing on the first image, the noise in the background region of the image is smoothed, so that the noise levels of the foreground region and the background region of the generated blurred image are not consistent, and the blurred image lacks blurring texture.
Optionally, the electronic device may obtain the first blurred image and depth-of-field information of the first blurred image, and determine a background area of the first blurred image according to the depth-of-field information of the first blurred image; and then the electronic equipment can superpose the noise with the same noise intensity as the foreground region in the background region of the first virtual image according to the first noise parameter, so that the noise level of the background region is consistent with the noise level of the foreground region, and a second virtual image with better virtual texture is obtained.
By implementing the method disclosed in each of the above embodiments, the electronic device may determine a noise estimation region in a foreground region of the first image, and determine a noise level of the noise estimation region, that is, a first noise parameter; and then, according to the first noise parameter, superimposing noise on a background area of the first blurred image to obtain a second blurred image, wherein the first blurred image is an image obtained by blurring the background area of the first image. By implementing the method disclosed by the embodiment of the application, the noise with the same intensity can be superposed in the background area of the first virtual image corresponding to the first image based on the noise level of the foreground area of the first image, so that the noise of the foreground area and the noise of the background area of the processed second virtual image are consistent, and the virtual effect of the image is improved.
Referring to fig. 3, fig. 3 is a schematic flowchart of another image processing method disclosed in the embodiment of the present application, which can be applied to the electronic device or other execution bodies, and is not limited herein. The image processing method may include the steps of:
302. a noise estimation region is determined in a foreground region of the first image.
304. And filtering the noise estimation area to obtain a first filtering result.
In the embodiment of the application, the electronic device may perform filtering processing on the noise evaluation region by using various image filtering methods. Filtering methods include, but are not limited to: laplacian filtering, mean filtering, median filtering, gaussian filtering, and the like, but are not limited thereto.
In an embodiment, the electronic device may obtain the first filter operator and the second filter operator from the buffer, and may also generate the first filter operator and the second filter operator in real time, which is not limited herein. The filter operator is an operator capable of performing filter function processing on the image data, and is used for performing operations including power, square, differential and the like. Optionally, the first filter operator and the second filter operator may include a laplacian operator, where the laplacian operator is a second-order differential operator in the n-dimensional euclidean space, and the electronic device may perform filtering processing on the noise estimation region through the laplacian operator to obtain a filtering result.
Referring to fig. 4a, fig. 4a is a schematic diagram for explaining a filtering process according to an embodiment of the present disclosure. Optionally, the electronic device may calculate a difference between the first filter operator L1 and the second filter operator L2 as a third filter operator N; and then the electronic device can perform convolution calculation on the third filter operator N and the noise estimation region to obtain a first filtering result.
Optionally, the electronic device may perform convolution calculation according to the third filter operator N, the noise estimation region, and the following formula 1 to obtain a first filtering result, that is:
Ilaplacian=Isrc*N
wherein, IlaplacianDenotes the first filtering result, IsrcRepresenting the noise estimation region in the first image and N representing the third filter operator.
Compared with the related technology, the noise estimation region is filtered once through two filtering operators to obtain two filtering results, and then the two filtering results are subjected to difference to obtain a first filtering result. By implementing the method, the electronic device can firstly perform difference on the two filter operators to obtain a third filter operator, and then perform filter processing on the noise evaluation region according to the third filter operator to obtain a first filter result.
306. And determining an edge area in the noise estimation area, and adjusting the first filtering result according to a first proportion of the edge area in the noise evaluation area to obtain a second filtering result.
In practice, it is found that when the electronic device cuts out the noise estimation area from the foreground area of the first image, it is inevitable that the edge area of the noise estimation area includes a background area or a strong edge due to inaccurate cutting or other reasons. Alternatively, the electronic device may determine an edge region in the noise evaluation region, and adjust the first filtering result according to a first ratio of the edge region to the noise evaluation region, so as to reduce an influence of the edge region on the filtering result, thereby obtaining a more accurate second filtering result.
In one embodiment, the electronic device may first perform gaussian blur smoothing on the noise estimation area (optionally, 3 × 3, or 4 × 4, and the like, without limitation), and then determine an edge area in the noise estimation area through an edge detection algorithm (including but not limited to canny edge detection algorithm) according to the first detection threshold and the second detection threshold. Wherein the first detection threshold is greater than the second detection threshold.
Alternatively, the first detection threshold may be determined by an optimal threshold segmentation method, and the second detection threshold may be half of the first detection threshold. The optimal threshold segmentation method is a method for separating an object from a background by setting a threshold to classify pixel levels into a plurality of classes by using a difference in gray level between the object to be extracted and the background in an image. In the embodiment of the present application, the target to be extracted is an edge region of the noise evaluation region, and the background is other regions except the edge region in the noise evaluation region.
By implementing the method, the edge region in the noise evaluation region can be accurately and quickly extracted through the edge detection algorithm, and the implementation mode is simple, so that the implementation difficulty of the image processing method is reduced.
In one embodiment, after determining the edge region in the noise estimation region, the electronic device may determine a first difference according to a first ratio of the edge region to the noise estimation region, where the first difference may be in a positive correlation (including but not limited to a direct correlation) with the first ratio. And then the electronic equipment can reduce the first difference value of the first filtering result to reduce the weight of the edge region in the first filtering result, thereby reducing the influence of the edge region on the first filtering result and further obtaining a more accurate second filtering result.
It can be understood that the larger the first ratio of the edge region to the noise evaluation region is, the larger the influence of the edge region on the first filtering result is, for which the first filtering result may be reduced by a larger first difference value, whereas the smaller the first ratio is, the smaller the first filtering result is reduced by a smaller first difference value, so as to obtain a more accurate second filtering result.
By implementing the method, the first difference value can be determined according to the first proportion of the edge region in the noise evaluation region, and then the first difference value is reduced for the first filtering result, so that the weight of the edge region in the first filtering result is reduced, the influence of the edge region on the first filtering result can be reduced, and a more accurate second filtering result can be obtained.
In another embodiment, after determining an edge region in the noise estimation region, the electronic device may convert a first ratio of the edge region to the noise estimation region into a first integer, where the first integer is a first multiple of the first ratio; wherein the first multiple comprises an integer multiple.
It is understood that the edge area is generally smaller than the noise evaluation area, so the first ratio of the edge area to the noise evaluation area is a non-integer less than 1, such as 0.1, 0.2, etc., and is not limited herein. In this regard, the electronic device may multiply the first ratio by a first multiple to convert the first ratio to a first integer.
For example, assuming that the first ratio is 0.1, the first ratio may be multiplied by 50 or divided by 0.02 to convert 0.1 to an integer 5.
And then the electronic equipment can divide the first filtering result by the first integer to reduce the weight of the edge region in the first filtering result, so that the influence of the edge region on the first filtering result can be reduced, and a more accurate second filtering result can be obtained.
By implementing the method, the electronic device can convert the first proportion of the edge region occupying the noise evaluation region into a first integer, and divide the first filtering result by the first integer to reduce the weight of the edge region in the first filtering result, so that the influence of the edge region on the first filtering result can be reduced, and a more accurate second filtering result can be obtained.
308. And determining a first noise parameter corresponding to the noise estimation area according to the second filtering result, wherein the first noise parameter is used for representing the noise level of the noise estimation area.
In the embodiment of the application, after the more accurate second filtering result is determined, the electronic device may evaluate the noise level of the noise estimation region according to the second filtering result to obtain the first noise parameter.
In one embodiment, the electronic device may determine a first noise parameter corresponding to the noise estimation region according to the second filtering result, the noise estimation region, and the following equation 2, that is:
Figure BDA0003263179520000101
where σ represents a first noise standard deviation (i.e., a first noise parameter), H represents a length of the noise evaluation region, and W represents a width, I'laplacianRepresenting the second filtering result.
By implementing the method, the electronic device may determine, according to the second filtering result, a first noise standard deviation corresponding to the noise evaluation region as the first noise parameter, and since the first noise standard deviation may reflect a distribution condition of noise in the noise evaluation region, the noise level of the noise evaluation region may be represented by the first noise standard deviation.
It can be understood that, if the electronic device clips the noise evaluation region very accurately, and there is no case that the edge region includes a background region or a strong edge in the noise evaluation region, the weight of the edge region in the first filtering result may not be reduced, so as to reduce the influence of the edge region on the first filtering result. Optionally, when it is determined that the noise evaluation region does not have a situation where the edge region includes a background region or a strong edge, the electronic device may determine a first noise parameter corresponding to the noise evaluation region according to the first filtering result, so that the calculation amount of the electronic device may be reduced.
310. And superposing noise on the background area of the first blurred image according to the first noise parameter to obtain a second blurred image, wherein the first blurred image is an image obtained by blurring the background area of the first image.
In an embodiment, the electronic device may respectively generate random noise corresponding to each first pixel point included in the background region of the first blurred image according to the first noise parameter.
The electronic device may randomly generate a random noise for each first pixel point in the background region of the first blurred image. Alternatively, the random noise may include, but is not limited to, gaussian random noise, which is random noise having a gaussian distribution of instantaneous values.
And the electronic device can further generate target noise corresponding to each first pixel point according to the random noise corresponding to each first pixel point and the noise weight corresponding to each first pixel point, and superimpose the corresponding target noise on each first pixel point to obtain a second blurred image with the noise level of the background area consistent with the noise level of the foreground area.
It should be noted that each first pixel corresponds to a default noise weight, and the electronic device uses the default noise weight as the noise weight of the first pixel when the developer sets the default noise weight as the default noise weight without specifying the noise weight of the first pixel. The noise weight refers to the degree of random noise to be superimposed on each first pixel point. It will be appreciated that the greater the noise weight, the greater the proportion of superimposed random noise and vice versa.
Optionally, the electronic device may superimpose noise in the background region of the first blurred image according to the coordinate information of each first pixel point, the random noise corresponding to each first pixel point, the noise weight corresponding to each first pixel point, and the following formula 3, to obtain a second blurred image, that is:
Y′(i,j)=Y(i,j)+noise*weight(i,j)
wherein, Y'(i,j)Representing the first pixel point, Y, after the superposition of noise(i,j)Representing a first pixel point before the superposition of noise, noise representing random noise, weight, corresponding to the first pixel point(i,j)Representing the noise weight of the first pixel point correspondence.
By implementing the method, the electronic device can respectively generate random noise corresponding to each first pixel point included in the background area of the first blurred image according to the first noise parameter, and then superimpose corresponding target noise on each first pixel point according to the noise weight corresponding to each first pixel point, so that the noise superimposed on each first pixel point is more natural, and the blurring effect of the blurred image is improved.
In an embodiment, before the electronic device generates random noise corresponding to each first pixel point included in the background region of the first blurred image according to the first noise parameter, luminance information corresponding to each first pixel point included in the background region of the first blurred image may be acquired, and then, a noise weight corresponding to each first pixel point is determined according to the luminance information corresponding to each first pixel point.
Optionally, if the luminance information corresponding to the first pixel point is greater than the first luminance threshold, that is, the first pixel point is located in a brighter region in the first image, the electronic device may decrease the first weight difference by default at the noise weight corresponding to the first pixel point (the first weight difference may be in a positive correlation with the luminance information corresponding to the first pixel point and the difference of the first luminance threshold) to obtain a second noise weight, and use the second noise weight as the noise weight after the first pixel point is adjusted.
If the luminance information corresponding to the first pixel point is smaller than the second luminance threshold, that is, the first pixel point is located in a darker area of the first image, the electronic device may increase a second weight difference (the second weight difference may be in a positive correlation with the luminance information corresponding to the first pixel point and the difference of the second luminance threshold) to the noise weight corresponding to the first pixel point to obtain a second noise weight, and use the second noise weight as the noise weight after the first pixel point is adjusted, where the second luminance threshold is smaller than the first luminance threshold.
It is understood that, if the luminance information corresponding to the first pixel point is within the first luminance range, the upper limit of the first luminance range is the first luminance threshold, and the lower limit thereof is the second luminance threshold. The electronic device may directly use the default corresponding noise weight of the first pixel point as the adjusted noise weight of the first pixel point.
In another embodiment, the electronic device may determine the noise weight corresponding to each first pixel point according to the luminance information corresponding to each first pixel point and the following formula 4, that is:
Figure BDA0003263179520000131
wherein, weight(i,j)Representing the noise weight, y, of the first pixel point correspondence(i,j)Indicating the luminance information corresponding to the first pixel point.
By implementing the method, the electronic device can generate the noise weight matched with the first pixel point according to the brightness information corresponding to each first pixel point in the background area, so that the subsequent noise superposed on the first pixel point is more natural, and the blurring effect of the blurring image is improved.
In another embodiment, the electronic device may generate corresponding noise weights for the first pixel points included in the background region of the first image according to the formula 4, and then record the noise weights corresponding to the first pixel points and the first pixel points in a table, and store the table in a cache of the electronic device or a cloud server.
Furthermore, the electronic device may obtain, in a table look-up manner, a noise weight corresponding to each first pixel point included in the background area of the first image, so that a calculation amount of the electronic device in an image processing process may be reduced.
In one embodiment, the first noise parameter corresponding to the noise evaluation region may include a first noise standard deviation. Further, the electronic device may generate random noise corresponding to each first pixel point included in the background region of the first blurred image according to the first noise standard deviation, where the generated random noise follows a normal distribution.
Optionally, the electronic device may generate random noise corresponding to each first pixel point included in the background area of the first blurred image according to the first noise standard deviation, the first mean (the first mean is taken as 0 in this embodiment of the present application for illustration, and this embodiment of the present application should not be limited), and the following formula 5, that is:
Figure BDA0003263179520000132
wherein noise represents the corresponding random of the first pixel pointMachine noise, m represents the first mean, σ represents the first noise standard deviation, r1And r2Is a random number in [0,1 ].
By implementing the method, the electronic device can respectively generate the Gaussian random noise which obeys the positive-over distribution for each first pixel point in the background region according to the first noise standard deviation, so that after the subsequent noise superposition is carried out on the background region, not only can the noise level of the background region be consistent with that of the foreground region, but also the processing effect of the background region can be more natural, and the blurring effect of the blurring image can be improved.
In another embodiment, the electronic device may determine a first normal distribution according to a first noise standard deviation corresponding to the noise evaluation region, and determine a first numerical range in the first normal distribution; further, the electronic device may generate random noise corresponding to each first pixel point included in the background region of the first blurred image in the first numerical range, where the random noise obeys distribution.
Referring to fig. 4b, fig. 4b is a schematic diagram of a first normal distribution disclosed in the embodiments of the present application. Optionally, the electronic device determines a first normal distribution according to the first noise standard deviation corresponding to the noise evaluation area (as shown in fig. 4 b), and then the electronic device may determine, in the first normal distribution, a range included in Z first noise standard deviations as a first numerical range, where Z is a positive integer. For example, a range (shaded area in fig. 4 b) included by 2 first noise standard deviations (i.e., -2 σ to 2 σ) may be determined, and since the range corresponding to 2 σ already occupies about 95% of the range included by the first normal distribution, the electronic device may generate pseudo random numbers subject to uniform distribution as random noise of the respective first pixel points for the respective first pixel points included by the background area in the first numerical range.
In other embodiments, the electronic device may determine, as the first numerical range, a range that includes 1, 3, or 5 first noise standard deviations in the first normal distribution, which is not limited herein.
Optionally, the electronic device may generate random noise corresponding to each first pixel point included in the background area of the first blurred image according to the first noise standard deviation corresponding to the noise evaluation area and the following formula 6, that is:
noise′=r-2*σ
wherein noise' represents random noise corresponding to the first pixel point, σ represents a first noise standard deviation corresponding to the noise evaluation region, and r is a random number within [0,4 ×) range.
By implementing the method, uniformly distributed pseudo random numbers can be used as random noise of each first pixel point included in the background area, and the calculation amount of the pseudo random numbers subjected to uniform distribution is smaller, so that the calculation amount of the electronic equipment can be reduced.
In practice, it is found that during the image processing operation on the first image, the first image is often faulted due to insufficient color depth and the like. Alternatively, the electronic device may determine a fault region in the first image, and superimpose noise on the fault region according to the first noise parameter to reduce the fault condition of the fault region. Wherein the fault region is a region in which a fault condition occurs in the first image.
Optionally, the electronic device may determine a fault region to be processed in the first image according to the image mask, and further superimpose noise on the fault region to be processed according to the first noise parameter.
In another embodiment, the electronic device may also superimpose noise on the entire first image according to the first noise parameter, and further eliminate the noise superimposed on other regions of the first image except for the fault region by means of mask fusion.
By implementing the method, the fault condition of the fault area can be weakened by superposing noise on the fault area of the first image.
By implementing the method disclosed in each of the above embodiments, based on the noise level of the foreground region of the first image, the noise with the same intensity can be superimposed in the background region of the first blurred image corresponding to the first image, so that the noise of the foreground region and the noise of the background region of the processed second blurred image are consistent, and the blurring effect of the image is further improved; the two filtering operators can be differenced to obtain a third filtering operator, and then the noise evaluation region is filtered according to the third filtering operator to obtain a first filtering result, namely, the filtering processing can be executed only once through the method, so that the calculation amount of the electronic equipment can be reduced; the first difference value can be determined according to the first proportion of the edge region in the noise evaluation region, and then the first filtering result is reduced by the first difference value so as to reduce the weight of the edge region in the first filtering result, so that the influence of the edge region on the first filtering result can be reduced, and a more accurate second filtering result can be obtained; and converting the first proportion of the edge region occupying the noise evaluation region into a first integer, and dividing the first filtering result by the first integer to reduce the weight of the edge region in the first filtering result, so that the influence of the edge region on the first filtering result can be reduced, and a more accurate second filtering result can be obtained.
Referring to fig. 5, fig. 5 is a schematic diagram of a path of another image processing method disclosed in the embodiment of the present application, and the image processing method may be applied to the electronic device or other execution bodies, which is not limited herein. The image processing method may include the steps of:
502. and determining a noise estimation area in a foreground area of the first image, and determining a first noise parameter corresponding to the noise estimation area, wherein the first noise parameter is used for representing the noise level of the noise estimation area.
504. And acquiring sensitivity information of the first image, and adjusting the first noise parameter according to the sensitivity information to obtain a second noise parameter.
In practice, it is found that the first noise parameter determined by the electronic device may be inaccurate due to the influence of the shooting environment, the performance of the camera device, and other factors. Alternatively, the electronic device may acquire the shooting environment information (including but not limited to brightness, humidity, and the like) and the shooting device performance (including but not limited to sensitivity (i.e., ISO value), focal length, aperture, and the like) of the first image, and adjust the first noise parameter according to the shooting environment information and/or the shooting device performance of the first image to obtain the second noise parameter.
In this case, the sensitivity information is information that measures the sensitivity of the negative film of the first image to light, so the sensitivity information has a large influence on the noise level of the first image. Alternatively, the electronic device may acquire sensitivity information of the first image, and adjust the first noise parameter according to the sensitivity information of the first image and the first sensitivity threshold to obtain the second noise parameter. Wherein the first threshold sensitivity value may generally characterize the sensitivity of the first image at a level between a daytime level (e.g., below 2800) and a nighttime level (e.g., above 3000), such as: 2850. 2900, 3000, etc., the specific numerical values may be set by a developer based on a large number of development experiences, and are not limited thereto.
Optionally, if the sensitivity information of the first image is greater than the first sensitivity threshold, the electronic device may increase the first noise parameter to obtain a second noise parameter; if the sensitivity information of the first image is equal to the first sensitivity threshold, the electronic device may not adjust the first noise parameter, and directly use the first noise parameter as the second noise parameter; if the sensitivity information of the first image is less than the first sensitivity threshold, the electronic device may reduce the first noise parameter to obtain a second noise parameter.
For example, if the first image is shot outdoors in the daytime, the sensitivity information of the first image is usually low, so if the sensitivity information of the first image is smaller than the first sensitivity threshold, the electronic device may reduce the first noise parameter to obtain the second noise parameter. If the first image is shot outdoors at night, the sensitivity information of the first image is generally higher, so that if the sensitivity information of the first image is greater than the first sensitivity threshold, the electronic device may increase the first noise parameter to obtain the second noise parameter. If the first image is shot indoors in the daytime and the sensitivity information of the first image is just equal to the first sensitivity threshold, the electronic device may not adjust the first noise parameter, and directly use the first noise parameter as the second noise parameter.
In another embodiment, the electronic device may obtain sensitivity information of the first image, and determine the second noise parameter according to the sensitivity information of the first image, the first noise parameter, the first sensitivity threshold, and equation 7 below, that is:
Figure BDA0003263179520000171
wherein σThe second noise parameter, σ, iso, and 3000 are shown as first noise parameters, and the first sensitivity threshold (it is understood that the first sensitivity threshold may be other values such as 2800 and 2900, and formula 7 is illustrated with 3000 as an example, and the embodiment of the present application is not limited thereto).
By implementing the method, the electronic equipment can adjust the determined first noise parameter according to the sensitivity information of the first image so as to perform global balance on the first noise parameter of the noise evaluation region, thereby obtaining a second noise parameter which can more accurately reflect the noise level of the noise evaluation region, so that the noise level of the subsequent noise superposed in the background region can be consistent with that of the foreground region, and further the blurring effect of the image is improved.
In practice, it has been found that the first noise parameter determined by the electronic device is actually more accurate when the sensitivity information of the first image is substantially equal to or equal to the first sensitivity threshold. As described above, the electronic apparatus does not adjust the first noise parameter when the sensitivity information of the first image is equal to the first sensitivity threshold. Alternatively, if the sensitivity information of the first image is approximately equal to the first sensitivity threshold, the electronic device may superimpose noise on the background region of the first blurred image according to the first noise parameter to obtain the second blurred image.
In another embodiment, if the electronic device detects that the sensitivity information of the first image is less than a second sensitivity threshold (the second sensitivity threshold is different from the first sensitivity threshold, optionally, the second sensitivity threshold may be greater than the first sensitivity threshold, and specific values may be set by a developer according to a large amount of development data, which is not limited herein), and the first noise parameter of the noise evaluation area is greater than a noise parameter threshold (the noise parameter threshold may be set by the developer according to a large amount of development data, which is not limited herein), the first noise parameter may be adjusted according to the sensitivity information of the first image to obtain the second noise parameter.
By implementing the method, the electronic device may determine that the first noise parameter is relatively inaccurate when it is detected that the sensitivity information of the first image is smaller than the second sensitivity threshold and the first noise parameter of the noise evaluation region is larger than the noise parameter threshold, so the electronic device may adjust the first noise parameter to obtain the second noise parameter that can more accurately reflect the noise level of the noise evaluation region.
506. And superposing noise on the background area of the first blurred image according to the second noise parameter to obtain a second blurred image, wherein the first blurred image is an image obtained by blurring the background area of the first image.
By implementing the method disclosed in each embodiment, based on the noise level of the foreground region of the first image, the noise with the same intensity can be superimposed in the background region of the first blurred image corresponding to the first image, so that the noise of the foreground region and the noise of the background region of the processed second blurred image are consistent, and the blurring effect of the image is improved; in addition, the determined first noise parameter can be adjusted according to the sensitivity information of the first image so as to perform global balance on the first noise parameter of the noise evaluation region, so that a second noise parameter capable of more accurately reflecting the noise level of the noise evaluation region is obtained, the noise level of the noise superposed in the background region subsequently can be consistent with that of the foreground region, and the blurring effect of the image is improved; and determining that the first noise parameter is relatively inaccurate when it is detected that the sensitivity information of the first image is less than the second sensitivity threshold and the first noise parameter of the noise evaluation region is greater than the noise parameter threshold, so that the electronic device can adjust the first noise parameter to obtain the second noise parameter which can more accurately reflect the noise level of the noise evaluation region.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present disclosure. The image processing apparatus may be applied to the electronic device described above, or other execution bodies, and is not limited herein. The image processing apparatus may include: a first determining unit 601, a second determining unit 602, and a superimposing unit 603, wherein:
a first determining unit 601, configured to determine a noise estimation area in a foreground area of a first image;
a second determining unit 602, configured to determine a first noise parameter corresponding to the noise estimation region, where the first noise parameter is used to characterize a noise level of the noise estimation region;
the superimposing unit 603 is configured to superimpose noise on the background region of the first blurred image according to the first noise parameter to obtain a second blurred image, where the first blurred image is an image obtained by blurring the background region of the first image.
By implementing the image processing device, based on the noise level of the foreground region of the first image, the noise with the same intensity can be superposed in the background region of the first blurred image corresponding to the first image, so that the noise of the foreground region and the noise of the background region of the processed second blurred image are consistent, and the blurring effect of the image is improved.
Referring to fig. 7, fig. 7 is a schematic structural diagram of another image processing apparatus disclosed in the embodiment of the present application. The image processing apparatus may be applied to the electronic device described above, or other execution bodies, and is not limited herein. The apparatus shown in fig. 7 may be optimized by the apparatus shown in fig. 6, and the second determining unit 602 in the apparatus shown in fig. 7 is further configured to perform a filtering process on the noise estimation region to obtain a first filtering result; determining an edge region in the noise estimation region, and adjusting a first filtering result according to a first proportion of the edge region in the noise evaluation region to obtain a second filtering result; and determining a first noise parameter corresponding to the noise estimation area according to the second filtering result.
By implementing the image processing device, the first filtering result of the noise evaluation region can be obtained through filtering processing, and then the first difference value can be determined according to the first proportion of the edge region occupying the noise evaluation region, and then the first filtering result is reduced by the first difference value, so that the weight of the edge region in the first filtering result is reduced, the influence of the edge region on the first filtering result can be reduced, and a more accurate second filtering result can be obtained.
As an optional implementation manner, the second determining unit 602 is further configured to calculate a difference between the first filter operator and the second filter operator as a third filter operator; and performing convolution calculation on the third filtering operator and the noise estimation area to obtain a first filtering result.
By implementing the image processing device, the difference between the two filtering operators can be firstly made to obtain the third filtering operator, and then the filtering processing is carried out on the noise evaluation region according to the third filtering operator to obtain the first filtering result.
As an optional implementation manner, the second determining unit 602 is further configured to determine a first difference according to a first ratio of the edge area to the noise evaluation area, where the first difference and the first ratio have a positive correlation; and reducing the first filtering result by the first difference value to obtain a second filtering result.
By implementing the image processing device, the first difference value can be determined according to the first proportion of the edge region in the noise evaluation region, and then the first difference value is reduced for the first filtering result, so that the weight of the edge region in the first filtering result is reduced, the influence of the edge region on the first filtering result can be reduced, and a more accurate second filtering result can be obtained.
As an optional implementation manner, the second determining unit 602 is further configured to convert a first ratio of the edge area to the noise evaluation area into a first integer, where the first integer is a first multiple of the first ratio; and dividing the first filtering result by a first integer to obtain a second filtering result.
By implementing the image processing device, the first proportion of the edge region in the noise evaluation region can be converted into the first integer, and the first filtering result is divided by the first integer, so that the weight of the edge region in the first filtering result is reduced, the influence of the edge region on the first filtering result can be reduced, and a more accurate second filtering result can be obtained.
As an alternative embodiment, the image processing apparatus shown in fig. 7 further includes: an adjusting unit 604, wherein:
an adjusting unit 604, configured to obtain sensitivity information of the first image, and adjust the first noise parameter according to the sensitivity information to obtain a second noise parameter;
and a superimposing unit 603, further configured to superimpose noise in the background region of the first blurred image according to the second noise parameter.
By implementing the image processing device, the determined first noise parameter can be adjusted according to the sensitivity information of the first image, so that the first noise parameter of the noise evaluation area is globally balanced, and the second noise parameter capable of more accurately reflecting the noise level of the noise evaluation area is obtained, so that the noise level of subsequent noise superposed in the background area can be consistent with that of the foreground area, and the blurring effect of the image is further improved.
As an optional implementation manner, the adjusting unit 604 is further configured to increase the first noise parameter to obtain a second noise parameter when the sensitivity information is greater than the first sensitivity threshold; and when the sensitivity information is equal to the first sensitivity threshold, taking the first noise parameter as a second noise parameter; and when the sensitivity information is smaller than the first sensitivity threshold, reducing the first noise parameter to obtain a second noise parameter.
By implementing the image processing device, the determined first noise parameter can be adjusted according to the sensitivity information of the first image, so that the first noise parameter of the noise evaluation area is globally balanced, and the second noise parameter capable of more accurately reflecting the noise level of the noise evaluation area is obtained, so that the noise level of subsequent noise superposed in the background area can be consistent with that of the foreground area, and the blurring effect of the image is further improved.
As an optional implementation manner, the adjusting unit 604 is further configured to adjust the first noise parameter according to the sensitivity information to obtain the second noise parameter when the sensitivity information is smaller than the second sensitivity threshold and the first noise parameter is larger than the noise parameter threshold.
By implementing the image processing apparatus, when it is detected that the sensitivity information of the first image is smaller than the second sensitivity threshold and the first noise parameter of the noise evaluation region is larger than the noise parameter threshold, it can be determined that the first noise parameter is relatively inaccurate, so the electronic device can adjust the first noise parameter to obtain the second noise parameter which can more accurately reflect the noise level of the noise evaluation region.
As an optional implementation manner, the superimposing unit 603 is further configured to generate, according to the first noise parameter, random noise corresponding to each first pixel point included in the background area of the first blurred image; and generating target noise corresponding to each first pixel point according to the random noise corresponding to each first pixel point and the noise weight corresponding to each first pixel point, and superposing the corresponding target noise on each first pixel point to obtain a second virtual image.
By implementing the image processing device, the random noise corresponding to each first pixel point included in the background area of the first blurred image can be respectively generated according to the first noise parameter, and then the corresponding target noise is superimposed on each first pixel point according to the noise weight corresponding to each first pixel point, so that the noise superimposed on each first pixel point is more natural, and the blurring effect of the blurred image is improved.
As an alternative embodiment, the third determining unit 605, wherein:
a third determining unit 605, configured to generate, at the superimposing unit 603, a target noise corresponding to each first pixel point according to the random noise corresponding to each first pixel point and the noise weight corresponding to each first pixel point, and obtain luminance information corresponding to each first pixel point included in the background area of the first blurred image before superimposing the corresponding target noise on each first pixel point to obtain the second blurred image; and determining the noise weight corresponding to each first pixel point according to the brightness information corresponding to each first pixel point.
By implementing the image processing device, the noise weight matched with the first pixel point can be generated according to the brightness information corresponding to each first pixel point in the background area, so that the subsequent noise superposed on the first pixel point is more natural, and the blurring effect of the blurred image is improved.
As an alternative embodiment, the first noise parameter comprises a first noise standard deviation; and the superimposing unit 603 is further configured to generate, according to the first noise standard deviation, random noise corresponding to each first pixel point included in the background area of the first blurred image, respectively, where the random noise obeys normal distribution.
By implementing the image processing device, Gaussian random noises which obey positive-to-positive distribution can be respectively generated for each first pixel point in the background region according to the first noise standard deviation, so that after the subsequent noise superposition is carried out on the background region, not only can the noise level of the background region be consistent with that of the foreground region, but also the processing effect of the background region can be more natural, and the blurring effect of the blurring image can be improved.
As an optional implementation, the superimposing unit 603 is further configured to determine a first normal distribution according to the first noise standard deviation, and determine a first value range in the first normal distribution; and respectively generating random noise corresponding to each first pixel point in the background area of the first blurred image in the first numerical value range, wherein the random noise obeys distribution.
With the above-described image processing apparatus, the uniformly distributed pseudo random numbers can be used as random noise of the respective first pixel points included in the background region, and the amount of calculation of the electronic device can be reduced because the amount of calculation of the uniformly distributed pseudo random numbers is smaller.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 8, the electronic device may include:
a memory 801 in which executable program code is stored;
a processor 802 coupled with the memory 801;
the processor 802 calls the executable program code stored in the memory 801 to execute the image processing method disclosed in each of the above embodiments.
The embodiment of the application discloses a computer readable storage medium, which stores a computer program, wherein the computer program enables a computer to execute the image processing method disclosed by each embodiment.
The embodiment of the present application also discloses an application publishing platform, wherein the application publishing platform is used for publishing a computer program product, and when the computer program product runs on a computer, the computer is caused to execute part or all of the steps of the method in the above method embodiments.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also appreciate that the embodiments described in this specification are all alternative embodiments and that the acts and modules involved are not necessarily required for this application.
In various embodiments of the present application, it should be understood that the size of the serial number of each process described above does not mean that the execution sequence is necessarily sequential, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated units, if implemented as software functional units and sold or used as a stand-alone product, may be stored in a computer accessible memory. Based on such understanding, the technical solution of the present application, which is a part of or contributes to the prior art in essence, or all or part of the technical solution, may be embodied in the form of a software product, stored in a memory, including several requests for causing a computer device (which may be a personal computer, a server, a network device, or the like, and may specifically be a processor in the computer device) to execute part or all of the steps of the above-described method of the embodiments of the present application.
It will be understood by those skilled in the art that all or part of the steps in the methods of the embodiments described above may be implemented by hardware instructions of a program, and the program may be stored in a computer-readable storage medium, where the storage medium includes Read-Only Memory (ROM), Random Access Memory (RAM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), One-time Programmable Read-Only Memory (OTPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory (CD-ROM), or other Memory, such as a magnetic disk, or a combination thereof, A tape memory, or any other medium readable by a computer that can be used to carry or store data.
The image processing method and apparatus, the electronic device, and the computer-readable storage medium disclosed in the embodiments of the present application are described in detail above, and specific examples are applied herein to explain the principles and implementations of the present application, and the descriptions of the above embodiments are only used to help understand the method and the core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (14)

1. An image processing method, characterized in that the method comprises:
determining a noise estimation area in a foreground area of a first image;
determining a first noise parameter corresponding to the noise estimation area, wherein the first noise parameter is used for representing the noise level of the noise estimation area;
and superposing noise on a background area of a first blurred image according to the first noise parameter to obtain a second blurred image, wherein the first blurred image is an image obtained by blurring the background area of the first image.
2. The method of claim 1, wherein the determining the first noise parameter corresponding to the noise estimation region comprises:
filtering the noise estimation area to obtain a first filtering result;
determining an edge region in the noise estimation region, and adjusting the first filtering result according to a first ratio of the edge region to the noise evaluation region to obtain a second filtering result;
and determining a first noise parameter corresponding to the noise estimation area according to the second filtering result.
3. The method of claim 2, wherein the filtering the noise estimation region to obtain a first filtering result comprises:
calculating the difference between the first filter operator and the second filter operator as a third filter operator;
and performing convolution calculation on the third filtering operator and the noise estimation area to obtain a first filtering result.
4. The method according to any one of claims 2 or 3, wherein the adjusting the first filtering result according to the first ratio of the edge region to the noise evaluation region to obtain a second filtering result comprises:
determining a first difference value according to a first proportion of the edge area in the noise evaluation area, wherein the first difference value and the first proportion are in positive correlation;
and reducing the first difference value of the first filtering result to obtain a second filtering result.
5. The method according to any one of claims 2 or 3, wherein the adjusting the first filtering result according to the first ratio of the edge region to the noise evaluation region to obtain a second filtering result comprises:
converting a first proportion of the edge area occupying the noise evaluation area into a first integer, wherein the first integer is an integral multiple of the first proportion;
dividing the first filtering result by the first integer to obtain a second filtering result.
6. The method of claim 1, wherein after the determining the first noise parameter corresponding to the noise estimation region, the method further comprises:
acquiring sensitivity information of the first image, and adjusting the first noise parameter according to the sensitivity information to obtain a second noise parameter;
and the step of superposing noise on the background area of the first blurring image according to the first noise parameter comprises the following steps:
and superposing noise in the background area of the first blurring image according to the second noise parameter.
7. The method according to claim 6, wherein the adjusting the first noise parameter according to the sensitivity information to obtain a second noise parameter comprises:
and if the sensitivity information is smaller than a second sensitivity threshold and the first noise parameter is larger than a noise parameter threshold, adjusting the first noise parameter according to the sensitivity information to obtain a second noise parameter.
8. The method according to any one of claims 6 or 7, wherein the adjusting the first noise parameter according to the sensitivity information to obtain a second noise parameter comprises:
if the sensitivity information is larger than a first sensitivity threshold, increasing the first noise parameter to obtain a second noise parameter;
if the sensitivity information is equal to the first sensitivity threshold, taking the first noise parameter as a second noise parameter;
and if the sensitivity information is smaller than the first sensitivity threshold, reducing the first noise parameter to obtain a second noise parameter, wherein the first sensitivity threshold is smaller than the second sensitivity threshold.
9. The method of claim 1, wherein superimposing noise on a background region of a first blurred image according to the first noise parameter to obtain a second blurred image comprises:
respectively generating random noise corresponding to each first pixel point in the background area of the first blurred image according to the first noise parameters;
and generating target noise corresponding to each first pixel point according to the random noise corresponding to each first pixel point and the noise weight corresponding to each first pixel point, and superposing the corresponding target noise on each first pixel point to obtain a second virtual image.
10. The method according to claim 9, wherein before the generating of the target noise corresponding to each first pixel point according to the random noise corresponding to each first pixel point and the noise weight corresponding to each first pixel point, and superimposing the corresponding target noise on each first pixel point to obtain the second blurred image, the method further comprises:
acquiring brightness information corresponding to each first pixel point included in a background area of the first blurred image;
and determining the noise weight corresponding to each first pixel point according to the brightness information corresponding to each first pixel point.
11. The method of any of claims 9 or 10, wherein the first noise parameter comprises a first noise standard deviation; and generating random noise corresponding to each first pixel point included in the background area of the first blurred image according to the first noise parameter, respectively, including:
respectively generating random noise corresponding to each first pixel point in a background area of the first blurred image according to the first noise standard deviation, wherein the random noise obeys normal distribution;
alternatively, the first and second electrodes may be,
determining a first normal distribution according to the first noise standard deviation, and determining a first numerical range in the first normal distribution; and respectively generating random noise corresponding to each first pixel point included in the background area of the first blurred image in the first numerical value range, wherein the random noise obeys distribution.
12. An image processing apparatus, characterized in that the apparatus comprises:
a first determining unit configured to determine a noise estimation area in a foreground area of a first image;
a second determining unit, configured to determine a first noise parameter corresponding to the noise estimation region, where the first noise parameter is used to characterize a noise level of the noise estimation region;
and the superposition unit is used for superposing noise on a background area of a first blurred image according to the first noise parameter to obtain a second blurred image, wherein the first blurred image is an image obtained by blurring the background area of the first image.
13. An electronic device comprising a memory storing executable program code, and a processor coupled to the memory; wherein the processor calls the executable program code stored in the memory to execute the method according to any one of claims 1 to 11.
14. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 11.
CN202111084341.8A 2021-09-15 2021-09-15 Image processing method and device, electronic equipment and computer readable storage medium Pending CN113793257A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111084341.8A CN113793257A (en) 2021-09-15 2021-09-15 Image processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111084341.8A CN113793257A (en) 2021-09-15 2021-09-15 Image processing method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN113793257A true CN113793257A (en) 2021-12-14

Family

ID=79183628

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111084341.8A Pending CN113793257A (en) 2021-09-15 2021-09-15 Image processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113793257A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114339448A (en) * 2021-12-31 2022-04-12 深圳万兴软件有限公司 Method and device for manufacturing light beam video special effect, computer equipment and storage medium
CN114782257A (en) * 2022-06-22 2022-07-22 深圳市爱深盈通信息技术有限公司 License plate splicing method and device, identification method, equipment terminal and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100104180A1 (en) * 2008-10-28 2010-04-29 Novatek Microelectronics Corp. Image noise reduction method and image processing apparatus using the same
CN101998053A (en) * 2009-08-13 2011-03-30 富士胶片株式会社 Image processing method, image processing apparatus, computer readable medium, and imaging apparatus
CN103843033A (en) * 2011-09-30 2014-06-04 富士胶片株式会社 Image processing apparatus and method, and program
CN104156720A (en) * 2014-07-26 2014-11-19 佳都新太科技股份有限公司 Face image denoising method on basis of noise evaluation model
JP2015046678A (en) * 2013-08-27 2015-03-12 キヤノン株式会社 Image processing device, image processing method and imaging device
CN108989678A (en) * 2018-07-27 2018-12-11 维沃移动通信有限公司 A kind of image processing method, mobile terminal
CN110796615A (en) * 2019-10-18 2020-02-14 浙江大华技术股份有限公司 Image denoising method and device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100104180A1 (en) * 2008-10-28 2010-04-29 Novatek Microelectronics Corp. Image noise reduction method and image processing apparatus using the same
CN101998053A (en) * 2009-08-13 2011-03-30 富士胶片株式会社 Image processing method, image processing apparatus, computer readable medium, and imaging apparatus
CN103843033A (en) * 2011-09-30 2014-06-04 富士胶片株式会社 Image processing apparatus and method, and program
JP2015046678A (en) * 2013-08-27 2015-03-12 キヤノン株式会社 Image processing device, image processing method and imaging device
CN104156720A (en) * 2014-07-26 2014-11-19 佳都新太科技股份有限公司 Face image denoising method on basis of noise evaluation model
CN108989678A (en) * 2018-07-27 2018-12-11 维沃移动通信有限公司 A kind of image processing method, mobile terminal
CN110796615A (en) * 2019-10-18 2020-02-14 浙江大华技术股份有限公司 Image denoising method and device and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114339448A (en) * 2021-12-31 2022-04-12 深圳万兴软件有限公司 Method and device for manufacturing light beam video special effect, computer equipment and storage medium
CN114339448B (en) * 2021-12-31 2024-02-13 深圳万兴软件有限公司 Method and device for manufacturing special effects of beam video, computer equipment and storage medium
CN114782257A (en) * 2022-06-22 2022-07-22 深圳市爱深盈通信息技术有限公司 License plate splicing method and device, identification method, equipment terminal and storage medium

Similar Documents

Publication Publication Date Title
CN110121882B (en) Image processing method and device
CN111402135B (en) Image processing method, device, electronic equipment and computer readable storage medium
US10997696B2 (en) Image processing method, apparatus and device
US10692197B2 (en) Systems and techniques for automatic image haze removal across multiple video frames
KR101699919B1 (en) High dynamic range image creation apparatus of removaling ghost blur by using multi exposure fusion and method of the same
EP3480784B1 (en) Image processing method, and device
CN113992861B (en) Image processing method and image processing device
KR101662846B1 (en) Apparatus and method for generating bokeh in out-of-focus shooting
CN111028190A (en) Image processing method, image processing device, storage medium and electronic equipment
WO2018176925A1 (en) Hdr image generation method and apparatus
CN108234858B (en) Image blurring processing method and device, storage medium and electronic equipment
CN111028170B (en) Image processing method, image processing apparatus, electronic device, and readable storage medium
CN113344821B (en) Image noise reduction method, device, terminal and storage medium
CN113793257A (en) Image processing method and device, electronic equipment and computer readable storage medium
JP2021525029A (en) HDR method and mobile terminal to counter exercise ghost
CN113313626A (en) Image processing method, image processing device, electronic equipment and storage medium
CN107564085B (en) Image warping processing method and device, computing equipment and computer storage medium
CN113674193A (en) Image fusion method, electronic device and storage medium
EP4218228A1 (en) Saliency based capture or image processing
US9466007B2 (en) Method and device for image processing
EP4093015A1 (en) Photographing method and apparatus, storage medium, and electronic device
CN116456191A (en) Image generation method, device, equipment and computer readable storage medium
CN110992284A (en) Image processing method, image processing apparatus, electronic device, and computer-readable storage medium
CN113344822B (en) Image denoising method, device, terminal and storage medium
CN109118427B (en) Image light effect processing method and device, electronic equipment and storage medium

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