Image blur generation device and method based on confusion circle prediction
Through the image blur generation method based on obfuscated circle prediction, the image reading conversion, feature extraction and fuzzy template generation modules are used to generate multiple sets of filtered core simulation blur effects, solving the problem of poor image blur effect on smartphones, and achieving efficient and realistic blur generation.
Patent Information
- Application Number
- CN202211251907.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-13
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-10-13
AI Technical Summary
The existing deep learning networks have poor image blurring on smartphones, making it difficult to effectively distinguish between focused and non-focused areas, and the calculation is complex and time-consuming, making it impossible to efficiently achieve image blurring.
The image blur generation method based on obfuscated circle prediction is adopted, and through image reading conversion, feature extraction, fuzzy template generation and weighted fusion modules, multiple sets of filtered core simulation virtualization effects are generated, reducing the difficulty of network learning and improving operational efficiency.
It realizes efficiently generating realistic image blur effect on smartphones, reducing computing complexity and resource requirements, and improving operation speed.
Smart Images

Figure CN115423902B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to an image blur generation device and method based on confusion circle prediction. Background Art
[0002] In recent years, with the continued attention and progress of many mobile phone manufacturers in the field of camera, the classic task of image blurring has been widely studied. How to achieve fast and efficient image blurring on smartphones has also become a key research target in academia.
[0003] The mainstream approach in existing technologies is to conduct deep learning by constructing datasets of paired fully focused and blurred images. These deep learning networks often require additional depth maps for assistance, or rely on the network to directly learn the mapping relationships required for the complex blurring task end-to-end. However, inexpensive smartphones lack multiple lenses to acquire depth information. Even for more expensive smartphones, estimating depth using multiple lenses is complex and time-consuming. Therefore, depth map-assisted blurred image generation is not very effective for mobile camera tasks.
[0004] Furthermore, blurring requires the network to not only distinguish between focused and unfocused areas, but also to maintain the pixels in the focused area while calculating the circle of confusion based on optical and distance information such as camera parameters and object distance, thereby blurring the unfocused areas. This requires the network to possess not only high-level semantic segmentation capabilities to separate focused and unfocused areas, but also the ability to process the underlying details of blurring the unfocused areas. Simply expecting a deep learning network to master this complex task end-to-end is difficult. Summary of the Invention
[0005] The inventors discovered from the physical principles of creating image blurring using the properties of the circle of confusion in optical laws that the pattern and effect of the circle of confusion itself resemble the characteristics of filter kernels and filtering operations. Therefore, after using a deep network to learn the features of the input image, multiple sets of filter kernels are generated to simulate blur templates with varying degrees of blur. These templates are then combined to simulate the blurring effect. This facilitates learning the blurring effect based on the dataset, reduces the network's learning difficulty for the blurring task, and results in a more realistic blurring effect. To this end, the present invention aims to provide a device and method for generating image blurring based on circle of confusion prediction, which offers improved blurring effects and is more efficient and feasible.
[0006] In order to achieve the above object, the present invention adopts the following scheme:
[0007] <Option 1>
[0008] The present invention provides an image blur generation device based on confusion circle prediction, which has the following characteristics: an image reading and conversion module, used to read the RGB image of the original all-focus image, perform downsampling processing on the RGB image to obtain an input image that meets the network input resolution requirement, and perform format conversion processing on the input image to obtain an image in a preset format as a to-be-processed image; an image feature extraction module, used to perform feature extraction processing on the to-be-processed image through a neural network to obtain m image features of different resolution sizes; a fuzzy template generation module, used to perform convolution operation on the image features to generate a filter kernel group including filter kernels with preset side lengths and a number equal to the number of pixels of the image features, based on the image feature extraction module. According to each filter kernel group, the processed image is filtered separately to obtain m blur templates of the same resolution as the down-sampled blur templates, and each down-sampled blur template is up-sampled to obtain m blur templates of the same size as the original fully focused image as the up-sampled blur templates; a fusion weight generation module is used to generate a fusion weight map that fuses all the up-sampled blur templates and has the same resolution as the up-sampled blur template according to all image features and the corresponding up-sampled blur templates; and a template weighted fusion module is used to perform weighted fusion processing on the original fully focused image, all the up-sampled blur templates and the fusion weight map to obtain the final output blurred image, where m is a positive integer not less than 2.
[0009] In the image blur generation device based on confusion circle prediction provided by the present invention, it can also have the following characteristics: wherein, the image feature extraction module includes m basic module units of different depths, as well as a feature retention unit, an image magnification unit and an information jump transmission unit, the m basic module units are used to extract features of the image to be processed from different depths as initial image features, and retain the information of each pixel in the image to be processed, the feature retention unit is used to condense each initial image feature to obtain a condensed image feature that retains the main features, the image magnification unit is used to amplify each condensed image feature to obtain m image features, and the information jump transmission unit is used to connect basic module units of different depths, and directly transmit the information collected by the shallow basic module units in the encoder to the corresponding deep basic module units in the decoder with the same resolution to supplement the information missing of the initial image features during the condensation process.
[0010] In the image blur generation device based on confusion circle prediction provided by the present invention, it can also have the following characteristics: wherein, the basic module unit contains multiple groups of processing layers, each group of processing layers is composed of a convolution layer, an instance normalization layer and a linear rectification layer, the convolution layer is used to extract image features from different angles using a convolution kernel, the instance normalization layer is used to perform instance normalization processing on the features extracted by the convolution layer to obtain instance normalized features, and the linear rectification layer is used as an activation function to filter unnecessary information in the instance normalized features to obtain initial image features.
[0011] In the image blur generation device based on confusion circle prediction provided by the present invention, it can also have the following characteristics: wherein, the fusion weight generation module includes a feature processing acquisition unit, an information filtering unit and a weight limitation unit, the feature processing acquisition unit is used to perform convolution processing on the image features, the information filtering unit is used to filter unnecessary information in the image features after convolution processing, and the weight limitation unit is used to generate a fusion weight map with each value in the range of [-1, 1] according to the filtered image features and the corresponding up-sampled blur template.
[0012] The image blur generation device based on confusion circle prediction provided by the present invention may also have the following feature: wherein the template weighted fusion module first performs Hadamard product on all upsampled blur templates and fusion weight maps and adds them, and then adds the original fully focused image to obtain a blurred image.
[0013] The image blur generation device based on confusion circle prediction provided by the present invention may also have the following feature: the format of the original all-focus image is PNG format, JPEG format or BMP format, and the preset format is Tensor format.
[0014] The image blur generation device based on confusion circle prediction provided by the present invention may also have the following feature: wherein the preset side length is 1-15.
[0015] <Option 2>
[0016] The present invention also provides a method for generating image blur based on confusion circle prediction, which is characterized by comprising the following steps:
[0017] Step S1, reading the RGB image of the original all-focus image, downsampling the RGB image to obtain an input image that meets the network input resolution requirement, and format converting the input image to obtain an image in a preset format as the image to be processed;
[0018] Step S2, performing feature extraction on the image to be processed through a neural network to obtain m image features of different resolutions;
[0019] Step S3: performing a convolution operation on the image feature to generate a filter kernel group including filter kernels having a preset side length and a number equal to the number of pixels of the image feature; performing filtering processing on the image to be processed according to each filter kernel group to obtain m blur templates of the same resolution as the down-sampled blur templates; and performing up-sampling processing on each down-sampled blur template to obtain m blur templates of the same size as the original all-focus image as the up-sampled blur templates;
[0020] Step S4, generating a fusion weight map that fuses all the upsampled fuzzy templates and has the same resolution as the upsampled fuzzy templates based on all the image features and the corresponding upsampled fuzzy templates;
[0021] Step S5: Perform weighted fusion processing on the original all-focus image, all upsampled blur templates, and the fusion weight map to obtain the final output blurred image.
[0022] m are positive integers not less than 2.
[0023] The image blur generation method based on confusion circle prediction provided by the present invention may also have the following features: wherein, step S5 specifically comprises: first performing Hadamard product on all upsampled blur templates and corresponding fusion weight maps and adding them, and then adding the original fully focused image to obtain a blurred image.
[0024] The image blur generation method based on confusion circle prediction provided by the present invention may also have the following features: wherein the format of the original all-focus image is PNG format, JPEG format or BMP format, and the preset format is Tensor format.
[0025] Functions and effects of the invention
[0026] According to the image blur generation device and method based on confusion circle prediction involved in the present invention, since the image reading and conversion module reads the RGB image of the original all-focus image, downsamples the RGB image to obtain an input image that meets the network input resolution requirement, and performs format conversion on the input image to obtain an image in a preset format as the image to be processed, the image feature extraction module performs feature extraction on the processed image through a neural network to obtain m image features of different resolution sizes, the fuzzy template generation module performs a convolution operation on the image features to generate a filter kernel group including a filter kernel with a preset side length and a number equal to the number of pixels of the image feature, and the processed image is filtered according to each filter kernel group to obtain m image features of the same resolution size. A blur template is used as the downsampled blur template, and each downsampled blur template is upsampled to obtain m blur templates of the same size as the original full-focus image as the upsampled blur template. The fusion weight generation module generates a fusion weight map that fuses all upsampled blur templates and has the same resolution as the upsampled blur template according to all image features and the corresponding upsampled blur template. The template weighted fusion module performs weighted fusion processing on the original full-focus image, all upsampled blur templates and the fusion weight map to obtain the final output blurred image. Therefore, on the one hand, the weighted fusion of a limited number of blur templates can be used to simulate the blur effect, reduce the difficulty of the network in learning the blur task, and greatly improve the running speed, so that it can run efficiently on mobile phones.
[0027] On the other hand, multiple groups of filter kernels with different numbers are generated for image features of different resolutions, and then the fully focused images of different downsampling granularities are filtered and amplified to generate blur templates with different degrees of blur. After the input fully focused images are reduced by different magnifications, the same size of filter kernels are uniformly used. At this time, in smaller images, the processing area involved in the filter kernel corresponds to a larger area in the original input image. When the blur template is enlarged to the original size of the input image, a more blurred effect will be produced, thereby effectively avoiding the problem of large computational complexity of very blurry blurring effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 is a structural block diagram of an image blur generation device based on confusion circle prediction in an embodiment of the present invention;
[0029] Figure 2 1 is a schematic diagram of a specific structure of an image blur generation device based on confusion circle prediction in an embodiment of the present invention;
[0030] Figure 3 is an action flow chart of image blur processing performed by an image blur generation device based on confusion circle prediction in an embodiment of the present invention; and
[0031] Figure 4 This is a comparison diagram of blurring an image using the image blur generation method of the present invention and the existing blurring technology in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the technical means, creative features, objectives and effects achieved by the present invention easier to understand, the present invention is described in detail below with reference to embodiments and drawings.
[0033] <Example>
[0034] Reference Figure 1 and Figure 2 In this embodiment, the image blur generation device 100 based on confusion circle prediction includes an image reading and conversion module 10, an image feature extraction module 20, a fuzzy template generation module 30, a fusion weight generation module 40 and a template weighted fusion module 50.
[0035] The image reading and conversion module 10 is used to read the RGB image of the original all-focus image, downsample the RGB image to obtain an image that meets the network input resolution requirements, and format convert the input image to obtain an image in a preset format as the image to be processed. The image reading and conversion module 10 includes an image reading unit and an image conversion unit.
[0036] The image reading unit is used to read the RGB image of the original all-focus image.
[0037] The image conversion unit is used to downsample the RGB image to obtain an input image that meets the network input resolution requirements, and then perform format conversion on the input image to obtain an image in a preset format as the image to be processed. The purpose of downsampling the RGB image is to reduce the RGB images of various sizes to the resolution range required by the network input, so that they can be fed into the designed network for feature extraction.
[0038] In this embodiment, the format of the original all-focus image is PNG format, JPEG format or BMP format, and the preset format is the Tensor format that can be read by existing deep learning model frameworks such as Pytorch and Tensorflow.
[0039] Image feature extraction module 20 is used to extract features from the image being processed using a neural network to obtain m image features of varying resolutions and sizes. Each image feature includes, but is not limited to, foreground and background information, object edge information, and other information. m is a positive integer greater than or equal to 2. Multiple image features of varying resolutions can comprehensively capture information about objects of varying sizes within the image. Image feature extraction module 20 comprises m basic module units of varying depths, as well as a feature retention unit, an image magnification unit, and an information jump transmission unit.
[0040] The m basic module units are used to extract features of the image to be processed from different depths as initial image features, and retain information about each pixel in the image to be processed. In this embodiment, each basic module unit contains multiple sets of processing layers, each of which is composed of a convolution layer, an instance normalization layer, and a linear rectification layer. The convolution layer is used to extract image features from different angles using a convolution kernel. The instance normalization layer is used to perform instance normalization on the features extracted by the convolution layer to obtain instance normalized features. The linear rectification layer serves as an activation function to filter unnecessary information in the instance normalized features to obtain initial image features.
[0041] The feature retention unit is used to condense each initial image feature to obtain a condensed image feature that retains the main features. In this embodiment, pooling is used to achieve feature retention; of course, convolution can also be used to achieve feature retention according to actual needs.
[0042] The image magnification unit is used to magnify each condensed image feature to obtain m image features.
[0043] The information jump transmission unit is used to connect basic module units of different depths, and directly transmit the information collected by the shallow basic module units in the encoder to the deep basic module units in the corresponding decoder with the same resolution to supplement the information missing of the initial image features during the concentration process.
[0044] The fuzzy template generation module 30 is used to perform a convolution operation on the image features to generate a filter kernel group consisting of filter kernels with a preset side length and a number equal to the number of pixels in the image features. Each filter kernel group is used to filter the image to be processed to obtain m downsampled fuzzy templates of the same resolution. Each downsampled fuzzy template is then upsampled to obtain m upsampled fuzzy templates of the same size as the original all-focus image. The fuzzy template generation module 30 includes a kernel prediction unit and an image filtering unit.
[0045] The kernel prediction unit is used to perform a convolution operation on the image feature to generate a filter kernel group consisting of filter kernels with a preset side length and a number equal to the number of pixels in the image feature. Specifically, the kernel prediction unit takes the image feature as input information and, through a convolution operation, outputs a filter kernel group consisting of multiple filter kernels. The number of filter kernels in the generated filter kernel group varies for image features of different resolutions. For example, for an image feature of size W pixels × H pixels at a certain resolution, the number of filter kernels in the filter kernel group is W × H.
[0046] The image filtering unit is used to filter the image to be processed according to each filter kernel group to obtain m down-sampled blur templates of the same resolution size, and up-sample each down-sampled blur template to obtain m up-sampled blur templates of the same size as the original fully focused image. Specifically, for an image to be processed of size W pixels × H pixels, the corresponding filter kernels are sequentially taken out from the corresponding W × H filter kernels and filtering operations are performed. For example, for the first pixel in the upper left corner of the image to be processed, the corresponding first filter kernel is taken out and filtered; for a total of W × H pixels, a total of W × H filtering operations are required, and a down-sampled blur template of size W pixels × H pixels is obtained. The same filtering process is performed on the image to be processed according to the m filter kernel groups, thereby obtaining m down-sampled blur templates.
[0047] In this embodiment, the preset side length of the filter kernel is 1 to 15. Although a filter kernel that is too large can also be effective, its generation requires a lot of graphics card resources and time.
[0048] The fusion weight generation module 40 is used to generate a fusion weight map that fuses all upsampled blur templates based on all image features and the corresponding upsampled blur templates. The fusion weight generation module 40 includes a feature processing and acquisition unit, an information filtering unit, and a weight limiting unit.
[0049] The feature processing and acquisition unit is used to perform convolution processing on image features.
[0050] The information filtering unit is used to filter unnecessary information in the image features after convolution processing.
[0051] The weight limiting unit is used to generate a fusion weight map with each value in the range of [-1, 1] according to the filtered image features and the corresponding up-sampled blur template.
[0052] The template weighted fusion module 50 is used to perform a weighted fusion process on the original fully focused image, all upsampled blur templates, and the fusion weight map to obtain the final output blurred image. Specifically, the template weighted fusion module 50 first performs a Hadamard product on all upsampled blur templates and the fusion weight map, adds them together, and then adds the original fully focused image to obtain the blurred image.
[0053] Correspondingly, the present invention also provides an efficient image blur generation method based on confusion circle prediction corresponding to the above-mentioned image blur generation device 100 based on confusion circle prediction. Figure 3 As shown, the efficient image blur generation method based on confusion circle prediction includes the following steps S1-S4.
[0054] Step S1, read the RGB image of the original all-focus image, downsample the RGB image to obtain an input image that meets the network input resolution requirement, and format convert the input image to obtain an image in a preset format as the image to be processed.
[0055] Step S2: performing feature extraction on the image to be processed through a neural network to obtain m image features of different resolutions.
[0056] Step S3, performing a convolution operation on the image feature to generate a filter kernel group including filter kernels with a preset side length and a number equal to the number of pixels of the image feature, performing filtering processing on the image to be processed according to each filter kernel group to obtain m blur templates of the same resolution size as the down-sampling blur template, and performing up-sampling processing on each down-sampling blur template to obtain m blur templates of the same size as the original full-focus image as the up-sampling blur template.
[0057] Step S4: generating a fusion weight map for fusing all the up-sampled fuzzy templates and having the same resolution as the up-sampled fuzzy templates according to all the image features and the corresponding up-sampled fuzzy templates.
[0058] Step S5: performing weighted fusion processing on the original all-focus image, all upsampled blur templates, and the fusion weight map to obtain the final output blurred image.
[0059] Figure 4 The comparison of the image blurring effect using the efficient image blurring generation method based on confusion circle prediction in this embodiment and the existing leading blurring technologies PyNET[1] and DMSHN[2] is shown. Figure 3 It can be seen that the blurring effect of the method of the present invention is relatively better. In addition, compared with the 47.5M parameters of PyNET and the 10.84M parameters of DMSHN, the implementation of this embodiment only requires 7.34M parameters, which is more convenient for deployment on mobile phones and is faster and more efficient when running.
[0060] [1]Ignatov A,Patel J,Timofte R.Rendering natural camera bokeh effect with deep learning[C] / / Proceedings of the IEEE / CVF Conference on ComputerVision and Pattern Recognition Workshops.2020:418-419.
[0061] [2]Dutta S, Das SD, Shah NA, et al.Stacked deep multi-scalehierarchical network for fast bokeh effect rendering from a single image[C] / / Proceedings of the IEEE / CVF Conference on Computer Vision and PatternRecognition.2021:2398-2407.
[0062] Functions and Effects of the Embodiments
[0063] According to the image blur generation device and method based on confusion circle prediction involved in this embodiment, since the image reading and conversion module reads the RGB image of the original all-focus image, downsamples the RGB image to obtain an input image that meets the network input resolution requirement, and performs format conversion on the input image to obtain an image in a preset format as the image to be processed, the image feature extraction module performs feature extraction on the image to be processed through a neural network to obtain m image features of different resolution sizes, the fuzzy template generation module performs a convolution operation on the image features to generate a filter kernel group including a filter kernel with a preset side length and a number equal to the number of pixels of the image feature, and performs filtering on the image to be processed according to each filter kernel group to obtain m image features of the same resolution size. A blur template is used as the downsampled blur template, and each downsampled blur template is upsampled to obtain m blur templates of the same size as the original full-focus image as the upsampled blur template. The fusion weight generation module generates a fusion weight map that fuses all upsampled blur templates and has the same resolution as the upsampled blur template according to all image features and the corresponding upsampled blur template. The template weighted fusion module performs weighted fusion processing on the original full-focus image, all upsampled blur templates and the fusion weight map to obtain the final output blurred image. Therefore, on the one hand, the weighted fusion of a limited number of blur templates can be used to simulate the blur effect, reduce the difficulty of the network in learning the blur task, and greatly improve the running speed, so that it can run efficiently on mobile phones.
[0064] On the other hand, multiple groups of filter kernels with different numbers are generated for image features of different resolutions, and then the fully focused images of different downsampling granularities are filtered and amplified to generate blur templates with different degrees of blur. After the input fully focused images are reduced by different magnifications, the same size of filter kernels are uniformly used. At this time, in smaller images, the processing area involved in the filter kernel corresponds to a larger area in the original input image. When the blur template is enlarged to the original size of the input image, a more blurred effect will be produced, thereby effectively avoiding the problem of large computational complexity of very blurry blurring effects.
[0065] The above embodiments are preferred examples of the present invention and are not intended to limit the scope of protection of the present invention.
Claims
1. An image blur generation device based on confusion circle prediction, characterized in that: include: An image reading and conversion module is used to read the RGB image of the original all-focus image, downsample the RGB image to obtain an input image that meets the network input resolution requirements, and convert the input image into an image in a preset format as the image to be processed; An image feature extraction module is used to perform feature extraction processing on the image to be processed through a neural network to obtain m image features of different resolutions; a fuzzy template generation module, configured to perform a convolution operation on the image feature to generate a filter kernel group including filter kernels having a preset side length and a number equal to the number of pixels of the image feature, perform filtering on the image to be processed according to each filter kernel group to obtain m fuzzy templates of the same resolution as the down-sampled fuzzy templates, and perform up-sampling on each of the down-sampled fuzzy templates to obtain m fuzzy templates of the same size as the original all-focus image as the up-sampled fuzzy templates; A fusion weight generation module, configured to generate a fusion weight map for fusing all the upsampled fuzzy templates and having the same resolution as the upsampled fuzzy templates based on all the image features and the corresponding upsampled fuzzy templates; as well as A template weighted fusion module is used to perform weighted fusion processing on the original all-focus image, all the upsampled blur templates and the fusion weight map to obtain the final output blurred image. The m is a positive integer not less than 2.
2. The image blur generation device based on circle of confusion prediction according to claim 1, characterized in that: in, The image feature extraction module includes m basic module units of different depths, as well as a feature retention unit, an image magnification unit and an information jump transmission unit. The m basic module units are used to extract the features of the image to be processed from different depths as initial image features, and retain the information of each pixel in the image to be processed. The feature retaining unit is used to condense each of the initial image features to obtain condensed image features that retain the main features. The image magnification unit is used to magnify each of the condensed image features to obtain the m image features, The information jump transmission unit is used to connect the basic module units of different depths, and directly transmit the information collected by the shallow basic module unit in the encoder to the deep basic module unit in the corresponding decoder with the same resolution to supplement the information missing of the initial image features during the concentration process.
3. The image blur generation device based on circle of confusion prediction according to claim 2, characterized in that: in, The basic module unit contains multiple groups of processing layers, each group of processing layers consists of a convolutional layer, an instance normalization layer, and a linear rectification layer. The convolution layer is used to extract image features from different angles using convolution kernels. The instance normalization layer is used to perform instance normalization processing on the features extracted by the convolutional layer to obtain instance normalized features. The linear rectification layer serves as an activation function, and is used to filter unnecessary information in the instance normalized features to obtain the initial image features.
4. The image blur generation device based on circle of confusion prediction according to claim 1, characterized in that: in, The fusion weight generation module includes a feature processing and acquisition unit, an information filtering unit and a weight limiting unit. The feature processing and acquisition unit is used to perform convolution processing on the image features, The information filtering unit is used to filter unnecessary information in the image features after convolution processing, The weight limiting unit is used to generate the fusion weight map, each value of which is within the range of [-1, 1], according to the filtered image features and the corresponding up-sampled blur template.
5. The image blur generation device based on circle of confusion prediction according to claim 1, characterized in that: in, The template weighted fusion module first performs Hadamard product on all the upsampled blur templates and the fusion weight map and adds them together, and then adds the original all-focused image to obtain the blurred image.
6. The image blur generation device based on circle of confusion prediction according to claim 1, characterized in that: in, The format of the original all-focus image is PNG format, JPEG format or BMP format, The preset format is the Tensor format.
7. The image blur generation device based on circle of confusion prediction according to claim 1, characterized in that: in, The preset side length is 1-15.
8. A method for generating image blur based on confusion circle prediction, characterized in that: The following steps are involved: Step S1, reading the RGB image of the original all-focus image, downsampling the RGB image to obtain an input image that meets the network input resolution requirement, and format converting the input image to obtain an image in a preset format as the image to be processed; Step S2, performing feature extraction processing on the image to be processed through a neural network to obtain m image features of different resolutions; Step S3: performing a convolution operation on the image feature to generate a filter kernel group including filter kernels having a preset side length and a number equal to the number of pixels of the image feature; performing filtering processing on the image to be processed according to each filter kernel group to obtain m blur templates of the same resolution as the down-sampled blur templates; and performing up-sampling processing on each of the down-sampled blur templates to obtain m blur templates of the same size as the original all-focus image as the up-sampled blur templates; Step S4, generating a fusion weight map that fuses all the upsampled fuzzy templates and has the same resolution as the upsampled fuzzy templates according to all the image features and the corresponding upsampled fuzzy templates; Step S5, performing weighted fusion processing on the original all-focus image, all the upsampled blur templates, and the fusion weight map to obtain the final output blurred image, The m are positive integers not less than 2.
9. The image blur generation method based on circle of confusion prediction according to claim 8, characterized in that: in, The step S5 is specifically as follows: First, Hadamard products are performed on all the upsampled blur templates and the corresponding fusion weight maps, and then added together, and then the original all-focused image is added to obtain the blurred image.
10. The image blur generation method based on circle of confusion prediction according to claim 8, characterized in that: in, The format of the original all-focus image is PNG format, JPEG format or BMP format, The preset format is the Tensor format.
Citation Information
Patent Citations
Image blurring method and device, mobile terminal and computer readable storage medium
CN110022430A
Image processing method and device
CN110349080A