Summary of the invention
For solving above-mentioned at least one problem of the prior art, the embodiment of the present invention provides a kind of image blurring disposal route and device, can improve Fuzzy Processing speed, has good adaptivity.
The embodiment of the present invention provides a kind of image blurring disposal route, comprising: the separatrix that circle of good definition and confusion region in image are set; The sampling fuzzy parameter of confusion region is set according to image size to be dealt with; The sampling fuzzy parameter that adopts set confusion region is to the confusion region Fuzzy Processing of sampling; Calculate Fuzzy Template corresponding to pixel in confusion region; The Fuzzy Template that employing obtains carries out fuzzy filter to the described pixel in the confusion region of sampling after Fuzzy Processing.Optionally, the described sampling fuzzy parameter that confusion region is set according to image size to be dealt with, comprising: image drop sampling ratio value and/or pixel sampling interval value that confusion region is set according to image size to be dealt with.
Optionally, comprise while the image drop sampling ratio value of confusion region being set according to image size to be dealt with when the sampling fuzzy parameter of confusion region is set according to image size to be dealt with, the sampling fuzzy parameter of the set confusion region of described employing comprises the confusion region Fuzzy Processing of sampling: adopt set image drop sampling ratio value to carry out down-sampled processing to confusion region; Fuzzy Template corresponding to pixel in described calculating confusion region, comprising: in the down-sampled confusion region after treatment of calculative determination, pixel need to be by fuzzy degree; Need to be calculated Fuzzy Template corresponding to pixel described in described confusion region by fuzzy degree according to described pixel.
Optionally, comprise according to image size to be dealt with and the image drop sampling ratio value of confusion region and pixel sampling interval are set when value when the sampling fuzzy parameter of confusion region is set according to image size to be dealt with, the sampling fuzzy parameter of the set confusion region of described employing also comprises the confusion region Fuzzy Processing of sampling: adopt set pixel sampling interval value, sample process is carried out in the current pixel region that needs Fuzzy Processing in confusion region after down-sampled processing.
Optionally, described image blurring disposal route also comprises: sampling processing is carried out rising in the confusion region after fuzzy filter.
Optionally, describedly confusion region after Fuzzy Processing is carried out to rise sampling processing be specially: adopt arest neighbors interpolation, two-wire type interpolation or bicubic interpolation method to carry out interpolation processing.
Optionally, in the down-sampled confusion region after treatment of described calculating, pixel need to, by fuzzy degree, be specially: determine that to marginal bee-line and the ratio of down-sampled image vertical width after treatment pixel need to be by fuzzy degree according to current pixel point in down-sampled image after treatment.
Optionally, determine that to marginal bee-line and the ratio of down-sampled image vertical width after treatment pixel need to, by fuzzy degree, be specially according to current pixel point in down-sampled image after treatment: shine upon corresponding fuzzy series as fuzzy coefficient using current pixel point in down-sampled image after treatment to marginal bee-line with ratio or the ratio of down-sampled image vertical width after treatment.
Optionally, describedly need to be calculated Fuzzy Template by fuzzy degree according to pixel, be specially: the type and size of determining Fuzzy Template; According to the type and size of the fuzzy coefficient calculating and definite Fuzzy Template, calculate current pixel point and be used for fuzzy Fuzzy Template.
Optionally, comprise according to image size to be dealt with and be set when value the pixel sampling interval when the sampling fuzzy parameter of confusion region is set according to image size to be dealt with, the sampling fuzzy parameter of the set confusion region of described employing, to the confusion region Fuzzy Processing of sampling, comprising: adopt set pixel sampling interval value to carry out sample process to the fuzzy pixel region of current needs.
Optionally, described image blurring disposal route also comprises: image is processed to strengthen to the model sense of described image.
Optionally, the described processing that image is carried out comprises that entire image is carried out in brightness adjustment, saturation degree adjustment, contrast adjustment and circle of good definition to image border to be strengthened and process wherein at least one.
The embodiment of the present invention also provides a kind of image blurring treating apparatus, comprising: separatrix setting unit, for the separatrix of image circle of good definition and confusion region is set; Sampling fuzzy parameter setting unit, for arranging the sampling fuzzy parameter of confusion region according to image size to be dealt with; Sampling Fuzzy Processing unit, for the sampling fuzzy parameter that adopts set confusion region to the confusion region Fuzzy Processing of sampling; Fuzzy Template computing unit, for Fuzzy Template corresponding to calculative determination confusion region pixel; Fuzzy filter unit, for adopting the Fuzzy Template that Fuzzy Template computing unit obtains to carry out fuzzy filter to the confusion region of sampling after Fuzzy Processing cell processing.
Optionally, described sampling fuzzy parameter setting unit comprises: the first parameter arranges subelement, for the image drop sampling ratio value of confusion region is set according to image size to be dealt with; Described sampling Fuzzy Processing unit comprises down-sampled subelement, for the image drop sampling ratio value that adopts the first parameter that subelement setting is set, down-sampled processing is carried out in confusion region.
Optionally, described sampling fuzzy parameter setting unit also comprises that the second parameter arranges subelement, for pixel sampling interval value being set according to image size to be dealt with; Described sampling Fuzzy Processing unit also comprises interval sampling subelement, for sample process is carried out in the fuzzy pixel region of the current needs of down-sampled subelement confusion region after treatment.
Optionally, described image blurring treating apparatus also comprises: rise sampling unit, for sampling processing is carried out rising in the confusion region after fuzzy filter unit Fuzzy Processing.
Optionally, described sampling fuzzy parameter setting unit comprises: the second parameter arranges subelement, for pixel sampling interval value being set according to image size to be dealt with; Described sampling Fuzzy Processing unit comprises interval sampling subelement, for sample process is carried out in the fuzzy pixel region of the current needs of down-sampled subelement confusion region after treatment.
Optionally, described image blurring treating apparatus also comprises model sense enhancement unit, for image being processed to strengthen the model sense of described image.
As can be seen from the above technical solutions, by image is carried out before fuzzy filter, according to image size to be dealt with to the confusion region Fuzzy Processing of sampling, thereby fixed form that can selection of small carries out Fuzzy Processing, therefore can improve arithmetic speed, improve the level of resources utilization.And for the image of different sizes, by different sampling fuzzy parameters is set, can obtain more consistent fuzzy fade effect, there is good adaptivity.
In addition, can reduce by down-sampled processing being carried out in the confusion region in image before fuzzy filter the pixel number that participates in Fuzzy Calculation, therefore can improve computing velocity, economize on resources.And, for different image sizes, different image drop sampling ratio values can be set, therefore can adopt less fixed form to carry out fuzzy filter to the image blurring district of different sizes, obtain more consistent fuzzy fade effect, there is good adaptivity.
By different pixel sampling interval values is set, confusion region pixel is carried out to sample process, thereby can obtain larger fog-level, therefore can adopt less fixed form, the image of different sizes is carried out to Fuzzy Processing.Owing to can adapting to the image of different sizes, therefore there is good adaptivity, and adopt less fixed form, with respect to adopting larger template or different templates, also can improve computing velocity.
Embodiment
In the embodiment of the present invention, the sampling fuzzy parameter of confusion region is set according to image size to be dealt with, the sampling fuzzy parameter that adopts afterwards set confusion region is to the confusion region Fuzzy Processing of sampling, and calculate after the Fuzzy Template that confusion region pixel is corresponding, the Fuzzy Template that employing obtains carries out fuzzy filter to pixel in the confusion region of sampling after fuzzy, can obtain blurred picture, realize camera micro-landscape special efficacy.
Such scheme can adopt less fixed form, by carrying out fuzzy filter after the Fuzzy Processing of being sampled in confusion region, is ensureing, under the prerequisite of better visual effect, can to improve arithmetic speed again.And, for the image of different resolution, can adopt the little template of fixed size, by different sampling fuzzy parameters is set, can obtain more consistent fuzzy fade effect, therefore there is good adaptivity.
For those skilled in the art being understood better and realizing the present invention, referring to accompanying drawing, be elaborated by specific embodiment.
Embodiment mono-
With reference to the image blurring process flow figure shown in Fig. 1, below be elaborated by concrete steps.
S101, arranges the separatrix of circle of good definition and confusion region in image.
The fuzzy special effect graph picture of the present embodiment micro-landscape to be dealt with by a middle circle of good definition and around one or more confusion regions form, set separatrix can be closed curve.With reference to the schematic layout pattern of the micro-landscape special effect graph picture shown in Fig. 2 and Fig. 3, wherein, in Fig. 2, center section is circle of good definition 201, upper and lower two parts are need to be from outwards carrying out confusion region 202 and the confusion region 203 of gradual change Fuzzy Processing with the separatrix of circle of good definition, and in Fig. 3, centre is circle of good definition 301, separatrix is curve, surrounding be from the fuzzy confusion region 302 of the outside gradual change in separatrix of circle of good definition.
Be understandable that, arrange separatrix arrange in the middle of circle of good definition and the marginal position of confusion region around.By being set, marginal position can change position and the shape of circle of good definition, in concrete enforcement, can manually arrange, also can be by equipment itself according to feature of image Lookup protocol, or some default shape are set and position is selected for user, for example circle of good definition is given tacit consent at image zone line, default shape can be rectangle, and circle is oval etc., user can select default setting, also can on the basis of default setting, regulate again.
S102, arranges the image drop sampling ratio value of confusion region according to image size to be dealt with.
For the image of different sizes, the maximum fog-level difference that uses the template of fixed size to reach, particularly for large image, the fog-level of little template is very weak, and the final visual effect producing is poor.Fuzzy progressive formation is not produced to obviously impact for improving little template fog-level when, in the present embodiment by image blurring district is processed by down-sampled.
In concrete enforcement, can provide the comparatively ideal image drop sampling ratio value of final blur effect according to the size of common image.Taking template size 15 × 15 as example, 1,000,000 and following image, can not use image drop sampling for resolution, down-sampled ratio value is set is 1; For resolution, at 2,000,000 to 5,000,000 image, it is 2 that down-sampled ratio value can be set; For resolution, at 6,000,000 to 8,000,000 image, it is 4 that down-sampled ratio value can be set; Be more than 8,000,000 images for size, can further improve the down-sampled ratio value of image.Be understandable that, different ratio values does not form limiting the scope of the invention, and those skilled in the art can arrange as required.
In concrete enforcement, image drop sampling ratio value corresponding common image size can be preserved and arranged, also can provide self-defined setting for user to select.
S103, adopts set image drop sampling ratio value to carry out down-sampled processing to confusion region.
In concrete enforcement, can adopt multiple down-sampled method.For example, can directly carry out uniformly-spaced down-sampledly to confusion region, also can carry out down-sampled to confusion region through the disposal of gentle filter.The former relative the latter realizes with computing method comparatively simple.
If image drop sampling ratio value is k, uniformly-spaced down-sampled method retains a sampled point to confusion region every k pixel in level and vertical direction, and the new confusion region size finally producing is the 1/k2 of former confusion region size.And be on the basis of equal interval sampling method through the down-sampled method of the disposal of gentle filter, the region of the k2 size of neighbouring sample point composition in level and vertical direction is weighted on average, the result obtaining is as the retention of current sampling point.
Be understandable that, different down-sampled methods itself do not form limiting the scope of the invention.
S104, the pixel that calculates confusion region after down-sampled processing need to be by fuzzy degree.
The object of calculating fog-level is to calculate or choose the template for the each pixel of Fuzzy Processing.Can adopt several different methods to calculate.In the present embodiment, according to current pixel point to the ratio of marginal bee-line and 1/k image vertical width as the fuzzy coefficient that calculates or choose template.As shown in Figure 4, dotted line frame 400 is original image boundary line, the circle of good definition that dotted line 401 is original image and separatrix, confusion region, solid box 402 is by down-sampled original image 400 framing mask after treatment, solid line 403 is the down-sampled processing separatrix of new circle of good definition and confusion region afterwards, and Pi is down-sampled processing new pending pixel in confusion region afterwards.In the present embodiment, fuzzy coefficient can be expressed as follows by computing formula:
Wherein, parameter alpha i is the down-sampled processing ratio of i pixel in new confusion region afterwards, reflects that this pixel need to be by fuzzy degree, the vertical width that D is original image, and di is that in new confusion region, i pixel arrives marginal bee-line.
In concrete enforcement, fuzzy coefficient α i also can obtain according to method similar or that simplify.For example, D/k can be divided into LevelMax section according to the maximum fuzzy series LevelMax of prior setting, calculate or select corresponding Fuzzy Template according to the residing fuzzy series of the α i value of current pixel point afterwards.Be understandable that, the implementation that parameter alpha i is different does not form limiting the scope of the invention.
S105, need to be calculated the Fuzzy Template that described pixel is corresponding by fuzzy degree according to pixel in step S104.
In concrete enforcement, first can determine the type and size of Fuzzy Template, and according to the type and size of determined Fuzzy Template, and the fuzzy coefficient that calculates of step S104, calculate current pixel point and be used for fuzzy Fuzzy Template.In the present embodiment, select Gauss's template of 15 × 15 sizes.Because template size is limited, in the time that Gaussian function standard deviation sigma increases to certain value, in Gauss's template the weighted value of each element change very little, therefore the variation range that σ can be set at 0~SigmaMax, in the present embodiment, SigmaMax gets 15.
Then the value using the result of α i × SigmaMax as σ produces current pixel point and is used for fuzzy Gauss's template.The coordinate of supposing template center's element is (0,0), and template center's element is at the 0th row the 0th row, and in concrete template, the weighted value of each element can utilize following formula to calculate:
Wherein, h (n
1, n
2) represent the element value that in template, the capable n2 of n1 is listed as, n1, n2=-7 ..., 7,
for h (n
1, n
2) normalization result.In final template the weighted value of each element by
represent.
S106, utilizes the template calculating in step S105 to carry out fuzzy filter to down-sampled confusion region after treatment.
A pixel is being carried out after fuzzy filter, judging in the confusion region after down-sampled, whether all pixels are all handled, and if so, perform step S107; If not, to next pixel execution step S104~S106 in confusion region, until all pixels are all handled in down-sampled confusion region after treatment.
S107, carries out rising sampling processing by the confusion region after fuzzy filter.
After pixel in confusion region after down-sampled is all handled, the result liter after Fuzzy Processing is sampled to the down-sampled size before in confusion region.Sampling processing is carried out rising in confusion region, can adopt interpolation method, concrete interpolation method can be arest neighbors interpolation, two-wire type interpolation or bicubic interpolation.Be understandable that, the concrete sampling processing method that rises does not form limiting the scope of the invention.
Can find out from the present embodiment, image is carried out before Fuzzy Processing, the image drop sampling ratio value that employing sets in advance confusion region carries out down-sampled processing to confusion region, and should be by fuzzy degree according to down-sampled confusion region after treatment, calculate Fuzzy Template corresponding to each pixel in down-sampled confusion region after treatment, and adopt the Fuzzy Template calculating to carry out fuzzy filter to down-sampled confusion region after treatment, realize the Fuzzy Processing of camera micro-landscape special effect graph picture.Therebetween, before fuzzy filter, down-sampled processing is carried out in the confusion region in image and can reduce the pixel number that participates in Fuzzy Calculation, therefore can improve computing velocity, economize on resources.And, for different image sizes, different image drop sampling ratio values can be set, therefore can adopt less fixed form to carry out fuzzy filter to the image blurring district of different sizes, obtain more consistent fuzzy fade effect, there is good adaptivity.
In concrete enforcement, can expand above-mentioned image blurring disposal route, to obtain better image processing effect.For example, for the image that makes the final fuzzy special efficacy of micro-landscape generating has more model sense, can before Fuzzy Processing, carry out some pre-service to image.
Image pre-service comprises that entire image is carried out to image border in brightness, saturation degree, contrast adjustment and circle of good definition strengthens processing, in concrete enforcement, can as required, adopt wherein one or more modes.It is quite ripe that relevant brightness, saturation degree, contrast adjustment and edge strengthens treatment technology, and relevant implementation method repeats no more herein.
Be understandable that, the processing of above-mentioned enhancing iconic model sense also can, after Fuzzy Processing completes or in Fuzzy Processing process, repeat no more herein.
For the image of different sizes, the maximum fog-level difference that uses the template of fixed size to reach, particularly for large image, the fog-level of little template is very weak, and the final visual effect producing is poor.Fuzzy progressive formation is not produced to obviously impact for improving little template fog-level when, can also do further to optimize to above-described embodiment, two be elaborated by the following examples.
Embodiment bis-
Be with embodiment mono-difference, the present embodiment also adopts the pixel sampling interval of setting confusion region pixel to be carried out to the method for sample process, be two kinds of disposal routes of down-sampled and confusion region, combining image confusion region pixel sampling, with reference to the image blurring process flow figure shown in Fig. 5, specifically comprise the following steps:
S501, carries out pre-service to strengthen iconic model sense to image.
As previously mentioned, for strengthening iconic model sense, can carry out multiple processing to image, for example, can carry out brightness, saturation degree, contrast adjustment to image, also can simultaneously or only strengthen processing to image border in circle of good definition, repeat no more.The processing of above-mentioned enhancing iconic model sense also can be carried out after image is carried out to Fuzzy Processing.
S502, arranges the separatrix of circle of good definition and confusion region in image.
Arrange separatrix arrange in the middle of circle of good definition and the marginal position of confusion region around, can change position and the shape of circle of good definition, meet consumers' demand better.
S503, arranges image drop sampling ratio value and pixel sampling interval value according to image size to be dealt with.
In the present embodiment, provide the comparatively ideal down-sampled ratio value of final blur effect and pixel sampling interval value according to common image size.Taking template size 15 × 15 as example,, can not use image drop sampling and the pixel methods of sampling and directly image blurring district be carried out to Fuzzy Processing 1,000,000 and following image for resolution, down-sampled ratio value and pixel sampling interval value are set and are 1; Be 2,000,000 to 3,000,000 image for rate respectively, it is 1 that down-sampled ratio value can be set, and pixel sampling interval value is 2; For resolution, at 4,000,000 to 5,000,000 image, it is 2 that down-sampled ratio value can be set, and pixel sampling interval value is 1; For resolution, at 6,000,000 to 8,000,000 image, it is 4 that down-sampled ratio value can be set, and pixel sampling interval value is 1 or 2, for more than 8,000,000 images, can further improve ratio value and spacing value.Be understandable that, different ratio value and spacing values are not construed as limiting the invention.
Inventor finds, when the down-sampled ratio value of two kinds of method settings or pixel sampling interval value and above-mentioned better settings differ too large, having spinoff separately produces, affect fuzzy visual effect, such as, if image drop sampling ratio value arranges when excessive, may there is the obvious situation in separatrix of confusion region and circle of good definition, if and pixel sampling interval value arranges when excessive, latticed phenomenon may obviously be observed after amplifying in low confusion region.And down-sampled ratio value and pixel sampling interval value are in conjunction with selecting, can avoid the generation of above-mentioned two kinds of phenomenons, obtain the preferably fuzzy special efficacy effect of micro-landscape.In concrete enforcement, can select by experiment some preferably parameter value select for user as recommended parameter.
S504, the down-sampled ratio value that adopts step S503 to arrange carries out down-sampled processing to confusion region.
In concrete enforcement, can adopt multiple down-sampled method.For example, can directly carry out confusion region uniformly-spaced down-sampled, also can be through the disposal of gentle filter carry out down-sampled to confusion region.Here no longer describe in detail.
S505, the fuzzy coefficient of each pixel in the down-sampled confusion region after treatment of calculation procedure S504.
Can redefine each pixel according to the down-sampled ratio in image blurring district and need to, by fuzzy degree, calculate fuzzy coefficient.Concrete methods of realizing can, with reference to embodiment mono-, no longer describe in detail here.
S506, calculates Fuzzy Template according to the fuzzy coefficient calculating in step S505.
In the present embodiment, adopt Gauss's template of 15 × 15 sizes.Because template size is limited, in the time that Gaussian function standard deviation sigma increases to certain value, in Gauss's template the weighted value of each element change very little, therefore the variation range that σ can be set at 0~SigmaMax, in the present embodiment, SigmaMax gets 15.
Be understandable that, in concrete enforcement, also can select the Fuzzy Template of other kinds, for example mean filter template.And, according to image size to be dealt with, can select the Fuzzy Template of the different sizes of variety classes.
S507, the pixel sampling interval arranging according to step S503 is carried out sample process to the fuzzy pixel region of current needs.
In order to obtain larger fog-level, confusion region is carried out before fuzzy filter, the pixel sampling interval of setting according to step S503 is carried out sample process to the fuzzy pixel region of current needs.For example, the sampling interval is 2 o'clock, chooses 30 × 30 size area centered by current pixel point in confusion region, carries out decimation and obtains the matrix of 15 × 15.
S508, the pixel after utilizing the Fuzzy Template calculating in step S506 to sample process in down-sampled confusion region after treatment carries out fuzzy filter.
The template in step S507, the matrix obtaining after the current pixel point sample process of confusion region and step S506 being calculated is carried out to process of convolution, and the convolution results of central pixel point is the pixel value after this pixel fuzzy filter.
Pixel to confusion region after down-sampled processing performs step S505~S508 successively, until all pixels in confusion region are all handled after down-sampled processing.Wherein, step S507 and step S505 and S506 do not have obvious time sequencing.
S509, carries out rising sampling processing by the confusion region after fuzzy filter.
After all Fuzzy Processing completes to pixels all in down-sampled confusion region after treatment, the result liter after Fuzzy Processing is sampled to the down-sampled size before in confusion region.Carry out rising sampling processing and can adopt interpolation method, such as arest neighbors interpolation, two-wire type interpolation, bicubic interpolation etc., concrete grammar no longer describes in detail.Be understandable that, the concrete method of sampling that rises is not construed as limiting the invention.
For making those skilled in the art understand better the present invention, below respectively image is carried out to the method that down-sampled processing and pixel sampling interval process by specific embodiment and describe.
First, the method of image being carried out to down-sampled processing is as follows: as shown in Figure 6, be M × N to image-region 601(size) to carry out ratio value be the down-sampled of k, after sampling, image size becomes M × N/ (k2), and after namely participating in, the pixel number of formwork calculation is kept to original 1/k2.
Calculate fuzzy coefficient α i, wherein D=Mk according to the image 602 after down-sampled
2, calculate element value in Gauss template according to α i, wherein, the size of template is set, and such as 15 × 15, compares 61 × 61 size much smaller.The number that participates in the pixel of fuzzy filter calculating by minimizing, can improve computing velocity.
Adopt the set pixel sampling interval, the method for pixel being carried out to pixel interval sampling processing is as follows:
With reference to Fig. 7, suppose that template 704 sizes are 5 × 5, in image 701 and 702, each square lattice represents a pixel.
First referring to image 701, in the time that sample value is 1, centered by current pixel point, choose continuously in image 701 and the equirotal region of template 704, for Fuzzy Calculation; Image 702 illustrates that sample value is at 2 o'clock, and dot interlace is chosen 10 × 10 size area in image 702 and obtained and the equirotal region 703 of template 704, for Fuzzy Calculation.
From above for example, the method of down-sampled processing, can reduce the total number of pixel that participates in formwork calculation, for M × N/k2, and process in the region of the pixel methods of sampling after down-sampled, can in down-sampled region after treatment, not reduce the pixel number that participates in calculating, the pixel that participates in the processing of the pixel methods of sampling is still M × N/k2, but can increase the size in the region that participates in formwork calculation.As image 702 carried out to sample process in Fig. 7, although participating in the number of the point of fuzzy filter calculating extraction is still 5 × 5, but can think that participating in the area size image 702 that fuzzy filter calculates is 4 times of image 701, thereby making the fog-level that image 702 obtains is 4 times (supposing that fog-level is directly proportional to the area in the region that participates in fuzzy filter calculating) of image 701, therefore known, although the pixel methods of sampling does not reduce the total number of pixel that participates in calculating, but in the fixing situation of template size, can obtain larger fog-level.
Visible, by image drop sampling processing is carried out in confusion region, and the pixel in confusion region after down-sampled processing is carried out to sample process, can reduce the pixel number that participates in Fuzzy Processing, therefore can improve computing velocity, and can improve the fog-level of confusion region, therefore can adopt the template that size is less, and, can adopt the template of fixed measure, different sampling fuzzy parameters is set, comprise image drop sampling ratio value and pixel sampling interval value, image to different sizes carries out Fuzzy Processing, and can obtain good consistance, therefore there is good adaptivity.
In concrete enforcement, it will be understood by those skilled in the art that, realize in the process of micro-landscape special efficacy in Fuzzy Processing, also can only adopt default pixel sampling interval value, the pixel of confusion region is carried out carrying out fuzzy filter after pixel sample process again.Now, do not need image blurring district to carry out the sampling processing that rises after down-sampled and fuzzy filter, also not needing to recalculate confusion region current pixel point need to be by fuzzy degree, but directly select the applicable template type of confusion region current pixel point and size as Fuzzy Template, and the template of selection is carried out to process of convolution with pixel described in confusion region being adopted to the matrix obtaining after default pixel sampling interval value processing, can obtain the pixel value after this pixel fuzzy filter.
By different pixel sampling interval values is set, confusion region pixel is carried out to sample process, thereby can obtain larger fog-level, therefore can adopt less fixed form, the image of different sizes is carried out to Fuzzy Processing, owing to can adapting to the image of different sizes, therefore there is good adaptivity, and adopt less fixed form, with respect to adopting larger template or different templates, also can improve computing velocity.
For those skilled in the art being understood better and realizing the present invention, below by specific embodiment, the corresponding device of said method is described in detail.
Embodiment tri-
With reference to the image blurring treating apparatus shown in Fig. 8, comprising: separatrix setting unit 801, sampling fuzzy parameter setting unit 802, sampling Fuzzy Processing unit 803, Fuzzy Template computing unit 804 and fuzzy filter unit 805, wherein:
Separatrix setting unit 801, for arranging the separatrix of image circle of good definition and confusion region;
Sampling fuzzy parameter setting unit 802, for arranging the sampling fuzzy parameter of confusion region according to image size to be dealt with;
Sampling Fuzzy Processing unit 803, for the sampling fuzzy parameter that adopts set confusion region to the confusion region Fuzzy Processing of sampling;
Fuzzy Template computing unit 804, for Fuzzy Template corresponding to calculative determination confusion region pixel;
Fuzzy filter unit 805, for adopting the Fuzzy Template that Fuzzy Template computing unit 804 obtains to carry out fuzzy filter to sampling confusion region after treatment, Fuzzy Processing unit 803.
In the present embodiment, the separatrix of circle of good definition and confusion region in image is set by separatrix setting unit 801, and the sampling fuzzy parameter of confusion region is set according to image size to be dealt with by sampling fuzzy parameter setting unit 802, adopt the sampling fuzzy parameter of set confusion region to carry out sample process to confusion region by sampling Fuzzy Processing unit 803, fuzzy filter is carried out in confusion region after adopting again the template calculating to sample process, realize the Fuzzy Processing of micro-landscape special efficacy, owing to can different sampling fuzzy parameters being set according to image size in advance, sample process is carried out in confusion region, therefore can adopt less fixed form, therefore can improve the speed of Fuzzy Processing, and there is good adaptivity.
In concrete enforcement, with reference to Fig. 8, sampling fuzzy parameter setting unit 802 can comprise: the first parameter arranges subelement 8021, for the image drop sampling ratio value of confusion region is set according to image size to be dealt with; Correspondingly, sampling Fuzzy Processing unit comprises down-sampled subelement 8031, for adopting the first parameter that the image drop sampling ratio value that subelement 8021 arranges is set, down-sampled processing is carried out in confusion region.
By adopting the image drop sampling ratio value setting in advance to carry out down-sampled processing to image blurring district to down-sampled subelement 8031, can reduce the pixel that participates in fuzzy filter computing, thereby can improve computing velocity, and can different down-sampled ratio values be set according to different image sizes, therefore can adopt the fixed form that size is less, obtain more consistent fuzzy fade effect, there is good adaptivity.
In concrete enforcement, sampling fuzzy parameter setting unit 802 also can comprise that the second parameter arranges subelement 8022, for pixel sampling interval value being set according to image size to be dealt with; Correspondingly, sampling Fuzzy Processing unit 803 also can comprise interval sampling subelement 8032, carries out sample process for the fuzzy pixel region of current needs to down-sampled subelement 8031 confusion regions after treatment.
By according to the image size set pixel sampling interval, sample process is carried out in current pixel point region in confusion region, can increase the size in the region that participates in formwork calculation, obtain larger fog-level, owing to can adopting less fixed form, therefore can improve the efficiency of Fuzzy Processing, and to different big or small images, there is good adaptivity.
In above embodiment, if adopt down-sampled subelement 8031 to carry out down-sampled processing to image blurring district, described device also can comprise and rises sampling unit 806, for sampling processing is carried out rising in the confusion region after fuzzy filter unit 805 Fuzzy Processing.
In concrete enforcement, sampling fuzzy parameter setting unit 802 can only comprise that the second parameter arranges subelement 8022, for pixel sampling interval value being set according to image size to be dealt with.Correspondingly, sampling Fuzzy Processing unit 803 can only comprise interval sampling subelement 8032, for sample process is carried out in the fuzzy pixel region of the current needs of down-sampled subelement confusion region after treatment.
For strengthening image processing effect, described device also can comprise model sense enhancement unit 807, for image being processed to strengthen the model sense of described image.For example, model sense enhancement unit 807 can be carried out image border in brightness, saturation degree, contrast adjustment and circle of good definition to entire image and be strengthened processing, in concrete enforcement, can as required, adopt wherein one or more modes.It is quite ripe that relevant brightness, saturation degree, contrast adjustment and edge strengthens treatment technology, and relevant implementation method repeats no more herein.
In concrete enforcement, model sense enhancement unit 807 can be processed in advance image before Fuzzy Processing, also can after Fuzzy Processing completes, process image again.
Although the present invention discloses as above, the present invention is not defined in this.Any those skilled in the art, without departing from the spirit and scope of the present invention, all can make various changes or modifications, and therefore protection scope of the present invention should be as the criterion with claim limited range.