Disclosure of Invention
The invention provides a processing method and device for removing a grid watermark from a certificate photo, and a face verification method and device, which aim to solve the technical problems of low recognition rate and poor user experience due to the fact that the grid watermark is added to the certificate photo in the existing certificate and certificate integrated verification.
the technical scheme adopted by the invention is as follows:
According to one aspect of the invention, a processing method for removing a grid watermark from a certificate photo is provided, and the processing method comprises the following steps:
acquiring a certificate photo to be subjected to face identification authentication, wherein a fixed grid watermark covers a face on the certificate photo;
Acquiring a fixed grid watermark template, wherein the fixed grid watermark template is generated by a watermark analysis image processing algorithm based on a plurality of certificate photos with fixed grid watermarks;
and removing the fixed grid watermark from the certificate photo to be subjected to face identification and authentication through the fixed grid watermark template, and restoring the face information of the original certificate photo.
further, in the present invention, the fixed grid watermark includes a fixed grid watermark line for anti-counterfeiting and a character line for identification, and the generation of the fixed grid watermark template includes:
after pixels of a plurality of identification photos with fixed grid watermarks are superposed, averaging is carried out to generate an average fixed grid photo;
manually drawing fixed grid watermark lines and character lines on the average fixed grid photo respectively to generate a first average fixed grid template drawing and a second average fixed grid template drawing;
combining the first average fixed grid template drawing and the second average fixed grid template drawing to generate a full watermark average fixed grid template drawing;
And extracting a fixed grid watermark binarization template from the full watermark average fixed grid template picture.
Further, the step of removing the fixed grid watermark from the certificate photo to be subjected to the face recognition authentication through the fixed grid watermark template adopts a median filtering method to remove the fixed grid watermark information on the certificate photo.
further, the processing method of the invention also comprises the following steps:
And sharpening the certificate photo subjected to the median filtering by adopting a weighted average difference method to obtain the certificate photo without the fixed grid watermark information.
according to another aspect of the present invention, a face verification method is further provided, where the face verification method includes:
the face information of the original certificate photo is restored by adopting the processing method;
acquiring actual face image information on site;
And carrying out face verification and judging whether the testimonies are uniform or not.
according to another aspect of the present invention, there is also provided a processing apparatus for removing a grid watermark from a certificate photo, including:
The first acquisition unit is used for acquiring a certificate photo to be subjected to face identification authentication, and a fixed grid watermark covers a face on the certificate photo;
The second acquisition unit is used for acquiring a fixed grid watermark template, and the fixed grid watermark template is generated by a watermark analysis image processing algorithm based on a plurality of certificate photos with fixed grid watermarks;
And the grid watermark removing unit is used for removing the fixed grid watermark from the certificate photo to be subjected to the face identification authentication through the fixed grid watermark template, and restoring the face information of the original certificate photo.
furthermore, in the present invention, the fixed grid watermark includes a fixed grid watermark line for anti-counterfeiting and a character line for identification, the processing device further includes a generating unit for generating a fixed grid watermark template, the generating unit includes:
The first generation module is used for averaging the superposed pixels of a plurality of identification photos with fixed grid watermarks to generate an average fixed grid photo;
the second generation module is used for manually drawing the fixed grid watermark lines and the character lines on the average fixed grid photo respectively to generate a first average fixed grid template drawing and a second average fixed grid template drawing;
a third generating module, configured to combine the first average fixed grid template drawing and the second average fixed grid template drawing to generate a full watermark average fixed grid template drawing;
And the fourth generation module is used for extracting the fixed grid watermark binaryzation template from the full-watermark average fixed grid template graph.
Furthermore, the grid watermark removing unit removes the fixed grid watermark information on the certificate photo by adopting a median filtering method.
Further, the processing apparatus further comprises: and the sharpening processing unit is used for sharpening the certificate photo subjected to the median filtering processing by adopting a weighted average difference method to obtain the certificate photo without the fixed grid watermark information.
according to another aspect of the present invention, there is also provided a face authentication apparatus, including: the processing device is adopted to restore the face information of the original certificate photo; further comprising:
the face image acquisition unit is used for acquiring the actual face image information on site;
and the face authentication unit is used for carrying out face verification and judging whether the testimonies are uniform or not.
The invention has the following beneficial effects:
according to the processing method and device for removing the grid watermark from the certificate photo, the certificate photo with the fixed grid watermark and the fixed grid watermark template are obtained, and the fixed grid watermark is removed from the certificate photo through the fixed grid watermark template.
the face verification method and the face verification device receive the certificate photo with the grid watermark through the network, remove the grid watermark from the certificate photo, verify the face image of the original certificate photo after the grid watermark is removed and the acquired face image information to judge whether the face photo is unified, improve the intelligent level of identity authentication during network end registration, avoid the defects of low verification efficiency and high operation cost caused by traditional manual verification, and improve the accuracy and reliability of verification compared with manual verification.
In addition to the objects, features and advantages described above, other objects, features and advantages of the present invention are also provided. The present invention will be described in further detail below with reference to the accompanying drawings.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
the preferred embodiment of the present invention provides a processing method for removing a grid watermark from a certificate photo, and referring to fig. 2, the processing method of the present embodiment includes:
Step S100, obtaining a certificate photo to be subjected to face identification and authentication, wherein a fixed grid watermark covers a face on the certificate photo;
In this embodiment, the certificate photo is a certificate photo stored in the public security system and added with a grid watermark, such as an identity card face photo, and received by a server at the security industry end through a network.
Step S200, acquiring a fixed grid watermark template, wherein the fixed grid watermark template is generated by a watermark analysis image processing algorithm based on a plurality of certificate photos with fixed grid watermarks;
the fixed grid watermark template of the embodiment may be generated in advance and stored at a local end or a network server end.
and step S300, removing the fixed grid watermark from the certificate photo to be subjected to face identification and authentication through the fixed grid watermark template, and restoring the face information of the original certificate photo.
In the embodiment, the certificate photo with the fixed grid watermark and the fixed grid watermark template are obtained, and the fixed grid watermark is removed from the certificate photo through the fixed grid watermark template, so that compared with the traditional deep learning method for removing the grid watermark, the method has the advantages of high processing efficiency and short consumed time, watermark information is removed more thoroughly, and the reliability of follow-up face authentication is improved.
referring to fig. 1, in the present embodiment, the fixed grid watermark includes a fixed grid watermark line for anti-counterfeiting and a character line for identification (as "securities industry dedicated" shown in fig. 1), and referring to fig. 3, the generating of the fixed grid watermark template in the present embodiment includes:
Step S401, after overlapping pixels of a plurality of identification photos with fixed grid watermarks, averaging to generate an average fixed grid photo;
The average fixed grid photo is generated by the method of averaging after the pixels of the massive fixed grid watermark photos are overlapped, wherein Pm is (P1+ P2+ … … + Pn)/n, as shown in fig. 4.
Step S402, manually drawing fixed grid watermark lines and character lines on the average fixed grid photo to generate a first average fixed grid template drawing and a second average fixed grid template drawing respectively;
In this embodiment, the image processing software (Photoshop) is used to manually draw the fixed grid watermark lines and the lines of the "securities industry dedicated" characters, so as to obtain the first and second average fixed grid template maps (see fig. 5a and 5 b).
step S403, combining the first average fixed grid template drawing and the second average fixed grid template drawing to generate a full watermark average fixed grid template drawing;
The two manually outlined average fixed grid template maps are merged to generate the full watermark average fixed grid template map, where P ═ P1+ P2)/2, see fig. 5 c.
and step S404, extracting a fixed grid watermark binarization template from the full watermark average fixed grid template map.
In this embodiment, when manual drawing is performed, a red line is used to draw a fixed grid watermark line and a character line in Photoshop, and the red line part in the image is subjected to binarization processing and is separately extracted, and a pixel with a pixel value of 255 in an R (red channel) channel in an RGB image is used as a 1 in the binarized image, and other parts are represented by 0, so as to generate the fixed grid watermark binarized template shown in fig. 5 d.
In this embodiment, the fixed grid watermark binarization template shown in fig. 5d is obtained by binarization extraction from the full watermark fixed grid template graph shown in fig. 5c, and firstly, on the basis of not changing watermark template watermark information, the size of the template image is reduced, for example, from 39KB to 7KB, so that subsequent storage and reading are facilitated, and the data processing efficiency is improved. Since the watermark template is generated in advance, the image of the watermark template is either stored in a local hard disk (when the image is needed, the image is read from the local hard disk, the smaller the template is, the faster the reading speed is, and the shorter the processing time is), or the information of the image of the watermark template is written into a code (which is equivalent to reading in advance into a memory, the smaller the template is, and the less memory resources are occupied). In addition, when a photo with a fixed grid watermark is processed by relying on a watermark template image, the embodiment does not need to perform a step of decomposing an R channel (a red channel) with a pixel value of 255 in RGB three channels in a color watermark template image in the process of removing the grid watermark by using binarized template information (a white region is 1, and a black region is 0), so that a step is omitted, and the processing efficiency is further improved in the process of removing the grid watermark.
preferably, in this embodiment, the step of performing fixed grid watermark removal processing on the identification photo to be subjected to face recognition authentication by using the fixed grid watermark template removes the fixed grid watermark information on the identification photo by using a median filtering method.
In this embodiment, considering that the watermark information of the fixed grid is image information that has approximately equal amplitude but is randomly distributed at different positions, clean points (people in the background) and dirty points (noise points, watermark information) exist in the image in the watermark photo of the fixed grid, and a median filtering method is preferentially selected for the characteristics of such noise. The median filter (mediafilter) is an image processing algorithm for nonlinear smoothing processing, in which the gray values of pixels in a sliding window are sorted, and the original gray value of the central pixel of the window is replaced by the median filter, and this embodiment introduces a median filtering method to perform fixed-grid photo filtering processing to remove fixed-grid watermark information. The median filtering method specifically comprises the following steps: when filtering a digital signal sequence xj (— infinity < j < ∞), an L-length window with an odd length is defined, where L is 2N +1 and N is a positive integer. At a certain time, the signal samples in the window are x (i-N), …, x (i), …, x (i + N), where x (i) is the signal sample value at the center of the window. The L signal sample values are arranged in descending order, wherein the value, i.e. the sample value at i, is defined as the output value of the median filtering. After the template for fixing the binarization of the grid watermark information is read, median filtering processing of 9x9 size is performed on the watermark part (pixel value is 1) of the certificate photo. The median filtering processing method can optimize and restore the information of the face part of the original certificate photo, and has high processing efficiency compared with the traditional deep learning method. The method is very effective in smoothing impulse noise, has a good effect of inhibiting impulse interference level salt-pepper noise, can protect sharp edges of images, selects proper points to replace values of pollution points, and can effectively protect the edges from being blurred (character information in the background is protected as much as possible) while inhibiting random noise. Therefore, the processing effect is good, and the accuracy of the restored face information is high.
preferably, the processing method of this embodiment further includes:
And sharpening the certificate photo subjected to the median filtering by adopting a weighted average difference method to obtain the certificate photo without the fixed grid watermark information.
In order to avoid the defects of image edge and image contour blurring of the identification photo image, in this embodiment, a Sobel operator method (weighted average difference method) is preferably adopted to sharpen the image, where the Sobel operator is a typical edge detection operator of a first derivative, and because an operation similar to local average is introduced into the Sobel operator, the Sobel operator has a smoothing effect on noise, can well eliminate the influence of the noise, and finally obtain a standard identification photo with fixed grid watermark information removed, as shown in fig. 6.
according to another aspect of the present invention, a face verification method is further provided, where the face verification method of this embodiment includes:
The processing method of the embodiment is adopted to restore the face information of the original certificate photo; from the above analysis, it can be seen that the standard certificate photo with fixed grid watermark removed can be obtained by the processing method.
acquiring actual face image information on site;
In this embodiment, preferably, the face image information of the online user is acquired through a network, for example, when the user registers a security account online, the registered security website is accessed through a client at his or her side, and a face image collected by a camera at the client is uploaded online, and the security server receives actual face image information and a standard certificate photo from which a fixed grid watermark is removed.
and carrying out face verification and judging whether the testimonies are uniform or not.
and judging whether the user who is registered on line is the user who is in the same with the certificate photo by adopting a face verification method, thereby ensuring the correctness of the identity of the user. The face verification method of the present embodiment may adopt an existing mature feature comparison determination method, which is not described herein again.
according to another aspect of the present invention, there is further provided a processing apparatus for removing a grid watermark from a certificate photo, where the processing apparatus of this embodiment corresponds to the processing method described above, and with reference to fig. 7, the processing apparatus includes:
The first acquisition unit 100 is configured to acquire a certificate photo to be subjected to face identification authentication, where a face on the certificate photo is covered with a fixed grid watermark;
a second obtaining unit 200, configured to obtain a fixed-grid watermark template, where the fixed-grid watermark template is generated by a watermark analysis image processing algorithm based on a plurality of identification photos with fixed-grid watermarks;
The grid watermark removing unit 300 is configured to remove the fixed grid watermark from the identification photo to be subjected to the face identification authentication through the fixed grid watermark template, and restore the face information of the original identification photo.
in the present invention, the fixed grid watermark includes a fixed grid watermark line for anti-counterfeiting and a character line for identification, referring to fig. 8, the processing apparatus of this embodiment further includes a generating unit 400 for generating a fixed grid watermark template, preferably, referring to fig. 9, the generating unit 400 of this embodiment includes:
A first generation module 401, configured to average the multiple pixels of the identification photo with the fixed grid watermark after being superimposed to generate an average fixed grid photo;
A second generating module 402, configured to manually trace the fixed-grid watermark lines and the character lines on the average fixed-grid photo respectively to generate a first average fixed-grid template drawing and a second average fixed-grid template drawing;
a third generating module 403, configured to combine the first average fixed grid template drawing and the second average fixed grid template drawing to generate a full watermark average fixed grid template drawing;
a fourth generating module 404, configured to extract a fixed grid watermark binarization template from the full-watermark average fixed grid template map.
The process of generating the fixed grid watermark binarization template by the generating unit 400 in this embodiment may specifically refer to the above method embodiments, and is not described herein again.
preferably, the grid watermark removing unit removes the fixed grid watermark information on the identification photo by adopting a median filtering method.
preferably, the processing apparatus of this embodiment further includes: and the sharpening processing unit 500 is configured to sharpen the certificate photo after the median filtering processing by using a weighted average difference method, so that the influence of noise can be well eliminated, and finally, the standard certificate photo without the fixed grid watermark information is obtained.
according to another aspect of the present invention, there is also provided a face authentication apparatus, referring to fig. 10, including: restoring the face information of the original certificate photo by using the processing device 10; further comprising:
a face image obtaining unit 20, configured to obtain actual face image information in the field;
and the face authentication unit 30 is used for performing face verification and judging whether the testimonies are unified.
As can be known from the above description, in the embodiment, by acquiring the certificate photo with the fixed grid watermark and the fixed grid watermark template, and removing the fixed grid watermark from the certificate photo through the fixed grid watermark template, compared with the conventional deep learning method for removing the grid watermark, the method has the advantages of high processing efficiency and short time consumption, and the watermark information is removed more thoroughly, so that the reliability of the subsequent face authentication is improved. The method and the device for verifying the face of the certificate photo with the grid watermark have the advantages that the network receives the certificate photo with the grid watermark, the grid watermark is removed from the certificate photo, the face image of the original certificate photo with the grid watermark removed and the acquired face image information are verified, whether the face image is unified or not is judged, the intelligent level of identity authentication during registration at a network end is improved, the defects of low verification efficiency and high operation cost caused by traditional manual verification are overcome, and compared with manual verification, the accuracy and the reliability of verification are improved.
it should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
it will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and they may alternatively be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, or fabricated separately as individual integrated circuit modules, or fabricated as a single integrated circuit module from multiple modules or steps. Thus, the present invention is not limited to any specific combination of hardware and software.
the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.