CN109447942A - Image blur determines method, apparatus, computer equipment and storage medium - Google Patents

Image blur determines method, apparatus, computer equipment and storage medium Download PDF

Info

Publication number
CN109447942A
CN109447942A CN201811073282.2A CN201811073282A CN109447942A CN 109447942 A CN109447942 A CN 109447942A CN 201811073282 A CN201811073282 A CN 201811073282A CN 109447942 A CN109447942 A CN 109447942A
Authority
CN
China
Prior art keywords
pixel
gradient
image
vertical
target signature
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811073282.2A
Other languages
Chinese (zh)
Other versions
CN109447942B (en
Inventor
刘洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811073282.2A priority Critical patent/CN109447942B/en
Priority claimed from CN201811073282.2A external-priority patent/CN109447942B/en
Publication of CN109447942A publication Critical patent/CN109447942A/en
Application granted granted Critical
Publication of CN109447942B publication Critical patent/CN109447942B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Abstract

This application discloses a kind of image blurs to determine method, apparatus, computer equipment and storage medium, applied to field of image recognition, the judging efficiency of facial image fuzziness can be effectively improved, the application method part includes: to obtain target signature region grayscale image, and target signature region grayscale image is the corresponding grayscale image of target signature region of facial image;Horizontal direction convolution algorithm and vertical direction convolution algorithm are carried out to pixel each in target signature region grayscale image, to obtain the horizontal direction gradient and vertical gradient of each pixel;The corresponding approximate gradient of each pixel is determined according to the horizontal direction gradient and vertical gradient of each pixel;Objective fuzzy degree is determined according to the corresponding approximate gradient of each pixel, using objective fuzzy degree as the fuzziness of facial image.

Description

Image blur determines method, apparatus, computer equipment and storage medium
Technical field
This application involves field of image recognition more particularly to a kind of image blur to determine method, apparatus, computer equipment And storage medium.
Background technique
It during recognition of face, needs to detect face, quality meets the people of subsequent processing requirement in order to obtain Face image needs to need to carry out to the facial image after detection the process of Quality estimation, wherein judge its of quality of human face image In one with reference to be exactly facial image fuzziness, currently used more is increase income computer vision library (Open Source Computer Vision Library, opencv) Lai Jinhang facial image fuzziness judgement.
Wherein, opencv is a cross-platform computer vision library, may operate in the operations such as Linux, Windows system On system.Its lightweight and efficiently --- be made of a series of C functions and a small amount of C++ class, while providing the language such as Python Interface, realize many general-purpose algorithms in terms of image procossing and computer vision.But due to traditionally utilizing opencv It is to be judged that calculation amount is larger based on whole face characteristic when the fuzziness of progress facial image judges, the judgement of fuzziness Efficiency is relatively low.
Summary of the invention
Based on this, it is necessary to which in view of the above technical problems, facial image fuzziness can be effectively improved by providing one kind The image blur of judging efficiency determines method, apparatus, computer equipment and storage medium.
A kind of image blur determines method, comprising:
Obtain facial image;
Facial image cut and gray proces are to obtain target signature region grayscale image, target signature region gray scale Figure is the corresponding grayscale image of target signature region of facial image;
Horizontal direction convolution algorithm and vertical direction convolution fortune are carried out to pixel each in target signature region grayscale image It calculates, to obtain the horizontal direction gradient and vertical gradient of each pixel;
The corresponding approximate ladder of each pixel is determined according to the horizontal direction gradient and vertical gradient of each pixel Degree;
Objective fuzzy degree is determined according to the corresponding approximate gradient of each pixel, using objective fuzzy degree as facial image Fuzziness.
A kind of image blur determining device, comprising:
Module is obtained, for obtaining facial image;
It cuts and gradation processing module, the facial image for obtaining to the acquisition module carries out cutting and gray scale To obtain target signature region grayscale image, the target signature region grayscale image is the target signature area of the facial image for processing The corresponding grayscale image in domain;
Computing module, for carrying out level side to each pixel in the target signature region grayscale image for obtaining module acquisition To convolution algorithm and vertical direction convolution algorithm, to obtain the horizontal direction gradient and vertical gradient of each pixel;
First determining module, the horizontal direction gradient of each pixel for being calculated according to computing module and vertical Direction gradient determines the corresponding approximate gradient of each pixel;
Second determining module, the corresponding approximate gradient of each pixel for being determined according to the first determining module determine mesh Fuzziness is marked, using objective fuzzy degree as the fuzziness of facial image.
A kind of computer equipment, including memory, processor and storage are in the memory and can be in the processing The computer program run on device, the processor realize that above-mentioned image blur determines method when executing the computer program The step of.A kind of computer readable storage medium, the computer-readable recording medium storage have computer program, the calculating Machine program realizes the step of above-mentioned image blur determines method when being executed by processor.
Above-mentioned image blur determines in the scheme that method, apparatus, computer equipment and storage medium are realized, for It is no longer to be judged based on whole facial image, but obtained from facial image when the fuzziness of facial image is determined Take target signature region to determine the fuzziness of facial image, while reducing calculation amount, due to be not take it is bulky Opencv can also reduce the burden of the terminal device using the application, effectively improve the judgement of facial image fuzziness Efficiency.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below by institute in the description to the embodiment of the present application Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the application Example, for those of ordinary skill in the art, without any creative labor, can also be according to these attached drawings Obtain other attached drawings.
Fig. 1 is that image blur determines one application environment schematic diagram of method in the application;
Fig. 2 is that image blur determines method one embodiment flow diagram in the application;
Fig. 3 is mono- specific embodiment flow diagram of step S20 in Fig. 2;
Fig. 4 is mono- specific embodiment flow diagram of step S30 in Fig. 2;
Fig. 5 is another specific embodiment flow diagram of step S30 in Fig. 2;
Fig. 6 is mono- specific embodiment flow diagram of step S40 in Fig. 2;
Fig. 7 is another specific embodiment flow diagram of step S40 in Fig. 2;
Fig. 8 is image blur determining device one embodiment structural schematic diagram in the application;
Fig. 9 is an example structure schematic diagram of computer equipment in one embodiment of the application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiment is some embodiments of the present application, instead of all the embodiments.Based on this Shen Please in embodiment, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall in the protection scope of this application.
The application provides a kind of image blur and determines method, and final fuzziness judging efficiency can be improved, can be applied to In network frame schematic diagram as shown in Figure 1, wherein terminal device obtains facial image, carries out cutting and ash to facial image Degree processing is to obtain target signature region grayscale image, wherein target signature region grayscale image is the target signature area of facial image The corresponding grayscale image in domain;Horizontal direction convolution algorithm and vertical direction are carried out to pixel each in target signature region grayscale image Convolution algorithm, to obtain the horizontal direction gradient and vertical gradient of each pixel;According to the level side of each pixel The corresponding approximate gradient of each pixel is determined to gradient and vertical gradient;According to the corresponding approximate gradient of each pixel Objective fuzzy degree is determined, using objective fuzzy degree as the fuzziness of facial image.Thus, in this application, for people It is no longer to be judged based on whole facial image, but obtained from facial image when the fuzziness of face image is determined Target signature region determines the fuzziness of facial image, while reducing calculation amount, due to be not take it is bulky Opencv can also reduce the burden of the terminal device using the application, effectively improve the judgement of facial image fuzziness Efficiency.Terminal device can be, but not limited to various personal computers, laptop, smart phone, tablet computer and portable Wearable device is particularly suitable for mobile terminal device, such as mobile phone, wearable device etc., specifically without limitation.It additionally needs Illustrate, the image blur in the application determines that method applies also in server, and server can use independent clothes The server cluster of business device either multiple servers composition realizes, specifically without limitation.It is carried out below for the application detailed Thin description, as shown in Fig. 2, including the following steps:
S10, facial image is obtained;
It is applied it is appreciated that face recognition technology is also widely used in every field, illustratively, for example is utilized Recognition of face carries out mobile terminal or computer unlock, and the body of some application programs (Application, APP) is entered using mobile phone Part verification process (such as shopping class APP, educational APP), using the process of mobile terminal progress attendance, in some gate inhibitions' monitoring Recognition of face used etc., in above-mentioned face recognition process, the function of thering is brush face to verify, that is, need to obtain use The facial image at family then carries out recognition of face.It should be noted that above-mentioned application example is that an example is said herein It is bright, can't the application constitute and limit, specifically here without limitation, in addition, in a particular application, in addition to utilizing mobile phone, computer Equal terminal devices can also be other terminal devices outside being unlocked, for example, smartwatch etc., here also without limitation.Upper It states in exemplary application scenarios, in order to improve the accuracy of recognition of face, the facial image for the user that can be obtained first carries out one The process of a Quality estimation, above-mentioned Quality estimation include the process that image blur determines, facial image has been obscured very much and will lead to Last recognition of face effect can be poor, thus need first to judge before carrying out recognition of face the facial image obtained whether mould Paste, until the facial image that taking-up meets quality is being identified.Therefore, in this application, above-mentioned facial image need to first be obtained.
S20, cutting and gray proces are carried out to facial image to obtain target signature region grayscale image, target signature region Grayscale image is the corresponding grayscale image of target signature region of facial image;
In this application, after having got above-mentioned facial image, facial image need to be carried out cut and gray proces with Obtain target signature region grayscale image.Wherein, the target signature region grayscale image is right for the target signature region of facial image The grayscale image answered.In addition, facial image can be obtained in application scenes, the target signature region of facial image is cut out, Grayscale image conversion is carried out to obtain target signature region grayscale image to target signature region.In other application scenarios, Facial image can be obtained, grayscale image conversion is carried out to facial image, then cut from the facial image after grayscale image converts Target signature region is out to obtain above-mentioned target signature region grayscale image, specifically here without limitation.Illustratively, it is carrying out During above-mentioned grayscale image conversion, conventional grayscale image method for transformation can be used illustratively, can to make here without limitation It is converted with RGB bitmap.For example, the color of certain original point is RGB (R, G, B) in facial image, it specifically can be by following several By this, certain point is converted to obtain certain point Gray kind mode, comprising: 1, floating-point arithmetic: Gray=R*0.3+G*0.59+B* 0.11;2, integer method: Gray=(R*30+G*59+B*11)/100;3, displacement method: Gray=(R*76+G*151+B* 28)>>8;4, mean value method: Gray=(R+G+B)/3, specifically without limitation.
It is further to note that in some embodiments, after obtaining target signature region grayscale image, after improving Continuous treatment effeciency and quality can pre-process target signature region grayscale image, wherein above-mentioned pretreatment includes but not office It is limited to: denoising is carried out to target signature region grayscale image, that is, removes the point changed greatly in picture with surrounding point, with And normalized, that is, the point for largely concentrating on centre in target signature region grayscale image is made to be stretched to entire grayscale image area Domain.In denoising, illustratively, Gassian low-pass filter denoising specifically can be used, NL-Means (non-local mean) etc. is gone It makes an uproar mode, here without limitation.And in normalized, common normalization means can be used, as long as can be by target signature The pixel value normalizing of area grayscale figure is to a certain range, specifically without limitation, such as by target signature region grayscale image Pixel value subtracts mean value, is then normalized divided by the mode of pixel value variance.It is appreciated that pass through above-mentioned pretreatment, The interference information for can be very big reducing target signature region gray scale, effectively improves the overall treatment efficiency of scheme.
S30, horizontal direction convolution algorithm and vertical direction volume are carried out to pixel each in target signature region grayscale image Product operation, to obtain the horizontal direction gradient and vertical gradient of each pixel;
It should be understood that target signature region grayscale image is made of multiple pixels, by obtaining target signature region ash After spending figure, horizontal direction convolution algorithm and vertical direction convolution are carried out respectively to each pixel in target signature region grayscale image Operation, so as to obtain the horizontal direction gradient and vertical gradient of each pixel.It should be understood that facial image is a kind of Digital picture is a kind of discrete point spectrogram, and corresponding target signature region grayscale image is also a kind of spectrogram, is alternatively referred to as A kind of two-dimensional discrete function, and gradient refers to the derivation of this two-dimensional discrete function, gradient has direction, and in this application, Horizontal direction convolution algorithm and vertical direction convolution algorithm can be carried out to pixel each in target signature region grayscale image, to obtain Each pixel horizontal direction gradient and vertical gradient, from another point of view on say, and to have obtained entire target special Levy the horizontal direction gradient and vertical gradient of area grayscale figure.
S40, determine that each pixel is corresponding close according to the horizontal direction gradient and vertical gradient of each pixel Like gradient;
In this application, in obtaining target signature region grayscale image one of target pixel points horizontal direction gradient After vertical gradient, object pixel can be determined according to the horizontal direction gradient and vertical gradient of target pixel points Put corresponding approximate gradient, other corresponding approximate gradient calculation methods of all pixels point and mesh in target signature region grayscale image As marking pixel, therefore the corresponding approximate gradient of each pixel in target signature region grayscale image can be obtained.Wherein, as The corresponding approximate gradient of vegetarian refreshments horizontal direction gradient corresponding to the pixel is related with vertical gradient.
S50, objective fuzzy degree is determined according to the corresponding approximate gradient of each pixel, using objective fuzzy degree as face figure The fuzziness of picture.
Thus, being no longer based on whole people when the fuzziness for facial image is determined in this application Face image is judged, but the fuzziness that target signature region determines facial image is obtained from facial image, is counted reducing While calculation amount, due to not being to take bulky opencv, the burden of the terminal device using the application can also be reduced, is had Improve to effect the judging efficiency of facial image fuzziness.
It should be noted that the target signature region of above-mentioned facial image refers to face figure in application scenes The nasal area or eye areas of picture.In this application, the target signature region of facial image, which refers to, can most reflect people in face Region of face notable feature, such as eyes, mouth, nose etc. are also to focus principally on the above-mentioned face area of identification in recognition of face Domain, as long as above-mentioned target signature region fuzziness is enough, the fuzziness for reflecting facial image to a certain extent is enough, because This is used as subsequent determination using the nasal area of above-mentioned facial image or eye areas as the target signature region in the application The zoning of fuzziness.
In this application, objective fuzzy degree is being determined according to the corresponding approximate gradient of each pixel, by objective fuzzy degree After the fuzziness of facial image, so that it may the quality of facial image is determined according to the image blur of facial image, to sentence The fixed facial image is if appropriate for image used in the recognition of face as next step.
In one embodiment, as shown in figure 3, in step S20, namely to each pixel in target signature region grayscale image Horizontal direction convolution algorithm and vertical direction convolution algorithm are carried out, to obtain the horizontal direction gradient and Vertical Square of each pixel To gradient, specifically comprise the following steps:
S21, the horizontal warp factor of Sobel and the vertical warp factor of Sobel are determined;
S22, level side is carried out according to pixel each in the horizontal convolution factor pair target signature region grayscale image of Sobel The horizontal direction gradient of each pixel is obtained to convolution algorithm, and according to the vertical warp factor of Sobel to target signature Each pixel carries out vertical direction convolution algorithm to obtain the vertical gradient of each pixel in area grayscale figure.
It should be noted that in addition to calculating above-mentioned target signature region grayscale image according to the horizontal warp factor of Sobel Horizontal direction gradient, and calculate according to the vertical warp factor of Sobel the vertical direction of above-mentioned target signature region grayscale image Outside gradient direction, as long as pass that is adjacent in target signature region grayscale image or being separated by color difference between several pixels can be calculated System, to calculate the horizontal direction gradient of the pixel of target signature region grayscale image or the warp factor of vertical gradient It is ok, illustratively, in application scenes, the warp factor of usable Roberts (Luo Baici) convolution operator, Warp factor, warp factor of Laplacian (Laplce Gauss) examination paper of Prewitt convolution operator etc., do not limit specifically It is fixed.It is appreciated that in the present embodiment, specifically using Sobel Operator namely the horizontal warp factor of Sobel and rope The vertical warp factor of Bell proposes the computational algorithm for carrying out horizontal direction gradient and vertical gradient, improves scheme Exploitativeness.It is noted that can determine depositing to pixel side in target signature region using Sobel convolution operator And pixel from secretly to bright, or the variation from bright to dark, therefore, the level calculated using Sobel convolution operator Direction gradient or vertical gradient can be very square the fog-level for reflecting target signature region grayscale image so that last calculate Objective fuzzy degree out can more reflect the Fuzzy Level of target signature region grayscale image, that is, make final facial image The judgement of fuzziness is more accurate, therefore, in this application, it is preferable to use Sobel convolution operator.
In one embodiment, the horizontal warp factor of Sobel is [- 1,0,1, -2,0,2, -1,0,1], and Sobel is vertically rolled up The product factor is [1,2,1,0,0,0, -1, -2, -1], namely:
The horizontal warp factor of the Sobel of Sobel convolution operator:
-1 0 +1
-2 0 +2
-1 0 +1
The vertical warp factor of the Sobel of Sobel convolution operator are as follows:
+1 +2 +1
0 0 0
-1 -2 -1
Alternatively,
The horizontal warp factor of Sobel is [- 0.5,0,0.5, -1.5,0,1.5, -0.5,0,0.5], the vertical convolution of Sobel The factor is [0.5,1.5,0.5,0,0,0, -0.5, -1.5, -0.5], namely:
The horizontal warp factor of the Sobel of Sobel convolution operator are as follows:
-0.5 0 -1.5
-1.5 0 1.5
-0.5 0 0.5
The vertical warp factor of the Sobel of Sobel convolution operator are as follows:
0.5 0 1.5
0 0 0
-0.5 -1.5 -0.5
It is understood that in the present embodiment, propose the horizontal convolution of Sobel of two kinds of specific Sobel convolution operators because Son warp factor vertical with Sobel, improves the exploitativeness of the application.Although but it should be recognized that above embodiment In warp factor size be 3*3 template, but in some embodiments of the present application, the horizontal warp factor of Sobel or rope shellfish You not also necessarily are 3*3 template at the size of vertical warp factor, illustratively, be also possible to 1*3 template, 2*4 template or Other sizes of person, such as the horizontal warp factor of Sobel or the vertical warp factor of Sobel of 1*2 template or 2*2 template, specifically Here without limitation.
In one embodiment, it as shown in figure 4, in step S30, namely according to the horizontal direction gradient of each pixel and hangs down Straight direction gradient determines the corresponding approximate gradient of each pixel, specifically comprises the following steps:
S31, determine each pixel horizontal direction gradient absolute value and vertical gradient absolute value;
S32, it determines between the absolute value of horizontal direction gradient of each pixel and the absolute value of vertical gradient With;
S33, by between the absolute value of horizontal direction gradient and the absolute value of vertical gradient of each pixel and As the corresponding approximate gradient of each pixel.
It is, in the present embodiment, proposing a kind of side for specifically determining the corresponding approximate gradient of each pixel Formula improves the exploitativeness of scheme, and above-mentioned calculating process, is described below by specific example in order to facilitate understanding, false If target signature region grayscale image is A, the horizontal warp factor of Sobel is Gx, and the vertical warp factor of Sobel is Gy, then target The horizontal direction gradient of characteristic area grayscale image all pixels point can be expressed as: GX=A*Gx, target signature region grayscale image institute Having the vertical gradient of pixel can be expressed as: GY=A*Gy, then all pixels point of target signature region grayscale image A is close It is indicated like the following formula of gradient:
G=| GX |+| GY |;
The corresponding approximate gradient of each pixel in target signature region grayscale image A namely can be obtained.
In one embodiment, it as shown in figure 5, in step S30, namely according to the horizontal direction gradient of each pixel and hangs down Straight direction gradient determines the corresponding approximate gradient of each pixel, specifically comprises the following steps:
S31`, the horizontal direction gradient of each pixel and the quadratic sum of vertical gradient are determined;
S32`, root of making even to the horizontal direction gradient of each pixel and the quadratic sum of vertical gradient;
S33`, using the square root of each pixel as the corresponding approximate gradient of each pixel.
It is, in the present embodiment, proposing another kind and specifically determining the corresponding approximate gradient of each pixel Mode, improves the exploitativeness of scheme, in order to make it easy to understand, being described below by specific example, it is assumed that target signature Area grayscale figure is A, and the horizontal warp factor of Sobel is Gx, and the vertical warp factor of Sobel is Gy, then target signature region ash The horizontal direction gradient for spending figure all pixels point is GX=A*Gx, the Vertical Square of target signature region grayscale image all pixels point It is GY=A*Gy to gradient, then the following formula of the approximate gradient of all pixels point of target signature region grayscale image A indicates:
The corresponding approximate gradient of each pixel in target signature region grayscale image A namely can be obtained.
It should be noted that being determined often in addition to above-mentioned according to the horizontal direction gradient and vertical gradient of each pixel Outside the mode of the corresponding approximate gradient of a pixel, there can also be other calculations, specifically without limitation, for example, by every The approximate gradient of the horizontal direction gradient of a pixel and the arithmetic mean of instantaneous value of vertical gradient as pixel, to target spy The calculation of each pixel takes the calculation of above-mentioned arithmetic mean of instantaneous value in sign area grayscale figure, to obtain each The corresponding approximate gradient of pixel.It is appreciated that horizontal direction gradient with specific reference to each pixel set forth above and hanging down Straight direction gradient determines the mode of the corresponding approximate gradient of each pixel, improves the exploitativeness of scheme.
In one embodiment, as shown in fig. 6, in step S40, target is determined according to the corresponding approximate gradient of each pixel Fuzziness specifically comprises the following steps;
S41, the sum of the corresponding degree of approximation of each pixel is determined;
S42, by the sum of corresponding degree of approximation of each pixel divided by target signature region grayscale image pixel sum, with Obtain objective fuzzy degree.
Here, a kind of mode that objective fuzzy degree is determined with specific reference to the corresponding approximate gradient of each pixel is proposed, Improve the exploitativeness of scheme.In addition, since the corresponding approximate gradient of each pixel has reacted face to a certain extent Therefore the fuzziness of image determines that the fuzziness of facial image can be used for judging according to the corresponding approximate gradient of each pixel The fog-level of facial image, one of the reference as quality of human face image.
In one embodiment, as shown in fig. 7, before step S40, mesh is determined according to the corresponding approximate gradient of each pixel Before marking fuzziness, method further includes following steps: calculating the brightness value of all pixels point in the facial image;Described in calculating The corresponding natural logrithm of brightness value of all pixels point in facial image;It is corresponding to the brightness value of all pixels point in facial image Natural logrithm average;Right index value is derived to obtain the average brightness of the facial image to the average value.Specifically Shown in following formula: assuming that each brightness value is indicated with l (x) in facial image, then the average brightness of the facial image can be by Following formula is calculated:Wherein, δ is preset value, can be 0.0001, tool Body is without limitation.
In step S40, namely objective fuzzy degree determined according to the corresponding approximate gradient of each pixel, specifically included as follows Step;
S41`, determine that the target for being greater than the average brightness of facial image in the corresponding approximate gradient of each pixel is approximate Degree;
S42`, by the sum of target degree of approximation divided by target signature region grayscale image pixel sum, to obtain target mould Paste degree.
In the present embodiment, before determining objective fuzzy degree according to the corresponding approximate gradient of each pixel, people is also utilized The average brightness of face image has comprehensively considered the brightness and approximate gradient of facial image, can further improve face as threshold value The accuracy for the fuzziness that image is determined.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present application constitutes any limit It is fixed.
In one embodiment, a kind of image blur determining device is provided, the image blur determining device and above-mentioned reality It applies image blur in example and determines that method corresponds.As shown in figure 8, the image blur determining device 80 includes obtaining module 801, cutting and gradation processing module 802, computing module 803, the first determining module 804 and the second determining module 805.Each function Detailed description are as follows for module:
Module 801 is obtained, for obtaining facial image;
It cuts and gradation processing module 802, the facial image for obtaining to acquisition module 801 carries out at cutting and gray scale For reason to obtain target signature region grayscale image, target signature region grayscale image is the corresponding ash of target signature region of facial image Degree figure;
Computing module 803, in the target signature region grayscale image to cutting and the acquisition of gradation processing module 802 Each pixel carries out horizontal direction convolution algorithm and vertical direction convolution algorithm, to obtain the level side of each pixel To gradient and vertical gradient;
First determining module 804, the level of each pixel for being calculated according to the computing module 803 Direction gradient and vertical gradient determine the corresponding approximate gradient of each pixel;
Second determining module 805, each pixel for being determined according to first determining module 804 are corresponding Approximate gradient determines objective fuzzy degree, using the objective fuzzy degree as the fuzziness of the facial image.
In one embodiment, computing module 803 is specifically used for:
Determine the horizontal warp factor of Sobel and the vertical warp factor of Sobel;
Horizontal direction volume is carried out according to pixel each in the horizontal convolution factor pair target signature region grayscale image of Sobel Operation is accumulated to obtain the horizontal direction gradient of each pixel, and according to the vertical warp factor of Sobel to target signature region Each pixel carries out vertical direction convolution algorithm to obtain the vertical gradient of each pixel in grayscale image.
In one embodiment,
The horizontal warp factor of Sobel be [- 1,0,1, -2,0,2, -1,0,1], the vertical warp factor of Sobel be [1,2, 1,0,0,0, -1, -2, -1];Namely:
The horizontal warp factor of Sobel:
-1 0 +1
-2 0 +2
-1 0 +1
The vertical warp factor of the Sobel of Sobel convolution operator are as follows:
+1 +2 +1
0 0 0
-1 -2 -1
Alternatively,
The horizontal warp factor of Sobel is [- 0.5,0,0.5, -1.5,0,1.5, -0.5,0,0.5], the vertical convolution of Sobel The factor is [0.5,1.5,0.5,0,0,0, -0.5, -1.5, -0.5], namely:
The horizontal warp factor of the Sobel of Sobel convolution operator are as follows:
The vertical warp factor of the Sobel of Sobel convolution operator are as follows:
0.5 0 1.5
0 0 0
-0.5 -1.5 -0.5
In one embodiment, the first determining module 804, is specifically used for:
Determine the absolute value of the horizontal direction gradient of each pixel and the absolute value of vertical gradient;
Determine it is between the absolute value of horizontal direction gradient of each pixel and the absolute value of vertical gradient and;
By between the absolute value of horizontal direction gradient and the absolute value of vertical gradient of each pixel and conduct The corresponding approximate gradient of each pixel.
In one embodiment, the first determining module 804, is specifically used for:
Determine the horizontal direction gradient of each pixel and the quadratic sum of vertical gradient;
The quadratic sum of horizontal direction gradient and vertical gradient to each pixel is made even root;
Using the square root of each pixel as the corresponding approximate gradient of each pixel.
In one embodiment, the second determining module 805, is specifically used for;
Determine the sum of corresponding degree of approximation of each pixel;
By the sum of corresponding degree of approximation of each pixel divided by the pixel sum of target signature region grayscale image, to obtain Objective fuzzy degree.
In one embodiment, the second determining module 805, is specifically used for:
Before determining objective fuzzy degree according to the corresponding approximate gradient of each pixel, calculates in the facial image and own The brightness value of pixel;Calculate the corresponding natural logrithm of brightness value of all pixels point in the facial image;To facial image The corresponding natural logrithm of brightness value of middle all pixels point is averaged;It is described to obtain to be derived from right index value to the average value The average brightness of facial image;
It determines in the corresponding approximate gradient of each pixel greater than the target degree of approximation of the average brightness of facial image;
By the sum of target degree of approximation divided by the pixel sum of target signature region grayscale image, to obtain objective fuzzy degree.
Thus, present applicant proposes a kind of image blur determining device, the fuzziness for facial image into It is no longer to be judged based on whole facial image, but obtain target signature region from facial image and determine when row determines The fuzziness of facial image, due to not being to take bulky opencv, can also reduce use while reducing calculation amount The burden of the terminal device of the application effectively improves the judging efficiency of facial image fuzziness.
Specific restriction about image blur determining device may refer to determine method above for image blur Restriction, details are not described herein.Modules in above-mentioned image blur determining device can be fully or partially through software, hard Part and combinations thereof is realized.Above-mentioned each module can be embedded in the form of hardware or independently of in the processor in computer equipment, It can also be stored in a software form in the memory in computer equipment, execute the above modules in order to which processor calls Corresponding operation.
In one embodiment, a kind of computer equipment is provided, which can be terminal, internal structure Figure can be as shown in Figure 9.The computer equipment includes processor, the memory, network interface, display connected by system bus Screen and input unit.Wherein, the processor of the computer equipment is for providing calculating and control ability.The computer equipment is deposited Reservoir includes non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system and computer journey Sequence.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating To realize that a kind of image blur determines method when machine program is executed by processor.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory And the computer program that can be run on a processor, processor perform the steps of when executing computer program
Obtain facial image;
Facial image cut and gray proces are to obtain target signature region grayscale image, target signature region gray scale Figure is the corresponding grayscale image of target signature region of facial image;
Horizontal direction convolution algorithm and vertical direction convolution fortune are carried out to pixel each in target signature region grayscale image It calculates, to obtain the horizontal direction gradient and vertical gradient of each pixel;
The corresponding approximate ladder of each pixel is determined according to the horizontal direction gradient and vertical gradient of each pixel Degree;
Objective fuzzy degree is determined according to the corresponding approximate gradient of each pixel, using objective fuzzy degree as facial image Fuzziness.
Thus, present applicant proposes a kind of computer equipment, when the fuzziness for facial image is determined, It is no longer to be judged based on whole facial image, but obtain target signature region from facial image and determine facial image Fuzziness, due to not being to take bulky opencv, can also reduce the end using the application while reducing calculation amount The burden of end equipment effectively improves the judging efficiency of facial image fuzziness, it is further to note that the application provides Computer equipment in, the step of realizing or function can be corresponded to refering to preceding method embodiment when processor executes computer program In description, do not repeat to repeat here.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of when being executed by processor
Obtain facial image;
Facial image cut and gray proces are to obtain target signature region grayscale image, target signature region gray scale Figure is the corresponding grayscale image of target signature region of facial image;
Horizontal direction convolution algorithm and vertical direction convolution fortune are carried out to pixel each in target signature region grayscale image It calculates, to obtain the horizontal direction gradient and vertical gradient of each pixel;
The corresponding approximate ladder of each pixel is determined according to the horizontal direction gradient and vertical gradient of each pixel Degree;
Objective fuzzy degree is determined according to the corresponding approximate gradient of each pixel, using objective fuzzy degree as facial image Fuzziness.
Thus, present applicant proposes a kind of computer readable storage medium, the fuzziness for facial image into It is no longer to be judged based on whole facial image, but obtain target signature region from facial image and determine when row determines The fuzziness of facial image, due to not being to take bulky opencv, can also reduce use while reducing calculation amount The burden of the terminal device of the application effectively improves the judging efficiency of facial image fuzziness, it is further to note that In computer readable storage medium provided by the present application, the step of computer program is realized when being executed by processor or function, It can correspond to refering to the description in preceding method embodiment, not repeat to repeat here.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.
Embodiment described above is only to illustrate the technical solution of the application, rather than its limitations;Although referring to aforementioned reality Example is applied the application is described in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope of each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution should all Comprising within the scope of protection of this application.

Claims (10)

1. a kind of image blur determines method characterized by comprising
Obtain facial image;
The facial image cut and gray proces are to obtain target signature region grayscale image, the target signature region Grayscale image is the corresponding grayscale image of target signature region of the facial image;
Horizontal direction convolution algorithm and vertical direction convolution fortune are carried out to pixel each in the target signature region grayscale image It calculates, to obtain the horizontal direction gradient and vertical gradient of each pixel;
Determine that each pixel is corresponding close according to the horizontal direction gradient of each pixel and vertical gradient Like gradient;
Objective fuzzy degree is determined according to the corresponding approximate gradient of each pixel, using the objective fuzzy degree as the people The fuzziness of face image.
2. image blur as described in claim 1 determines method, which is characterized in that described to the target signature region ash It spends each pixel in figure and carries out horizontal direction convolution algorithm and vertical direction convolution algorithm, to obtain each pixel Horizontal direction gradient and vertical gradient, comprising:
Determine the horizontal warp factor of Sobel and the vertical warp factor of Sobel;
Each pixel according to target signature region grayscale image described in the horizontal convolution factor pair of the Sobel carries out water Square obtain the horizontal direction gradient of each pixel to convolution algorithm, and according to the vertical convolution of the Sobel because It is described each to obtain that son carries out vertical direction convolution algorithm to each pixel described in the target signature region grayscale image The vertical gradient of pixel.
3. image blur as claimed in claim 2 determines method, which is characterized in that
The horizontal warp factor of Sobel is [- 1,0,1, -2,0,2, -1,0,1], and the vertical warp factor of the Sobel is [1,2,1,0,0,0, -1, -2, -1];
Or,
The horizontal warp factor of Sobel is [- 0.5,0,0.5, -1.5,0,1.5, -0.5,0,0.5], and the Sobel is vertical Warp factor is [0.5,1.5,0.5,0,0,0, -0.5, -1.5, -0.5].
4. image blur as claimed in claim 3 determines method, which is characterized in that described according to each pixel Horizontal direction gradient and vertical gradient determine the corresponding approximate gradient of each pixel, comprising:
Determine the absolute value of the horizontal direction gradient of each pixel and the absolute value of vertical gradient;
Determine it is between the absolute value of horizontal direction gradient and the absolute value of vertical gradient of each pixel and;
By between the absolute value of horizontal direction gradient and the absolute value of vertical gradient of each pixel and conduct The corresponding approximate gradient of each pixel.
5. image blur as claimed in claim 3 determines method, which is characterized in that described according to each pixel Horizontal direction gradient and vertical gradient determine the corresponding approximate gradient of each pixel, comprising:
Determine the horizontal direction gradient of each pixel and the quadratic sum of vertical gradient;
The quadratic sum of horizontal direction gradient and vertical gradient to each pixel is made even root;
Using the square root of each pixel as the corresponding approximate gradient of each pixel.
6. image blur as described in claim 1 determines method, which is characterized in that described according to each pixel pair The approximate gradient answered determines objective fuzzy degree, including;
Determine the sum of corresponding degree of approximation of each pixel;
By the sum of corresponding degree of approximation of each pixel divided by the pixel sum of the target signature region grayscale image, with Obtain the objective fuzzy degree.
7. image blur as described in claim 1 determines method, which is characterized in that described according to each pixel pair Before the approximate gradient answered determines objective fuzzy degree, the method also includes:
Calculate the brightness value of all pixels point in the facial image;
Calculate the corresponding natural logrithm of brightness value of all pixels point in the facial image;
It averages to the corresponding natural logrithm of brightness value of all pixels point in facial image;
Right index value is derived to obtain the average brightness of the facial image to the average value;
It is described that objective fuzzy degree is determined according to the corresponding approximate gradient of each pixel, including;
It determines approximate greater than the target of the average brightness of the facial image in the corresponding approximate gradient of each pixel Degree;
By the sum of described target degree of approximation divided by the pixel sum of the target signature region grayscale image, to obtain the target Fuzziness.
8. a kind of image blur determining device characterized by comprising
Module is obtained, for obtaining facial image;
It cuts and gradation processing module, the facial image for obtaining to the acquisition module carries out cutting and gray proces To obtain target signature region grayscale image, the target signature region grayscale image is the target signature region pair of the facial image The grayscale image answered;
Computing module, for every in the cutting and the target signature region grayscale image that handles of gradation processing module A pixel carries out horizontal direction convolution algorithm and vertical direction convolution algorithm, to obtain the horizontal direction of each pixel Gradient and vertical gradient;
First determining module, the horizontal direction gradient of each pixel for being calculated according to the computing module and Vertical gradient determines the corresponding approximate gradient of each pixel;
Second determining module, the corresponding approximate gradient of each pixel for being determined according to first determining module are true Set the goal fuzziness, using the objective fuzzy degree as the fuzziness of the facial image.
9. a kind of computer equipment, including memory, processor and storage are in the memory and can be in the processor The computer program of upper operation, which is characterized in that the processor realized when executing the computer program as claim 1 to The step of any one of 7 described image fuzzinesses determine method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In any one of such as claim 1 to 7 of realization described image fuzziness determines method when the computer program is executed by processor The step of.
CN201811073282.2A 2018-09-14 Image ambiguity determining method, apparatus, computer device and storage medium Active CN109447942B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811073282.2A CN109447942B (en) 2018-09-14 Image ambiguity determining method, apparatus, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811073282.2A CN109447942B (en) 2018-09-14 Image ambiguity determining method, apparatus, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN109447942A true CN109447942A (en) 2019-03-08
CN109447942B CN109447942B (en) 2024-04-23

Family

ID=

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032964A (en) * 2019-04-08 2019-07-19 腾讯科技(成都)有限公司 Image processing method, method, apparatus, equipment and the storage medium for identifying visual angle
CN113592720A (en) * 2021-09-26 2021-11-02 腾讯科技(深圳)有限公司 Image scaling processing method, device, equipment, storage medium and program product
WO2022042131A1 (en) * 2020-08-28 2022-03-03 稿定(厦门)科技有限公司 Adaptive halo image generation method and apparatus based on particles

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012073703A (en) * 2010-09-28 2012-04-12 Nippon Hoso Kyokai <Nhk> Image blur amount calculation device and program for the same
CN103269439A (en) * 2013-05-21 2013-08-28 杭州电子科技大学 OCT image quality objective non-reference type evaluation method
CN103353985A (en) * 2013-03-27 2013-10-16 西华大学 Measurement method for image Gaussian Blur
CN105488511A (en) * 2015-11-25 2016-04-13 小米科技有限责任公司 Image identification method and device
CN105894506A (en) * 2016-03-30 2016-08-24 深圳云天励飞技术有限公司 Face image fuzziness computing method and device
CN107580209A (en) * 2017-10-24 2018-01-12 维沃移动通信有限公司 Take pictures imaging method and the device of a kind of mobile terminal
CN107767358A (en) * 2016-08-23 2018-03-06 阿里巴巴集团控股有限公司 A kind of objects in images fuzziness determines method and apparatus
CN108234882A (en) * 2018-02-11 2018-06-29 维沃移动通信有限公司 A kind of image weakening method and mobile terminal

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012073703A (en) * 2010-09-28 2012-04-12 Nippon Hoso Kyokai <Nhk> Image blur amount calculation device and program for the same
CN103353985A (en) * 2013-03-27 2013-10-16 西华大学 Measurement method for image Gaussian Blur
CN103269439A (en) * 2013-05-21 2013-08-28 杭州电子科技大学 OCT image quality objective non-reference type evaluation method
CN105488511A (en) * 2015-11-25 2016-04-13 小米科技有限责任公司 Image identification method and device
CN105894506A (en) * 2016-03-30 2016-08-24 深圳云天励飞技术有限公司 Face image fuzziness computing method and device
CN107767358A (en) * 2016-08-23 2018-03-06 阿里巴巴集团控股有限公司 A kind of objects in images fuzziness determines method and apparatus
CN107580209A (en) * 2017-10-24 2018-01-12 维沃移动通信有限公司 Take pictures imaging method and the device of a kind of mobile terminal
CN108234882A (en) * 2018-02-11 2018-06-29 维沃移动通信有限公司 A kind of image weakening method and mobile terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
路晓亚 等: "模糊生物图像特征优化提取仿真研究", 计算机仿真, no. 05 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032964A (en) * 2019-04-08 2019-07-19 腾讯科技(成都)有限公司 Image processing method, method, apparatus, equipment and the storage medium for identifying visual angle
CN110032964B (en) * 2019-04-08 2023-07-14 腾讯科技(成都)有限公司 Image processing method, device, equipment and storage medium for identifying visual angle
WO2022042131A1 (en) * 2020-08-28 2022-03-03 稿定(厦门)科技有限公司 Adaptive halo image generation method and apparatus based on particles
CN113592720A (en) * 2021-09-26 2021-11-02 腾讯科技(深圳)有限公司 Image scaling processing method, device, equipment, storage medium and program product

Similar Documents

Publication Publication Date Title
CN110826519B (en) Face shielding detection method and device, computer equipment and storage medium
US10963993B2 (en) Image noise intensity estimation method, image noise intensity estimation device, and image recognition device
CN111741211B (en) Image display method and apparatus
CN105917353B (en) Feature extraction and matching for biological identification and template renewal
CN106803067B (en) Method and device for evaluating quality of face image
CN103914676B (en) A kind of method and apparatus used in recognition of face
CN111274916B (en) Face recognition method and face recognition device
CN108428214B (en) Image processing method and device
JP4692856B2 (en) Method and apparatus for model-based anisotropic diffusion
WO2014168587A1 (en) Method and system for processing an input image
CN103902958A (en) Method for face recognition
Kumar Deblurring of motion blurred images using histogram of oriented gradients and geometric moments
CN110147708B (en) Image data processing method and related device
CN110458792B (en) Method and device for evaluating quality of face image
CN111079764A (en) Low-illumination license plate image recognition method and device based on deep learning
CN109508636A (en) Vehicle attribute recognition methods, device, storage medium and electronic equipment
WO2019061659A1 (en) Method and device for removing eyeglasses from facial image, and storage medium
CN107256543A (en) Image processing method, device, electronic equipment and storage medium
CN111222433A (en) Automatic face auditing method, system, equipment and readable storage medium
CN113592776A (en) Image processing method and device, electronic device and storage medium
CN110837781B (en) Face recognition method, face recognition device and electronic equipment
CN113096023A (en) Neural network training method, image processing method and device, and storage medium
CN111274851A (en) Living body detection method and device
Fathy et al. Benchmarking of pre-processing methods employed in facial image analysis
Han et al. Locally adaptive contrast enhancement using convolutional neural network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant