Living body detection anti-tampering face photographing method and photographing device
By presetting the random position distribution of human phase profiles in the photo equipment and real-time live detection, combined with post-event watermark comparison verification, the problem that traditional photography methods cannot effectively deal with multi-person scenes and prevent photo tampering is solved, and the security and credibility of photos are improved.
Patent Information
- Application Number
- CN202510092045.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-06
AI Technical Summary
The traditional anti-tamper live-action detection and photography method cannot effectively handle multiple scenes at the same time, and cannot effectively prevent the tampering of the photos during the subsequent processing, resulting in the authenticity and credibility of the photos being questioned.
Through the random position distribution of the preset human phase profile and real-time live detection, combined with the real-time detection of secondary tamper-proof and watermark comparison verification, the technical means formed are ensured to ensure the authenticity and integrity of the photos taken.
It improves the security and tamper-proof ability of photos, ensures the authenticity and integrity of photos taken, and provides strong technical guarantees for various occasions where photo verification is required.
Smart Images

Figure CN119946415A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of face recognition, and in particular to a method and device for photographing a face for liveness detection and tamper-proofing. Background Art
[0002] With the development of the Internet, online fraud is increasing. In order to prevent identity forgery, it is necessary to take photos of people's faces for evidence. However, the traditional anti-tampering liveness detection photo method generally uses a combination of actions such as blinking, opening the mouth, shaking the head, and nodding, using face key point positioning and face tracking technologies to verify whether the user is the real live person, so as to effectively resist common attack methods such as photos, videos, face swapping, masks, 3D animations, and screen reshoots, thereby helping users identify fraudulent behavior and protect their interests.
[0003] However, this traditional photography method can usually only be performed on a single person, and cannot effectively handle multi-person scenes at the same time, and cannot effectively prevent the photos from being tampered with during subsequent processing. It has certain limitations, which leads to doubts about the authenticity and credibility of the photos.
[0004] Therefore, it is urgent for researchers in this field to provide a technical solution that can solve at least one of the above problems. Summary of the invention
[0005] In view of this, in order to solve the above-mentioned problems, the embodiments of the present invention provide a liveness detection and tamper-proof face photography method and a photography device, which ensures the authenticity and integrity of the taken photos, improves the security and tamper-proof ability of the photos, and solves the technical problems in the related technologies that face photography for evidence collection cannot better and more effectively handle multi-person detection scenarios and the risk of tampering with subsequent photos, through the random position distribution of the preset human face contour and whether the entity human portrait matches it, and the specific technical means formed by the real-time detection and watermark comparison and verification of the secondary tamper-proof afterwards. It provides a strong technical guarantee for various occasions that require photography verification, and solves the technical problems in the related technologies that face photography for evidence collection cannot better and more effectively handle multi-person detection scenarios and there is a risk of tampering with subsequent photos.
[0006] To achieve the above-mentioned purpose, an embodiment of the present invention provides a method for taking photos of a live body by anti-tampering of a face, which includes a live body detection process during the process and a process of post-tampering prevention of the photo to be detected generated by taking the photo during the process of live body detection. The specific process is as follows:
[0007] The liveness detection process includes the following steps:
[0008] Step S1, opening a photo preview window, presetting the number of human face contours and randomly adjusting the position distribution of the preset human face contours;
[0009] Step S2, according to the position distribution of the preset human face contour, the relative position and size of the physical portrait contour and the preset human face contour are detected in real time in the preview window, and the physical portrait is prompted to adjust its position according to the calculation result of the real-time detection, so that the physical portrait is centered and the distance between the physical portrait contour and the preset human face contour is within a preset range, and the photo to be detected is taken, otherwise the shooting cannot be completed;
[0010] The post-tamper prevention process includes the following steps:
[0011] Step S3, superimposing visible watermark information, superimposing the position and size of a preset human face outline on the photo to be detected with a solid or dotted line, and recording event information as a visible watermark;
[0012] Step S4, storing the invisible watermark information, and obtaining the preset human face outline and the position and size information of the physical portrait, and saving them in a storage medium in the form of an invisible watermark;
[0013] Step S5: The user retrieves the photo to be detected, extracts the visible watermark information of the photo to be detected, compares the position and size of the physical portrait with the preset portrait outline to see if they are consistent, verifies whether the visible watermark information is accurate, and feeds back the comparison and verification results to the user;
[0014] And / or, extract the preset human face outline and the position and size information of the entity portrait of the photo to be detected, compare and verify with the invisible watermark information in the storage medium, and feed back the comparison and verification result to the user.
[0015] Furthermore, in step S1, the number of preset human face contours is determined according to the number of people participating in the photo shoot, and the position distribution of the preset human face contours is adjusted multiple times.
[0016] Furthermore, in step S2, in the preview window, the relative position and size of the physical portrait contour and the preset portrait contour are detected in real time by a portrait detection algorithm.
[0017] Furthermore, in step S5, the preset human face outline and the position and size information of the physical portrait are extracted using an image processing algorithm, and then compared and verified with the invisible watermark information stored in the storage medium, and the comparison result is fed back to the user.
[0018] Furthermore, the visible watermark information includes shooting time, shooting personnel, resolution, and geographic location.
[0019] Another aspect of the present invention provides a photographing device for implementing the method for photographing a face with liveness detection and anti-tampering as described in the above embodiment, wherein the photographing device comprises an in-process liveness detection module and an ex-process anti-tampering module; the in-process liveness detection module comprises an initialization and preset face contour module and a real-time detection and adjustment module; the ex-process anti-tampering module comprises a visible watermark information superimposition module, an invisible watermark information storage module and a comparison and verification module;
[0020] The initialization and preset face outline module is used to open the photo preview window before shooting, preset the number of face outlines and randomly adjust the position distribution of the preset face outlines;
[0021] A real-time detection and adjustment module is used to detect the relative position and size of the physical portrait outline and the preset human face outline in real time in the preview window according to the position distribution of the preset human face outline during shooting, and prompt the physical portrait to adjust its position according to the calculation result of the real-time detection, so that the physical portrait is centered and the distance between the physical portrait outline and the preset human face outline is within a preset range, and then shoot to generate a photo to be detected, otherwise the shooting cannot be completed;
[0022] A visible watermark information superimposition module is used to superimpose a preset human face outline position and size on the photo to be detected with a solid or dotted line outline, and record event information as a visible watermark;
[0023] The invisible watermark information storage module is used to obtain the preset human face outline and the position and size information of the physical portrait, and save them in the storage medium in the form of invisible watermark;
[0024] The comparison and verification module is used for the user to retrieve the photo to be detected, extract the visible watermark information of the photo to be detected, compare the position and size of the real person portrait with the preset person portrait outline to see if they are consistent, check whether the visible watermark information is accurate, and feed back the comparison and verification results to the user;
[0025] And / or, extract the preset human face outline and the position and size information of the entity portrait of the photo to be detected, compare and verify with the invisible watermark information in the storage medium, and feed back the comparison and verification result to the user.
[0026] Furthermore, in the real-time detection and adjustment module, the relative position and size of the physical portrait contour and the preset portrait contour are detected in real time through the portrait detection algorithm.
[0027] Furthermore, in the comparison and verification module, an image processing algorithm is used to extract the preset human face outline and the position and size information of the physical portrait, and then they are compared and verified with the invisible watermark information stored in the storage medium, and the comparison results are fed back to the user.
[0028] On the other hand, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, a bus and an input and output interface, wherein the memory is used to store a computer program, and the processor is used to execute the computer program, so that the electronic device can implement the liveness detection and anti-tampering face photography method described in any of the above embodiments.
[0029] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, which includes a computer program. When the computer program runs on an electronic device, the electronic device executes the liveness detection and anti-tampering face photography method described in any of the above embodiments.
[0030] Beneficial effects of the present invention:
[0031] The present invention provides a method for photographing a face with anti-tampering by liveness detection. The method includes an in-process liveness detection process and a process for post-process anti-tampering of a photo to be detected generated by photographing during the in-process liveness detection process. The method specifically includes step S1: before photographing, opening a photo preview window, presetting the number of facial contours and randomly adjusting the position distribution of the preset facial contours; step S2: during photographing, according to the position distribution of the preset facial contours, detecting the relative position and size of the physical portrait contour and the preset facial contour in real time in the preview window, prompting the physical portrait to adjust its position according to the calculation result of the real-time detection, so that the physical portrait is centered and the distance between the physical portrait contour and the preset facial contour is within a preset range, and photographing to generate the photo to be detected, otherwise the photographing cannot be completed. The randomly distributed preset facial contours can effectively prevent the photographing of non-physical portraits during photographing, thereby greatly improving the security and anti-tampering ability of the photo; step S3: superimposing visible watermark information, in the The position and size of the preset human face outline are superimposed on the photo to be detected with a solid or dotted line, and the event information is recorded as a visible watermark; step S4, storing the invisible watermark information, and at the same time obtaining the preset human face outline and the position and size information of the entity portrait, and saving them to the storage medium in the form of an invisible watermark; step S5, extracting the preset human face outline and the position and size information of the entity portrait of the photo to be detected, and comparing whether the position and size of the entity portrait are consistent with the preset human face outline, checking whether the visible watermark information is accurate, and feeding back the comparison and verification results to the user; and / or, extracting the preset human face outline and the position and size information of the entity portrait of the photo to be detected and comparing and verifying them with the invisible watermark information in the storage medium, and feeding back the comparison results to the user, which greatly enhances the credibility of the photo, improves the security and anti-tampering ability of the photo, ensures the authenticity and integrity of the taken photo, and provides a strong technical guarantee for various occasions where photo verification is required. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The following drawings are used to provide a further understanding of the present application, constitute a part of the present application, and are only intended to provide an illustrative explanation and description of the present invention, and are not intended to limit the scope of the present invention. In the drawings:
[0033] Figure 1 This is a flow chart of a method for taking photos of a living body detected and tamper-proofed face according to an embodiment of the present application;
[0034] Figure 2 In another embodiment of the present application, when the application scenario requires only one person to be photographed, the user pre-sets the profile and size of one person, and generates a schematic diagram of the preset profile of the person at a random left position in the preview window;
[0035] Figure 3 This is an example diagram of a photo taken in another embodiment of the present application;
[0036] Figure 4 This is a schematic diagram of detecting anti-tampering of a face photo in another embodiment of the present application;
[0037] Figure 5 In another embodiment of the present application, when two people need to be photographed, the user pre-sets the outlines and sizes of two faces, and randomly generates two schematic diagrams of preset face outlines in the preview window, one of which is biased to the lower left and the other to the upper right;
[0038] Figure 6 This is an example diagram of a photo taken in another embodiment of the present application;
[0039] Figure 7 This is a schematic diagram of detecting anti-tampering of a face photo in another embodiment of the present application;
[0040] Figure 8 This is a schematic diagram of another embodiment of the present application in which the position of the real human portrait does not match the position of the preset human portrait outline;
[0041] Fig. 9 This is a schematic diagram of another embodiment of the present application in which the size of the real human portrait does not match the size of the preset human portrait outline;
[0042] Fig.10 This is a schematic diagram of an incomplete physical portrait in another embodiment of the present application;
[0043] Fig.11 This is a schematic diagram of a preset discontinuous face contour in another embodiment of the present application;
[0044] Fig.12 This is a schematic diagram of another embodiment of the present application in which the position and size of the real human portrait do not match the preset human portrait outline;
[0045] Fig.13 This is a schematic diagram showing that the watermark information is incomplete in another embodiment of the present application;
[0046] Fig.14 This is a flowchart of taking a face photo for liveness detection according to another embodiment of the present application;
[0047] Fig.15 Another embodiment of the present application is a flowchart for detecting anti-tampering of a face photo by comparing the position and size of a physical portrait with a preset portrait outline, checking whether the visible watermark information is accurate, and comparing and verifying the invisible watermark information;
[0048] Fig.16 Another embodiment of the present application is a flowchart for detecting anti-tampering of a face photo by comparing the position and size of the physical portrait with the preset portrait outline to see if they are consistent and checking if the visible watermark information is accurate;
[0049] Fig.17 Another embodiment of the present application is a flow chart for detecting anti-tampering of a face photo by comparing and verifying the preset face outline and the position and size information of the physical portrait of the photo to be detected with the invisible watermark information in the storage medium;
[0050] Fig.18 This is a schematic diagram of an anti-tampering facial photography device in another embodiment of the present application. DETAILED DESCRIPTION
[0051] Several embodiments of the present application will be disclosed below with diagrams to clearly and completely describe the technical solution of the present application, which constitute a part of the specification of the present application and are used to provide a further understanding of the present invention. The schematic embodiments and descriptions of the present invention are used to explain the present invention and do not constitute an improper limitation on the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.
[0052] The technical solutions between the various embodiments of the present application can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0053] The following contents are all examples of specific implementation processes provided for describing in detail the technical solutions to be protected by this application. However, this application may also be implemented in other ways different from the descriptions herein. Persons skilled in the art may, under the guidance of the concepts of this application, adopt different technical means to implement this application. Therefore, this application is not limited to the specific embodiments below.
[0054] The present invention provides a method for taking photos of liveness detection and tamper-proof faces. The method includes an in-process liveness detection process and a process of post-process tamper-proofing of a photo to be detected generated by taking the photo during the liveness detection process. The method specifically includes step S1: before taking photos, opening a photo preview window, presetting the number of face contours and randomly adjusting the position distribution of the preset face contours; step S2: during taking photos, according to the position distribution of the preset face contours, in real time detecting the relative position and size of the physical portrait contour and the preset face contour in the preview window, prompting the physical portrait to adjust its position according to the calculation result of the real-time detection, so that the physical portrait is centered and the distance between the physical portrait contour and the preset face contour is within a preset range, and taking photos to generate the photo to be detected, otherwise the taking photos cannot be completed. The randomly distributed preset face contours can effectively prevent the taking of non-physical portraits during taking photos, greatly improving the security and tamper-proofing ability of the photos; step S3: superimposing visible watermark information, in the The position and size of the preset face outline are superimposed on the photo to be detected with a solid or dotted line outline, and the event information is recorded as a visible watermark; step S4, storing the invisible watermark information, and at the same time obtaining the preset face outline and the position and size information of the entity portrait, and saving them in the storage medium in the form of an invisible watermark; step S5, extracting the preset face outline and the position and size information of the entity portrait of the photo to be detected, and comparing whether the position and size of the entity portrait are consistent with the preset face outline, checking whether the visible watermark information is accurate, and feeding back the comparison and verification results to the user; and / or, extracting the preset face outline and the position and size information of the entity portrait of the photo to be detected and comparing and verifying them with the invisible watermark information in the storage medium, and feeding back the comparison results to the user, which greatly enhances the credibility of the photo, improves the security and anti-tampering ability of the photo, ensures the authenticity and integrity of the taken photo, and provides a strong technical guarantee for various occasions where photo verification is required.
[0055] like Figure 1 As shown, the present application provides a method for taking photos of a face with a live body detection and anti-tampering, comprising step S1, before taking photos, opening a photo preview window, presetting the number of face contours and randomly adjusting the position distribution of the preset face contours;
[0056] Specifically, the preset number of portrait outlines is determined according to the number of people participating in the photo shoot, and can be preset to 1 (e.g. Figure 2 As shown), 2 (as Figure 5As shown), 3, 4, 5 and more; in order to more effectively prevent the shooting of non-entity portraits when taking photos, such as the phenomenon of photos and videos replacing entity portraits, during shooting, the position distribution of the preset human face outline can be randomly adjusted multiple times, and the acquisition is valid if the entity portrait completes the position adjustment within the preset time; otherwise, the acquisition is invalid, and it can be judged that there is a risk of non-living portrait photography; by randomly adjusting the preset human face outline in the preview window, a specific liveness detection method with a transformed position distribution can be generated, which greatly improves the authenticity and security of the acquisition of entity portrait photos.
[0057] Step S2: During shooting, according to the position distribution of the preset human face contour, the relative position and size of the physical portrait contour and the preset human face contour are detected in real time in the preview window, and the physical portrait is prompted to adjust its position according to the calculation result of the real-time detection, so that the physical portrait is centered and the distance between the physical portrait contour and the preset human face contour is within a preset range, and shooting is performed to generate a photo to be detected, otherwise the shooting cannot be completed;
[0058] Specifically, in the preview window, the portrait detection algorithm is used to detect the physical portrait outline and its relative position and size with the preset portrait outline in real time. When each physical portrait outline is matched with the corresponding preset portrait outline, and the distance between the two outlines is within the preset range value, the shooting conditions are met and the photo to be detected is generated. For details, please refer to Fig.14 The flowchart of taking a face photo is shown. Due to different application scenarios of photo verification, the setting of the preset range can be set according to the actual application scenario. The portrait detection algorithm used is a commonly used algorithm in the prior art, such as a convolutional neural network (CNN) deep learning model, which will not be described in detail here.
[0059] In a photo verification scenario, if the real person portrait is not taken, but a prepared photo or video is used to detect the relative position and size of the real person portrait outline and the preset person portrait outline in real time, if the real person portrait is not centered and the distance from the preset person portrait outline is not kept within the preset range, or the real person portrait is incomplete, the photo cannot be taken and the file cannot be stored. Figure 8 The position of the real person portrait does not match the preset person portrait outline, that is, the real person portrait is not centered and the shooting cannot be completed; Fig. 9 The size of the real person portrait does not match the preset person portrait outline, so the photo cannot be taken. Fig.10 The physical portrait is incomplete and the shooting cannot be completed.
[0060] Step S3, superimposing visible watermark information, superimposing the position and size of a preset human face outline on the photo to be detected with a solid or dotted line, and recording event information as a visible watermark;
[0061] Step S4, storing the invisible watermark information, and obtaining the preset human face outline and the position and size information of the physical portrait, and saving them in a storage medium in the form of an invisible watermark;
[0062] Specifically, when taking a photo, the relative position and size of the physical portrait outline and the preset portrait outline are detected in real time, and the user is prompted to adjust his or her standing position so that the physical portrait is centered and the distance between the physical portrait and the preset portrait outline frame is kept within a preset range.
[0063] After taking the photo, a solid line outline of a preset human face outline is superimposed on the photo, and information such as the shooting time, photographer, resolution, and geographic location are recorded as a visible watermark; at the same time, the position and size information of the preset human face outline and the physical portrait are stored in the image file in the form of an invisible watermark, and the position and size information of the preset human face outline and the physical portrait can also be stored in a storage medium.
[0064] It should be noted that the visible watermark information of this embodiment preferably includes but is not limited to shooting time, shooting person, resolution, geographic location, and other information parameters may also be set according to actual conditions, such as weather, mood, food, sports, copyright information, signature and specific patterns.
[0065] Step S5, extracting the preset human face outline and the position and size information of the physical portrait of the photo to be detected, and comparing whether the position and size of the physical portrait are consistent with the preset human face outline, checking whether the visible watermark information is accurate, and feeding back the comparison and verification results to the user;
[0066] And / or, extract the preset human face outline and the position and size information of the entity portrait of the photo to be detected, compare and verify with the invisible watermark information in the storage medium, and feed back the comparison result to the user.
[0067] Specifically, please refer to Fig.14 , Fig.15 , Fig.16 and Fig.17 The flowchart of detecting anti-tampering of facial photos is shown; the user calls up the photo to be detected, extracts the visible watermark information on the photo, and can verify the position and size of all real portraits and the preset human face outline with the naked eye, and check the visible watermark information superimposed on the photo; at the same time, the image processing algorithm is used to extract the preset human face outline and the position and size information of the real portrait, and then compares and verifies them with the invisible watermark information stored in the storage medium, and the comparison result is fed back to the user.
[0068] If the facial image of any person in the photograph has been intentionally tampered with, when verifying the image, you can check with your naked eyes whether the physical portrait is complete, verify whether the preset human face outline is superimposed, check whether the position and size of the human face outline on the photo match the preset human face outline, and whether the event information is fully recorded. If the above visible watermarks are destroyed or removed, the image is determined to be tampered with. Fig.11 If the face contour is discontinuous, the image is judged to be at risk of being tampered with. Fig.12 If the position and size of the real person portrait do not match the preset person portrait outline, it is determined that the image photo has the risk of being tampered with; Fig.13 It is visible that the watermark information is incomplete, which means that the image photo is at risk of being tampered with.
[0069] Furthermore, the system uses watermark extraction technology to check whether the preset human face outline and the position and size information of the actual human portrait are stored in the image file or storage medium. If the extracted information does not match the original information, or the relevant information cannot be extracted, then it can be determined that the image has been tampered with.
[0070] As another embodiment, the present invention provides a photographing device for implementing a method for photographing a face in a living body detection and anti-tampering manner, such as Fig.18 As shown, the photographing device includes an in-process liveness detection module and a post-process anti-tampering module; the in-process liveness detection module includes an initialization and preset human face contour module and a real-time detection and adjustment module; the post-process anti-tampering module includes a visible watermark information superimposition module, an invisible watermark information storage module and a comparison and verification module;
[0071] The module for initializing and presetting the face outline is used to open the photo preview window before shooting, preset the number of face outlines and randomly adjust the position distribution of the preset face outlines;
[0072] Specifically, the preset number of portrait outlines is determined according to the number of people participating in the photo shoot, such as being pre-set to 1, 2, 3, 4, 5 or more. In order to more effectively prevent the shooting of non-entity portraits, such as the phenomenon of photos or videos replacing entity portraits, during the shooting, the position distribution of the preset portrait outlines can be randomly adjusted multiple times, and the shooting can be executed after the position adjustment is completed within the preset time. Otherwise, the acquisition will be invalid, and it will be judged that there is a risk of non-living portrait photography. By randomly adjusting the preset portrait outlines in the preview window, a specific liveness detection method with a transformed position distribution can be generated, which greatly improves the authenticity and security of the acquisition of entity portrait photos.
[0073] A real-time detection and adjustment module is used to detect the relative position and size of the physical portrait outline and the preset human face outline in real time in the preview window according to the position distribution of the preset human face outline during shooting, and prompt the physical portrait to adjust its position according to the calculation result of the real-time detection, so that the physical portrait is centered and the distance between the physical portrait outline and the preset human face outline is within a preset range, and then shoot to generate a photo to be detected, otherwise the shooting cannot be completed;
[0074] Specifically, in the preview window, the portrait detection algorithm is used to detect the physical portrait outline and its relative position and size with the preset portrait outline in real time. When each physical portrait outline is matched with the corresponding preset portrait outline, and the distance between the two outlines is within the preset range value, the shooting conditions are met and the photo to be detected is generated. For details, please refer to Fig.14 The flowchart of taking a face photo is shown. Due to different application scenarios of photo verification, the setting of the preset range can be set according to the actual application scenario. The portrait detection algorithm used is a commonly used algorithm in the prior art, such as a convolutional neural network (CNN) deep learning model, which will not be described in detail here.
[0075] In a photo verification scenario, if the real person portrait is not taken, but a prepared photo is used to detect the relative position and size of the real person portrait outline and the preset person portrait outline in real time, if the real person portrait is not centered and the distance from the preset person portrait outline is not kept within the preset range, or the real person portrait is incomplete, the photo cannot be taken and the file cannot be stored. Figure 8 The position of the real person portrait does not match the preset person portrait outline, that is, the real person portrait is not centered and the shooting cannot be completed; Fig. 9 The size of the real person portrait does not match the preset person portrait outline, so the photo cannot be taken. Fig.10 The physical portrait is incomplete and the shooting cannot be completed.
[0076] A visible watermark information superimposition module is used to superimpose a preset human face outline position and size on the photo to be detected with a solid or dotted line outline, and record event information as a visible watermark;
[0077] The invisible watermark information storage module is used to obtain the preset human face outline and the position and size information of the physical portrait, and save them in the storage medium in the form of invisible watermark;
[0078] Specifically, when taking a photo, the relative position and size of the physical portrait outline and the preset portrait outline are detected in real time, and the user is prompted to adjust his or her standing position so that the physical portrait is centered and the distance between the physical portrait and the preset portrait outline frame is kept within a preset range.
[0079] After taking the photo, a solid line outline of a preset human face outline is superimposed on the photo, and information such as the shooting time, photographer, resolution, and geographic location are recorded as a visible watermark; at the same time, the position and size information of the preset human face outline and the physical portrait are stored in the image file in the form of an invisible watermark, and the position and size information of the preset human face outline and the physical portrait can also be stored in a storage medium.
[0080] The comparison and verification module extracts the preset human face outline and the position and size information of the physical portrait of the photo to be detected, compares the position and size of the physical portrait with the preset human face outline to see if they are consistent, verifies whether the visible watermark information is accurate, and feeds back the comparison and verification results to the user; and / or extracts the preset human face outline and the position and size information of the physical portrait of the photo to be detected and compares and verifies them with the invisible watermark information in the storage medium, and feeds back the comparison results to the user.
[0081] Specifically, please refer to Fig.14 , Fig.15 , Fig.16 and Fig.17 The flowchart of detecting anti-tampering of facial photos is shown; the user calls up the photo to be detected, extracts the visible watermark information on the photo, and can verify the position and size of all real portraits and the preset human face outline with the naked eye, and check the visible watermark information superimposed on the photo; at the same time, the image processing algorithm is used to extract the preset human face outline and the position and size information of the real portrait, and then compares and verifies them with the invisible watermark information stored in the storage medium, and the comparison result is fed back to the user.
[0082] If the facial image of any person in the photograph has been intentionally tampered with, when verifying the image, you can check with your naked eyes whether the physical portrait is complete, verify whether the preset human face outline is superimposed, check whether the position and size of the human face outline on the photo match the preset human face outline, and whether the event information is fully recorded. If the above visible watermarks are destroyed or removed, the image is determined to be tampered with. Fig.11 If the face contour is discontinuous, the image is judged to be at risk of being tampered with. Fig.12 If the position and size of the real person portrait do not match the preset person portrait outline, it is determined that the image photo has the risk of being tampered with; Fig.13 It is visible that the watermark information is incomplete, which means that the image photo is at risk of being tampered with.
[0083] Furthermore, the system uses watermark extraction technology to check whether the preset human face outline and the position and size information of the actual human portrait are stored in the image file or storage medium. If the extracted information does not match the original information, or the relevant information cannot be extracted, then it can be determined that the image has been tampered with.
[0084] As another embodiment, the present invention provides an electronic device, including a processor, a communication interface, a memory, a bus, and an input / output interface, wherein the memory is used to store a computer program, and the processor is used to execute the computer program, so that the electronic device implements the liveness detection and anti-tampering face photography method described in any of the above embodiments.
[0085] As another embodiment, the present invention provides a computer-readable storage medium, which includes a computer program. When the computer program runs on an electronic device, the electronic device executes the liveness detection and anti-tampering face photography method described in any of the above embodiments.
[0086] The present application is described with reference to flowcharts and / or block diagrams of methods and computer program products according to embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. Instructions executed by a processor of a computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0087] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0088] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0089] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0090] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for taking photos of living bodies by detecting and preventing tampering of faces, characterized in that: The method includes a live body detection process during the process and a post-process anti-tampering process for the photo to be detected generated by taking the photo during the live body detection process, which is specifically as follows: The liveness detection process includes the following steps: Step S1, opening a photo preview window, presetting the number of human face contours and randomly adjusting the position distribution of the preset human face contours; Step S2, according to the position distribution of the preset human face contour, the relative position and size of the physical portrait contour and the preset human face contour are detected in real time in the preview window, and the physical portrait is prompted to adjust its position according to the calculation result of the real-time detection, so that the physical portrait is centered and the distance between the physical portrait contour and the preset human face contour is within a preset range, and the photo to be detected is taken, otherwise the shooting cannot be completed; The post-tamper prevention process includes the following steps: Step S3, superimposing visible watermark information, superimposing the position and size of a preset human face outline on the photo to be detected with a solid or dotted line, and recording event information as a visible watermark; Step S4, storing the invisible watermark information, and obtaining the preset human face outline and the position and size information of the physical portrait, and saving them in a storage medium in the form of an invisible watermark; Step S5, retrieve the photo to be detected, extract the visible watermark information of the photo to be detected, compare the position and size of the physical portrait with the preset portrait outline to see if they are consistent, check whether the visible watermark information is accurate, and feed back the comparison and verification results to the user; And / or, extract the preset human face outline and the position and size information of the entity portrait of the photo to be detected, compare and verify with the invisible watermark information in the storage medium, and feed back the comparison and verification result to the user.
2. The method for taking photos of living body detection and anti-tampering face according to claim 1, characterized in that: In step S1, the number of preset human face contours is determined according to the number of people participating in the photo shoot, and the position distribution of the preset human face contours is adjusted multiple times.
3. The method for taking photos of living body detection and anti-tampering face according to claim 1, characterized in that: In step S2, in the preview window, the relative position and size of the physical portrait contour and the preset portrait contour are detected in real time by using a portrait detection algorithm.
4. The method for taking photos of living body detection and anti-tampering face according to claim 1, characterized in that: In step S5, the preset human face outline and the position and size information of the physical portrait are extracted using an image processing algorithm, and then compared and verified with the invisible watermark information stored in the storage medium, and the comparison result is fed back to the user.
5. The method for taking photos of living body detection and anti-tampering face according to claim 1, characterized in that: The visible watermark information includes shooting time, shooting personnel, resolution, and geographic location.
6. A photographing device for implementing the method for photographing a living body detection and anti-tampering face according to claim 1, characterized in that: The photographing device comprises an in-process liveness detection module and a post-process anti-tampering module; the in-process liveness detection module comprises an initialization and preset human face contour module and a real-time detection and adjustment module; the post-process anti-tampering module comprises a visible watermark information superimposition module, an invisible watermark information storage module and a comparison and verification module; The initialization and preset face outline module is used to open the photo preview window before shooting, preset the number of face outlines and randomly adjust the position distribution of the preset face outlines; The real-time detection and adjustment module is used to detect the relative position and size of the physical portrait outline and the preset human face outline in real time in the preview window according to the position distribution of the preset human face outline during shooting, and prompt the physical portrait to adjust the standing position according to the calculation result of the real-time detection, so that the physical portrait is centered and the distance between the physical portrait outline and the preset human face outline is within a preset range, and then shoot to generate the photo to be detected, otherwise the shooting cannot be completed; The module for superimposing visible watermark information is used to superimpose the position and size of the preset human face outline on the photo to be detected with a solid or dotted line, and record the event information as a visible watermark; The invisible watermark information storage module is used to obtain the preset human face outline and the position and size information of the physical portrait, and save them in the storage medium in the form of an invisible watermark; The comparison and verification module is used to retrieve the photo to be detected, extract the visible watermark information of the photo to be detected, compare whether the position and size of the physical portrait are consistent with the preset portrait outline, verify whether the visible watermark information is accurate, and feed back the comparison and verification results to the user; And / or, extract the preset human face outline and the position and size information of the entity portrait of the photo to be detected, compare and verify with the invisible watermark information in the storage medium, and feed back the comparison and verification result to the user.
7. The photographing device according to claim 6, characterized in that: In the real-time detection and adjustment module, the relative position and size of the physical portrait contour and the preset portrait contour are detected in real time through the portrait detection algorithm.
8. The photographing device according to claim 6, characterized in that: In the comparison and verification module, the image processing algorithm is used to extract the preset human face outline and the position and size information of the physical portrait, and then they are compared and verified with the invisible watermark information stored in the storage medium, and the comparison results are fed back to the user.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory, a bus and an input and output interface, wherein the memory is used to store a computer program, and the processor is used to execute the computer program, so that the electronic device can implement the liveness detection and anti-tampering face photography method as described in any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a computer program, and when the computer program is executed on an electronic device, the electronic device executes the method for photographing a living body detection and anti-tampering of a face as described in any one of claims 1 to 5.
Citation Information
Cited By
System for realizing passing by temporarily forbidding face recognition and photographing and passing method
CN121330806A