WO2021151348A1 - Certificate verification method and apparatus, and device and storage medium - Google Patents

Certificate verification method and apparatus, and device and storage medium Download PDF

Info

Publication number
WO2021151348A1
WO2021151348A1 PCT/CN2020/132271 CN2020132271W WO2021151348A1 WO 2021151348 A1 WO2021151348 A1 WO 2021151348A1 CN 2020132271 W CN2020132271 W CN 2020132271W WO 2021151348 A1 WO2021151348 A1 WO 2021151348A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
acceleration
time period
target device
displacement
Prior art date
Application number
PCT/CN2020/132271
Other languages
French (fr)
Chinese (zh)
Inventor
周建伟
雷晨雨
张国辉
宋晨
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021151348A1 publication Critical patent/WO2021151348A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • G06V10/7515Shifting the patterns to accommodate for positional errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/12Details of telephonic subscriber devices including a sensor for measuring a physical value, e.g. temperature or motion

Definitions

  • This application relates to the field of computer technology, in particular to a certificate verification method, device, equipment and storage medium.
  • ID card authentication needs to be taken from multiple angles (such as positive angle, forward, backward) to obtain multiple ID images.
  • the ID card needs to be taken from a positive angle to obtain two IDs.
  • Image the first document image is obtained by shooting the target document with the flashlight turned off at a positive angle
  • the second document image is obtained by shooting the target document with the flashlight turned on at a positive angle. Since the flash needs to be turned on when the second ID image is taken, it is easy to cause the user's ID to be replaced.
  • the inventor realizes that at present, it is mainly based on the pixel information in the second document image to verify whether the second document image has been replaced. Because the second document image is overexposed under strong light, the second document image is lost. More pixel information, in turn, causes the accuracy of the verification method to be relatively low.
  • the embodiments of the present application provide a certificate-based verification method, device, equipment, and storage medium, which can improve the accuracy of the legality verification of the target certificate.
  • an embodiment of the present application provides a certificate verification method, which includes:
  • the target acceleration of the target device is acquired; before the target device photographs the target certificate, the position information of the target device and the position information of the target certificate In alignment
  • a prompt message is output, and the prompt information is used to prompt to re-shoot the target credential.
  • an embodiment of the present application provides a certificate verification device, which includes:
  • the first acquisition module is configured to acquire the target acceleration of the target device during the process of the target device photographing the target certificate; before the target device photographs the target certificate, the location information of the target device is the same as The position information of the target certificate is in an aligned state;
  • the second acquisition module is configured to acquire a credential image obtained by shooting the target credential by the target device
  • a determining module configured to determine the displacement parameter of the target device according to the target acceleration of the target device
  • the first verification module is configured to verify the validity of the credential image according to the displacement parameter of the target device
  • the second verification module is configured to verify the validity of the target certificate according to the certificate image if the certificate image is valid;
  • the output module is configured to output prompt information if the credential image is not valid, and the prompt information is used to prompt to re-shoot the target credential.
  • an embodiment of the present application provides an electronic device, which includes: a processor adapted to implement one or more instructions; and a computer storage medium storing one or more instructions.
  • the device includes a processor, a memory, and a network interface; the processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, and the memory is used to store program codes.
  • the one or more instructions are adapted to be loaded by the processor and execute the following steps, or the processor is used to call the program code to execute the following steps:
  • the target acceleration of the target device is acquired; before the target device photographs the target certificate, the position information of the target device and the position information of the target certificate In alignment
  • a prompt message is output, and the prompt information is used to prompt to re-shoot the target credential.
  • an embodiment of the present application provides a computer-readable storage medium, including: the computer-readable storage medium stores one or more instructions.
  • the computer-readable storage medium stores a computer program, and the computer program includes program instructions.
  • the one or more instructions are suitable for being loaded by a processor and executing the following steps:
  • the target acceleration of the target device is acquired; before the target device photographs the target certificate, the position information of the target device and the position information of the target certificate In alignment
  • a prompt message is output, and the prompt information is used to prompt to re-shoot the target credential.
  • the embodiment of the present application can prevent the target certificate from being replaced and affect the verification of the certificate image, and can improve the accuracy of the legality verification of the target certificate.
  • FIG. 1 is a schematic flowchart of a certificate verification method provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of a three-dimensional direction of a mobile phone according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a method for determining a displacement parameter of a target device according to a target acceleration provided by an embodiment of the present application;
  • FIG. 4 is a schematic diagram of integration processing provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of dividing an interval obtained by integration processing according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram of acquiring the speed in the second time period provided by this embodiment.
  • FIG. 7 is a schematic diagram of acquiring the speed in the first time period provided by this embodiment.
  • FIG. 8 is a schematic flowchart of another certificate verification method provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a credential verification device provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an electronic device according to another embodiment of the present application.
  • the technical solution of this application can be applied to the fields of artificial intelligence, smart city and/or blockchain technology to realize the verification of certificates.
  • the data involved in this application such as credential images, etc., can be stored in a database, or can be stored in a blockchain, which is not limited in this application.
  • FIG. 1 is a schematic flowchart of a credential verification method provided by an embodiment of this application.
  • the embodiment of this application is executed by an electronic device.
  • the credential verification method includes steps S101 to S106.
  • S101 Acquire a target acceleration of the target device during the process of the target device photographing the target certificate.
  • the location information of the target device is aligned with the location information of the target certificate.
  • the position information of the target device is aligned with the position information of the target certificate means that the position of the target device is in a certain area directly above the position of the target certificate, that is, the target certificate has been captured in the shooting interface of the target device.
  • the target acceleration of the target device may be acquired during the process of the target device shooting the target certificate, so as to determine whether the target device moves according to the target acceleration.
  • the target acceleration of the target device can be obtained by an acceleration sensor inside the target device, where the acceleration sensor can be a linear acceleration sensor (Sensor.TYPE_ACCELEROMETER), an angular acceleration sensor, a piezoelectric acceleration sensor, and so on.
  • the target device may refer to a mobile phone.
  • the acceleration sensor of a mobile phone (such as Android) can be a linear acceleration sensor (Sensor.TYPE_ACCELEROMETER), which can detect the acceleration of the mobile phone in three directions according to the acceleration sensor on the mobile phone, that is, the acceleration in the x-axis direction and the acceleration in the y-axis direction.
  • Acceleration and acceleration in the z-axis direction is a vector that represents the rate of speed change in a certain direction.
  • Figure 2 a schematic diagram of the three-dimensional direction of a mobile phone provided by an embodiment of this application. Towards the outside of the screen.
  • the acceleration measurement of TYPE_ACCELEROMETER includes the acceleration of gravity. Even if the phone is stationary in the natural direction, there will be an acceleration value on the Y axis (the value on the test machine is 9.6), which is approximately equal to gravity 9.8m/s 2 . According to the test result, the sensor on the mobile phone has an error, and the measured acceleration of gravity is not equal to 9.8m/s 2 .
  • the gravitational acceleration is an interference factor for obtaining the target acceleration, so the gravitational acceleration needs to be removed.
  • S102 Acquire a credential image obtained by a target credential taken by the target device.
  • S103 Determine a displacement parameter of the target device according to the target acceleration of the target device.
  • the target credential can be photographed according to the camera module on the target device, the credential image obtained during the shooting of the target credential by the target device can be obtained, and the target acceleration generated by the shooting of the target credential by the target device can be obtained. And after acquiring the target acceleration of the target device, the displacement parameter of the target device is determined according to the acceleration of the target device, and the displacement parameter refers to the distance moved by the target device when photographing the target document.
  • FIG. 3 it is a schematic diagram of a method for determining the displacement parameter of the target device according to the target acceleration provided by an embodiment of the present application.
  • the method for determining the displacement parameter of the target device according to the target acceleration is shown in FIG.
  • the steps of the schematic diagram of the method include S21-S23.
  • the acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction may be summed to obtain a candidate acceleration.
  • the target acceleration of the target device includes acceleration in the first direction, acceleration in the second direction, and acceleration in the third direction.
  • FIG. 2 a schematic diagram of a three-dimensional direction of a mobile phone provided by an embodiment of this application.
  • the acceleration in the first direction may refer to the acceleration in the X-axis direction, which is horizontal and toward the right; the acceleration in the second direction It can refer to the acceleration in the Y-axis direction, which is vertical and toward the upper side; the acceleration in the third direction can refer to the acceleration in the Z-axis direction, which is toward the outside of the screen.
  • the acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction may be summed to obtain candidate accelerations. Since acceleration is a vector characteristic, the candidate acceleration can be obtained by vector summation of the acceleration in the three directions.
  • the acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction can be expressed by the following formula (1).
  • x in formula (1) refers to the acceleration in the first direction
  • a refers to the acceleration in the first direction
  • y refers to the acceleration in the second direction
  • b refers to the acceleration in the second direction
  • z refers to the acceleration in the third direction
  • c refers to the acceleration in the third direction.
  • a in formula (2) refers to the magnitude of acceleration in the first direction
  • b refers to the magnitude of acceleration in the second direction
  • c refers to the magnitude of acceleration in the third direction.
  • v (3) in the formula refers to the acceleration
  • v i is the i-th acceleration means
  • i is 1, 2, and so on means. Since the embodiment of the present application performs vector summation of the acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction, the vector magnitude of the candidate acceleration can be expressed by the following formula (4).
  • mag in formula (4) refers to the magnitude of the candidate acceleration vector
  • v x refers to the magnitude of the acceleration in the first direction
  • v y refers to the magnitude of the acceleration in the second direction
  • v z refers to the acceleration in the third direction. size. It can be based on the data generated by the sensor event object (SensorEvent) returned by the acceleration sensor (LINEAR_ACCELERATION) in the target device during a certain period of time, including information such as the timestamp, value, accuracy and so on when the acceleration is acquired.
  • the values field of the sensing event object includes an array of three elements, namely values[0], values[1], values[2], which correspond to the acceleration in the first direction, the acceleration in the second direction, and the third party respectively.
  • the magnitude of the upward acceleration can be expressed by the following formula (5).
  • values[0] in formula (5) corresponds to the acceleration in the first direction, that is, the acceleration in the X-axis direction; values[1] corresponds to the acceleration in the second direction, that is, the acceleration in the Y-axis direction Size; values[2] corresponds to the magnitude of the acceleration in the third direction, that is, the magnitude of the acceleration in the Z-axis direction.
  • the magnitude of the vector sum of the accelerations in the three directions can be expressed by the following formula (6).
  • the magnitude of the vector sum of the accelerations in the three directions is the candidate acceleration.
  • the gravitational acceleration will also be acquired, but the gravitational acceleration is an interference factor when determining whether the target device is moving, so the gravitational acceleration needs to be removed. Since the gravitational acceleration is known, the target acceleration can be obtained by subtracting the value of the gravitational acceleration from the value of the candidate acceleration.
  • a gravity acceleration sensor is generally installed in the mobile phone to measure the acceleration of gravity in three directions of the mobile phone. Obtain the target gravitational acceleration value according to the gravitational acceleration values in the three directions.
  • the target acceleration can be obtained by subtracting the value of the target gravitational acceleration from the value of the candidate acceleration.
  • the measured acceleration value is greater than 0 even when it is stationary.
  • the step of determining the displacement parameter of the target device according to the target acceleration is executed; if the target acceleration is less than or equal to the preset acceleration threshold, the step of determining the displacement parameter of the target device according to the target acceleration is not executed , Directly confirm the validity of the credential image. Only when the target acceleration is greater than the preset acceleration threshold will it be determined that the target device has moved, otherwise it may be caused by an error in the acceleration sensor of the target device or a slight jitter of the user. It should be noted that the preset acceleration threshold in the embodiment of the present application may be specifically set according to specific conditions, and the embodiment of the present application does not limit it.
  • the target acceleration is the acceleration of the target device within a preset time period
  • the method of determining the displacement parameter of the target device according to the target acceleration may be: integrating the target acceleration according to the preset time period to obtain the speed of the target device, The speed of the target device is integrated according to the preset time period to obtain the displacement parameter of the target device.
  • the target acceleration in the embodiment of the present application is the acceleration of the target device within a preset time, because the acceleration represents the rate of change of the velocity with respect to time, and the velocity itself represents the rate of change of the displacement with respect to time.
  • acceleration is the derivative of speed with respect to time
  • speed is the derivative of displacement with respect to time.
  • the target acceleration includes the acceleration of the target device in the first time period and the acceleration in the second time period, and both the first time period and the second time period belong to the preset time period.
  • the acceleration of the first time period may be integrated according to the first time period to obtain the first candidate speed; the acceleration of the second time period may be integrated according to the second time period to obtain the second candidate speed. Get half of the difference between the first candidate speed and the second candidate speed.
  • first candidate speed is less than the second candidate speed, then sum up half of the above difference and the first candidate speed to obtain the second time period If the first candidate speed is greater than or equal to the second candidate speed, then sum up half of the above difference and the second candidate speed to obtain the speed of the first time period; according to the speed of the second time period or the first The speed of the time period determines the speed of the target device.
  • FIG. 4 a schematic diagram of integration processing provided by an embodiment of this application.
  • the second time tick b, the X axis, and the area S of the curved trapezoid surrounded by the curve formed by the target acceleration in the preset time period X refers to time
  • Y refers to acceleration
  • the first time tick a refers to the start time of the preset time period
  • the second time tick b refers to the end time of the preset time period
  • f(x) refers to the target
  • the area S of the curved trapezoid refers to the speed of the target device obtained after the target acceleration is integrated.
  • FIG. 5 a schematic diagram of dividing the interval obtained by the integration processing provided by this embodiment of the application.
  • the area S is divided into a plurality of rectangular areas as small as possible, and the area of each rectangle is equal to the product of t n (the n-th time period) and f(n) (the acceleration in the n-th time period) corresponding to each rectangular area.
  • the area of each rectangle can be expressed by the following formula (9).
  • S n refers to the area of the nth time period
  • f(n) refers to the y value of the nth time period, that is, the target acceleration
  • ⁇ t refers to the time length of the nth time period.
  • this kind of algorithm in the prior art will produce certain errors.
  • FIG. 6 a schematic diagram of obtaining the speed in the second time period provided by this embodiment. As shown in FIG.
  • the target acceleration in the second time period is integrated by the algorithm in the prior art, then The area of the third part will be included, and the area of the third part does not belong to the second time period, so the excess area of the third part needs to be removed.
  • the target acceleration corresponding to the second time period is greater than the target acceleration corresponding to the first time period.
  • the target acceleration in the first time period can be integrated according to the first time period to obtain the target acceleration corresponding to the first time period.
  • the first candidate speed is the rectangular area S1.
  • the target acceleration in the first time period may refer to the average value of the acceleration in the first time period or the highest acceleration in the first time period.
  • the target acceleration in the second time period is integrated according to the second time period to obtain the second candidate speed corresponding to the second time period.
  • the target acceleration in the second time period may also refer to the target acceleration in the second time period.
  • the average value of acceleration or refers to the highest acceleration in the second time period. Obtain half of the difference between the first candidate speed corresponding to the first time period and the second candidate speed corresponding to the second time period, as shown in FIG. 6, the first candidate speed corresponding to the first time period and the second time period
  • the difference between the second candidate speeds corresponding to the segments refers to the part where the rectangular area corresponding to the second time period is larger than the rectangular area corresponding to the first time period, that is, the sum of the area of the second part and the area of the third part.
  • the first candidate speed corresponding to the first time period is less than the second candidate speed corresponding to the second time period. Therefore, half of the difference between the first candidate speed and the second candidate speed can be obtained, and the first candidate speed can be obtained by summing the half of the difference between the first candidate speed and the second candidate speed and the first candidate speed.
  • the speed in the second time period that is, the sum of the area of the first part and the area of the second part. In this way, the area of each rectangle in the area S of the curved trapezoid is integrated to obtain the speed of the target device within the preset time period.
  • FIG. 7 a schematic diagram of obtaining the speed in the first time period provided by this embodiment.
  • the target acceleration corresponding to the second time period is less than the target acceleration corresponding to the first time period.
  • the first time period performs integration processing on the target acceleration in the first time period to obtain the first candidate speed corresponding to the first time period.
  • the target acceleration in the second time period is integrated according to the second time period to obtain the second candidate speed corresponding to the second time period. Obtain half of the difference between the first candidate speed corresponding to the first time period and the second candidate speed corresponding to the second time period.
  • the first candidate speed corresponding to the first time period and the second time period refers to the part where the rectangular area corresponding to the first time segment is larger than the rectangular area corresponding to the second time segment, that is, the sum of the area of the second part and the area of the third part. Since the target acceleration corresponding to the first time period is greater than the target acceleration corresponding to the second time period, the first candidate speed corresponding to the first time period is greater than the second candidate speed corresponding to the second time period. Therefore, half of the difference between the first candidate speed and the second candidate speed can be obtained, and the area of the second part can be obtained.
  • the speed of the first time period can be obtained, that is, the sum of the area of the first part and the area of the second part.
  • the area of each rectangle in the area S of the curved trapezoid is integrated to obtain the speed of the target device within the preset time period.
  • the speed of the target device includes the speed of the target device in the first time period and the speed in the second time period.
  • the speed of the target device is integrated to obtain the preset speed.
  • the method of setting the displacement parameter of the target device in the time period can be: integrating the speed of the first time period according to the first time period to obtain the first candidate displacement; and integrating the speed of the second time period according to the second time period Process to obtain the second candidate displacement; obtain half of the difference between the first candidate displacement and the second candidate displacement; if the first candidate displacement is less than the second candidate displacement, sum the difference and the first candidate displacement, Obtain the displacement in the second time period; if the first candidate displacement is greater than or equal to the second candidate displacement, sum the difference and the second candidate displacement to obtain the displacement in the first time period; according to the displacement in the second time period or The displacement in the first time period determines the displacement parameter of the target device.
  • first candidate displacement is greater than the second candidate displacement, that is, the area obtained by integrating the speed of the first time period according to the first time period is larger than the area obtained by integrating the speed of the second time period according to the second time period, Then, half of the difference between the first candidate displacement and the second candidate displacement is summed with the second candidate displacement corresponding to the second time period to obtain the displacement of the first time period.
  • the first candidate displacement is smaller than the second candidate displacement, that is, the area obtained by integrating the speed of the first time period according to the first time period is smaller than the area obtained by integrating the speed of the second time period according to the second time period. Then, half of the difference between the first candidate displacement and the second candidate displacement is summed with the first candidate displacement corresponding to the first time period to obtain the displacement of the second time period. In this way, the speed of the preset time period is integrated, and the displacement parameter of the target device is obtained.
  • S104 Verify the validity of the credential image according to the displacement parameter of the target device.
  • S105 If the credential image is valid, verify the legitimacy of the target credential based on the credential image.
  • the validity of the document image can be verified according to the value of the displacement parameter of the target device.
  • the validity of the document image refers to whether the target document is replaced when the target device is shooting the target document.
  • the replacement of the target document refers to the shooting of the target device.
  • the interface is transferred to other documents, that is, the shooting interface of the target device contains other documents but not the target document.
  • the validity of the document image means that the target document has not been replaced, that is, the document image obtained by shooting the target document by the target device, and the legality of the target document can be verified by the document image obtained by shooting the target document.
  • the document image is not valid, that is, the photographing interface of the target device is transferred to another document, and the document image captured by the other document is replaced, and the legality of the target document cannot be determined based on the photographed document image.
  • the target acceleration of the target device is obtained during the process of the target device photographing the target certificate; the displacement parameter of the target device is determined according to the target acceleration of the target device. At the same time, it is determined whether the target acceleration is greater than the first acceleration threshold. If the target acceleration is greater than the first acceleration threshold, the displacement parameter of the target device is determined according to the target acceleration of the target device, so as to reduce the defects caused by the target device itself error.
  • Verify the validity of the document image according to the displacement parameter of the target device that is, verify whether the target document is replaced according to the displacement parameter of the target device;
  • the image verifies the legality of the target document; if the document image is not valid, that is, the target device is transferred to another document, and the other document is photographed to obtain the document image, and the target document is replaced with another document, a prompt message will be output
  • the prompt information is used to prompt to re-shoot the target certificate, so as to avoid the target certificate being replaced and affect the verification of the certificate image, and the accuracy of the legality verification of the target certificate can be improved.
  • FIG. 8 it is a schematic flowchart of another certificate verification method provided by this embodiment. As shown in FIG. 8, the schematic flowchart of another certificate verification method includes steps S201-S209.
  • S201 Acquire the target acceleration of the target device during the process of the target device photographing the target certificate.
  • S202 Acquire a credential image obtained by shooting the target credential by the target device.
  • S203 Determine a displacement parameter of the target device according to the target acceleration of the target device.
  • the displacement parameter of the target device After obtaining the displacement parameter of the target device, determine whether the displacement parameter of the target device is greater than the preset displacement threshold. If the displacement parameter of the target device is less than or equal to the preset displacement threshold, it means that the distance of the target device is relatively small, which is a normal movement of the user Range, such as the user’s hand shaking, etc., the ID image is valid. If the credential image is valid, it means that the credential image was taken from the target credential, and the target credential has not been replaced. Therefore, the legitimacy of the credential can be verified based on the credential image.
  • the target feature information can be extracted from the credential image, the sample feature information set of the sample credential image about the credential can be obtained, and the target feature information can be matched with the sample feature information in the sample feature information set. If the target characteristic information matches the target sample characteristic information in the sample characteristic information set, the target certificate is determined to be legitimized; if the target characteristic information does not match any sample characteristic information in the sample characteristic information set, it is determined that the target certificate does not have legality.
  • the target characteristic information can be extracted from the document image corresponding to the target document.
  • the target characteristic information can refer to multiple characteristic information in the document image, such as character characteristic information, color characteristic information or pattern characteristic information, etc., to obtain information about the document
  • the sample feature information collection of the sample image is matched with the sample feature information in the sample feature information set. If the target feature information of the credential image matches the target sample feature information in the sample feature information set, it is determined that the target credential has legitimacy. If the target characteristic information does not match any sample characteristic information in the sample characteristic information set, it is determined that the target certificate is not legal.
  • a character recognition neural network model can be trained, and the character feature information in the document image can be matched with the sample feature information in the sample feature information set according to the character recognition neural network model. If the target feature information matches the target sample in the sample feature information set If the characteristic information matches, it is determined that the target document is legal. If the target characteristic information does not match any sample characteristic information in the sample characteristic information set, it is determined that the target certificate is not legal.
  • the candidate information verification model can be trained to obtain the target information verification model, and the legitimacy of the target certificate can be verified according to the target information verification.
  • the candidate information verification model and the target feature information corresponding to the credential image to be verified, the sample feature information set corresponding to the sample credential image of the credential, and the target verification result corresponding to the credential image to be verified can be obtained.
  • the candidate information verification model is used to verify whether there is sample feature information matching the target feature information in the sample feature information set, and obtain the predictive verification result.
  • the predictive verification result includes the absence of sample feature information that matches the target feature information, or the existence of the target feature information Information matching sample feature information.
  • the candidate information verification model is adjusted according to the prediction verification result and the target verification result, and the target information verification model is obtained.
  • the loss value of the candidate information verification model can be determined based on the aforementioned prediction verification result and the target verification result. If the loss value of the candidate information verification model does not meet the convergence condition, the candidate information verification model is compared with the loss value of the candidate information verification model. The information verification model is adjusted to obtain the target information verification model.
  • the loss value of the candidate information verification model does not meet the convergence condition, that is, the loss value of the candidate information verification model is greater than the preset threshold, it means that the candidate information verification model has a low accuracy in verifying the target feature information in the document image.
  • the candidate information model can be adjusted according to the loss value of the candidate information verification model, such as collecting the misjudgment factors for the verification of the target feature information in the document image by the candidate information verification model, and adjusting the difference between the target feature information in the document image and the sample feature information set Therefore, the candidate information verification model is adjusted to obtain the target information verification model.
  • the loss value of the candidate information verification model satisfies the convergence condition, that is, the loss value of the candidate information verification model is less than the preset threshold, it means that the candidate information verification model has a high correct rate of verifying the target feature information in the document image, then the candidate information The verification model is determined as the target information verification model.
  • the displacement parameter of the target device is greater than the preset displacement threshold, it means that the distance the user moves the target device is relatively large and does not belong to the user's normal range of movement. For example, the user moves the target device to the location of another certificate. It means that the document image is not taken from the target document, but may be taken from another document. The document image is not valid, and the legality of the target document cannot be verified based on the document image, otherwise it will affect the target document Verification of accuracy. If the target certificate is not valid, the legality of the target certificate cannot be verified based on the captured certificate image, and a prompt message is output, that is, a prompt message that requires the user to re-shoot, so that the user can re-shoot the target certificate.
  • the first document image is obtained by shooting the target document with the flash off.
  • the second ID image is obtained by shooting the target ID with the flash. Since the flashlight needs to be turned on when the second ID image is taken, if the displacement parameter of the target device is greater than the preset displacement threshold, when the target device takes the second ID image, it transfers to other IDs and takes the other IDs to obtain the result.
  • the second credential image of is not obtained by shooting the target credential.
  • the credential image after replacement under strong light is not significantly different from the previous credential image from the point of view of the algorithm, which will affect the success rate of verification.
  • this application can be applied to the fields of digital medical and smart medical care, and can verify medical insurance cards and social security card certificates, so as to further prevent improper use of social security medical insurance cards, which is conducive to the management of the medical social security card system.
  • the target acceleration of the target device is obtained during the process of the target device photographing the target certificate; the displacement parameter of the target device is determined according to the target acceleration of the target device. At the same time, it is determined whether the target acceleration is greater than the first acceleration threshold. If the target acceleration is greater than the first acceleration threshold, the displacement parameter of the target device is determined according to the target acceleration of the target device, so as to reduce the defects caused by the target device itself error.
  • Verify the validity of the document image according to the displacement parameter of the target device that is, verify whether the target document is replaced according to the displacement parameter of the target device;
  • the image verifies the legality of the target document; if the document image is not valid, that is, the target device is transferred to another document, and the other document is photographed to obtain the document image, and the target document is replaced with another document, a prompt message will be output
  • the prompt information is used to prompt to re-shoot the target certificate, so as to avoid the target certificate being replaced and affect the verification of the certificate image, and the accuracy of the legality verification of the target certificate can be improved.
  • FIG. 9 is a schematic structural diagram of a credential verification device provided in an embodiment of the present application.
  • the device in the embodiment of the present application may be in the above-mentioned electronic device.
  • the certificate verification device includes:
  • the first acquisition module 11 is configured to acquire the target acceleration of the target device during the process of shooting the target certificate by the target device; before the target device shoots the target certificate, the location information of the target device Is in alignment with the position information of the target certificate;
  • the second acquiring module 12 is configured to acquire a credential image obtained by shooting the target credential by the target device;
  • the determining module 13 is configured to determine the displacement parameter of the target device according to the target acceleration of the target device;
  • the target acceleration of the target device includes acceleration in the first direction, acceleration in the second direction, and acceleration in the third direction; the above device further includes:
  • a summation processing module configured to perform summation processing on the acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction to obtain a candidate acceleration
  • a removing module used to remove the gravitational acceleration from the candidate acceleration to obtain the target acceleration
  • the execution module is configured to execute the step of determining the displacement parameter of the target device according to the target acceleration if the target acceleration is greater than a preset acceleration threshold.
  • the target acceleration is the acceleration of the target device in a preset time period
  • the above determination module 13 further includes: a first integration processing unit and a second integration processing unit.
  • a first integration processing unit configured to perform integration processing on the target acceleration according to the preset time period to obtain the speed of the target device
  • the second integration processing unit is configured to perform integration processing on the speed of the target device according to the preset time period to obtain the displacement parameter of the target device.
  • the target acceleration includes the acceleration of the target device in a first time period and the acceleration of the target device in a second time period, and both the first time period and the second time period belong to the preset time period ;
  • the above-mentioned first integral processing unit is specifically used for:
  • first candidate speed is less than the second candidate speed, sum half of the difference and the first candidate speed to obtain the speed in the second time period;
  • first candidate speed is greater than or equal to the second candidate speed, sum half of the difference and the second candidate speed to obtain the speed in the first time period;
  • the speed of the target device is determined according to the speed of the second time period or the speed of the first time period.
  • the speed of the target device includes the speed of the target device in the first time period and the speed of the target device in the second time period;
  • the above-mentioned second integral processing unit is specifically used for:
  • first candidate displacement is smaller than the second candidate displacement, sum up half of the difference and the first candidate displacement to obtain the displacement in the second time period;
  • first candidate displacement is greater than or equal to the second candidate displacement, sum half of the difference and the second candidate displacement to obtain the displacement in the first time period;
  • the displacement parameter of the target device is determined according to the displacement in the second time period or the displacement in the first time period.
  • the first verification module 14 is configured to verify the validity of the credential image according to the displacement parameter of the target device
  • the above-mentioned first verification module 14 includes: a judgment unit, a second determination unit, and a third determination unit.
  • the first determining unit is configured to determine that the credential image is valid if the displacement parameter of the target device is less than or equal to a preset displacement threshold
  • the second determining unit is configured to determine that the document image is not valid if the displacement parameter of the target device is greater than the preset displacement threshold.
  • the second verification module 15 is configured to verify the legality of the target certificate according to the certificate image if the certificate image is valid;
  • the above-mentioned second verification module 15 includes: an extraction unit, an acquisition unit, a matching unit, a fourth determination unit, and a fifth determination unit.
  • the obtaining unit is used to obtain the sample feature information set corresponding to the sample credential image of the credential;
  • a matching unit configured to match the target feature information with the sample feature information in the sample feature information set
  • the third determining unit is configured to determine that the target document is legal if the target characteristic information matches the target sample characteristic information in the sample characteristic information set;
  • the fourth determining unit is configured to determine that the target certificate does not have legitimacy if the target characteristic information does not match any sample characteristic information in the sample characteristic information set.
  • the output module 16 is configured to output prompt information if the credential image is not valid, and the prompt information is used to prompt to re-shoot the target credential.
  • the electronic device may include a processor, a memory, and a network interface; the processor is connected to the memory and the network interface, wherein the network interface is used to provide data communication functions, and the memory is used to store program codes (or program codes). Instruction), the processor is used to call the program code to execute the method in the foregoing embodiment.
  • the electronic device in this embodiment as shown in FIG. 10 may include: one or more processors 21; one or more input devices 22, one or more output devices 23, and a memory 24.
  • the aforementioned processor 21, input device 22, output device 23, and memory 24 are connected by a bus 25.
  • the processor 21 may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (ASICs). ), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the input device 22 may include a touch panel, a fingerprint sensor (used to collect user fingerprint information and fingerprint orientation information), a microphone, etc.
  • the output device 23 may include a display (LCD, etc.), a speaker, etc., and the output device 23 may output calibration The processed data sheet.
  • the memory 24 may include a read-only memory and a random access memory, and provides instructions and data to the processor 21. A part of the memory 24 may also include a non-volatile random access memory.
  • the memory 24 is used to store a computer program.
  • the computer program includes program instructions.
  • the processor 21 is used to execute the program instructions stored in the memory 24 to execute a program. A method of certificate verification.
  • the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
  • the target acceleration of the target device is acquired; before the target device photographs the target certificate, the position information of the target device and the position information of the target certificate In alignment
  • a prompt message is output, and the prompt information is used to prompt to re-shoot the target credential.
  • the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
  • the step of determining the displacement parameter of the target device according to the target acceleration is performed.
  • the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
  • the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
  • first candidate speed is less than the second candidate speed, sum half of the difference and the first candidate speed to obtain the speed in the second time period;
  • first candidate speed is greater than or equal to the second candidate speed, sum half of the difference and the second candidate speed to obtain the speed in the first time period;
  • the speed of the target device is determined according to the speed of the second time period or the speed of the first time period.
  • the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
  • first candidate displacement is smaller than the second candidate displacement, sum up half of the difference and the first candidate displacement to obtain the displacement in the second time period;
  • first candidate displacement is greater than or equal to the second candidate displacement, sum half of the difference and the second candidate displacement to obtain the displacement in the first time period;
  • the displacement parameter of the target device is determined according to the displacement in the second time period or the displacement in the first time period.
  • the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
  • the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
  • the target characteristic information matches the target sample characteristic information in the sample characteristic information set, it is determined that the target certificate is legal;
  • the target characteristic information does not match any sample characteristic information in the sample characteristic information set, it is determined that the target certificate does not have legitimacy.
  • the processor 21, input device 22, and output device 23 described in the embodiments of this application can perform the implementation described in the embodiment of the certificate verification method provided in the embodiments of this application, and can also perform the implementation described in the embodiments of this application.
  • the implementation of the electronic device will not be repeated here.
  • the target acceleration of the target device is obtained during the process of the target device photographing the target certificate; the displacement parameter of the target device is determined according to the target acceleration of the target device. At the same time, it is determined whether the target acceleration is greater than the first acceleration threshold. If the target acceleration is greater than the first acceleration threshold, the displacement parameter of the target device is determined according to the target acceleration of the target device, so as to reduce the defects caused by the target device itself error.
  • Verify the validity of the document image according to the displacement parameter of the target device that is, verify whether the target document is replaced according to the displacement parameter of the target device;
  • the image verifies the legality of the target document; if the document image is not valid, that is, the target device is transferred to another document, and the other document is photographed to obtain the document image, and the target document is replaced with another document, a prompt message will be output
  • the prompt information is used to prompt to re-shoot the target certificate, so as to avoid the target certificate being replaced and affect the verification of the certificate image, and the accuracy of the legality verification of the target certificate can be improved.
  • An embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, the computer program includes program instructions, when the program instructions are executed by a processor, the implementation is shown in FIG. 1 and FIG. 8.
  • the following steps may be performed: during the process of the target device photographing the target document, the target acceleration of the target device is obtained; the target device photographs the target document Previously, the location information of the target device was aligned with the location information of the target certificate; the certificate image obtained by the target device shooting the target certificate was acquired; the target was determined according to the target acceleration of the target device The displacement parameter of the device; verify the validity of the credential image according to the displacement parameter of the target device; if the credential image is valid, verify the legitimacy of the target credential according to the credential image; If the credential image is not valid, a prompt message is output, and the prompt information is used to prompt to re-shoot the target credential.
  • the storage medium involved in this application such as a computer-readable storage medium, may be non-volatile or volatile.
  • the computer-readable storage medium may be an internal storage unit of the electronic device described in any of the foregoing embodiments, such as a hard disk or a memory of a control device.
  • the computer-readable storage medium may also be an external storage device of the control device, for example, a plug-in hard disk equipped on the control device, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital, SD) ) Card, Flash Card, etc.
  • the computer-readable storage medium may also include both an internal storage unit of the control device and an external storage device.
  • the computer-readable storage medium is used to store the computer program and other programs and data required by the control device.
  • the computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
  • control device and method may be implemented in other ways.
  • the device embodiments described above are illustrative.
  • the division of the units may be a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not implemented.

Abstract

Provided are a certificate verification method and apparatus, and a device and a storage medium. The certificate verification method comprises: in the process of a target device photographing a target certificate, acquiring a target acceleration of the target device (S101); acquiring a certificate image obtained by the target device photographing the target certificate (S102); determining a displacement parameter of the target device according to the target acceleration of the target device (S103); verifying the validity of the certificate image according to the displacement parameter of the target device (S104); if the certificate image is valid, verifying the legitimacy of the target certificate according to the certificate image (S105); and if the certificate image is invalid, outputting prompt information, wherein the prompt information is used for giving a prompt for re-photographing the target certificate (S106). The present invention can improve the accuracy of legitimacy verification of a target certificate, and is applicable to the field of digital medical treatment.

Description

证件验证方法、装置、设备及存储介质Credential verification method, device, equipment and storage medium
本申请要求于2020年10月10日提交中国专利局、申请号为202011078719.9,发明名称为“证件验证方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the Chinese Patent Office on October 10, 2020 with the application number 202011078719.9 and the invention title "Document verification method, device, equipment and storage medium", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种证件验证方法、装置、设备及存储介质。This application relates to the field of computer technology, in particular to a certificate verification method, device, equipment and storage medium.
背景技术Background technique
通常身份证鉴伪时需要从多个角度(如正角度,前倾,后倾)对用户的身份证件进行拍摄得到多张证件图像,其中,需要从正角度对身份证进行拍摄得到两张证件图像,第一张证件图像是正角度下关闭闪光灯对目标证件进行拍摄得到的,第二张证件图像是正角度下开启闪光灯对目标证件进行拍摄得到的。由于第二张证件图像拍摄时需要开启闪光灯,容易导致用户的身份证件被替换。发明人意识到,目前主要是通过根据第二张证件图像中的像素信息来验证第二张证件图像是否被替换,由于第二张证件图像在强光下曝光过度,导致第二张证件图像丢失较多像素信息,进而,导致该验证方法的准确度比较低。Generally, ID card authentication needs to be taken from multiple angles (such as positive angle, forward, backward) to obtain multiple ID images. Among them, the ID card needs to be taken from a positive angle to obtain two IDs. Image, the first document image is obtained by shooting the target document with the flashlight turned off at a positive angle, and the second document image is obtained by shooting the target document with the flashlight turned on at a positive angle. Since the flash needs to be turned on when the second ID image is taken, it is easy to cause the user's ID to be replaced. The inventor realizes that at present, it is mainly based on the pixel information in the second document image to verify whether the second document image has been replaced. Because the second document image is overexposed under strong light, the second document image is lost. More pixel information, in turn, causes the accuracy of the verification method to be relatively low.
发明内容Summary of the invention
本申请实施例提供一种基于证件验证方法、装置、设备及存储介质,可以提高对目标证件的合法性验证的准确性。The embodiments of the present application provide a certificate-based verification method, device, equipment, and storage medium, which can improve the accuracy of the legality verification of the target certificate.
第一方面,本申请实施例提供了一种证件验证方法,该方法包括:In the first aspect, an embodiment of the present application provides a certificate verification method, which includes:
在目标设备对目标证件进行拍摄的过程中,获取所述目标设备的目标加速度;在所述目标设备对所述目标证件进行拍摄之前,所述目标设备的位置信息与所述目标证件的位置信息处于对齐状态;During the process of the target device photographing the target certificate, the target acceleration of the target device is acquired; before the target device photographs the target certificate, the position information of the target device and the position information of the target certificate In alignment
获取所述目标设备对所述目标证件进行拍摄得到的证件图像;Acquiring a credential image obtained by shooting the target credential by the target device;
根据所述目标设备的目标加速度确定所述目标设备的位移参数;Determining the displacement parameter of the target device according to the target acceleration of the target device;
根据所述目标设备的位移参数验证所述证件图像的有效性;Verify the validity of the credential image according to the displacement parameter of the target device;
若所述证件图像具有有效性,则根据所述证件图像对所述目标证件的合法性进行验证;If the credential image is valid, verify the legitimacy of the target credential according to the credential image;
若所述证件图像不具有有效性,则输出提示信息,所述提示信息用于提示对所述目标证件进行重新拍摄。If the credential image is not valid, a prompt message is output, and the prompt information is used to prompt to re-shoot the target credential.
第二方面,本申请实施例提供了一种证件验证装置,该装置包括:In the second aspect, an embodiment of the present application provides a certificate verification device, which includes:
第一获取模块,用于在目标设备对目标证件进行拍摄的过程中,获取所述目标设备的目标加速度;在所述目标设备对所述目标证件进行拍摄之前,所述目标设备的位置信息与所述目标证件的位置信息处于对齐状态;The first acquisition module is configured to acquire the target acceleration of the target device during the process of the target device photographing the target certificate; before the target device photographs the target certificate, the location information of the target device is the same as The position information of the target certificate is in an aligned state;
第二获取模块,用于获取所述目标设备对所述目标证件进行拍摄得到的证件图像;The second acquisition module is configured to acquire a credential image obtained by shooting the target credential by the target device;
确定模块,用于根据所述目标设备的目标加速度确定所述目标设备的位移参数;A determining module, configured to determine the displacement parameter of the target device according to the target acceleration of the target device;
第一验证模块,用于根据所述目标设备的位移参数验证所述证件图像的有效性;The first verification module is configured to verify the validity of the credential image according to the displacement parameter of the target device;
第二验证模块,用于若所述证件图像具有有效性,则根据所述证件图像对所述目标证件的合法性进行验证;The second verification module is configured to verify the validity of the target certificate according to the certificate image if the certificate image is valid;
输出模块,用于若所述证件图像不具有有效性,则输出提示信息,所述提示信息用于提示对所述目标证件进行重新拍摄。The output module is configured to output prompt information if the credential image is not valid, and the prompt information is used to prompt to re-shoot the target credential.
第三方面,本申请实施例提供了一种电子设备,该设备包括:处理器,适于实现一条或一条以上指令;以及,计算机存储介质,所述计算机存储介质存储有一条或一条以上指令。或者,该设备包括处理器、存储器以及网络接口;所述处理器与存储器、网络接口相连,其中,网络接口用于提供数据通信功能,所述存储器用于存储程序代码。In a third aspect, an embodiment of the present application provides an electronic device, which includes: a processor adapted to implement one or more instructions; and a computer storage medium storing one or more instructions. Alternatively, the device includes a processor, a memory, and a network interface; the processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, and the memory is used to store program codes.
其中,所述一条或一条以上指令适于由所述处理器加载并执行如下步骤,或者,所述处理器用于调用所述程序代码以执行如下步骤:Wherein, the one or more instructions are adapted to be loaded by the processor and execute the following steps, or the processor is used to call the program code to execute the following steps:
在目标设备对目标证件进行拍摄的过程中,获取所述目标设备的目标加速度;在所述目标设备对所述目标证件进行拍摄之前,所述目标设备的位置信息与所述目标证件的位置信息处于对齐状态;During the process of the target device photographing the target certificate, the target acceleration of the target device is acquired; before the target device photographs the target certificate, the position information of the target device and the position information of the target certificate In alignment
获取所述目标设备对所述目标证件进行拍摄得到的证件图像;Acquiring a credential image obtained by shooting the target credential by the target device;
根据所述目标设备的目标加速度确定所述目标设备的位移参数;Determining the displacement parameter of the target device according to the target acceleration of the target device;
根据所述目标设备的位移参数验证所述证件图像的有效性;Verify the validity of the credential image according to the displacement parameter of the target device;
若所述证件图像具有有效性,则根据所述证件图像对所述目标证件的合法性进行验证;If the credential image is valid, verify the legitimacy of the target credential according to the credential image;
若所述证件图像不具有有效性,则输出提示信息,所述提示信息用于提示对所述目标证件进行重新拍摄。If the credential image is not valid, a prompt message is output, and the prompt information is used to prompt to re-shoot the target credential.
第四方面,本申请实施例提供了一种计算机可读存储介质,包括:所述计算机可读存储介质存储有一条或一条以上指令。例如,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令。其中,所述一条或一条以上指令适于由处理器加载并执行如下步骤:In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including: the computer-readable storage medium stores one or more instructions. For example, the computer-readable storage medium stores a computer program, and the computer program includes program instructions. Wherein, the one or more instructions are suitable for being loaded by a processor and executing the following steps:
在目标设备对目标证件进行拍摄的过程中,获取所述目标设备的目标加速度;在所述目标设备对所述目标证件进行拍摄之前,所述目标设备的位置信息与所述目标证件的位置信息处于对齐状态;During the process of the target device photographing the target certificate, the target acceleration of the target device is acquired; before the target device photographs the target certificate, the position information of the target device and the position information of the target certificate In alignment
获取所述目标设备对所述目标证件进行拍摄得到的证件图像;Acquiring a credential image obtained by shooting the target credential by the target device;
根据所述目标设备的目标加速度确定所述目标设备的位移参数;Determining the displacement parameter of the target device according to the target acceleration of the target device;
根据所述目标设备的位移参数验证所述证件图像的有效性;Verify the validity of the credential image according to the displacement parameter of the target device;
若所述证件图像具有有效性,则根据所述证件图像对所述目标证件的合法性进行验证;If the credential image is valid, verify the legitimacy of the target credential according to the credential image;
若所述证件图像不具有有效性,则输出提示信息,所述提示信息用于提示对所述目标证件进行重新拍摄。If the credential image is not valid, a prompt message is output, and the prompt information is used to prompt to re-shoot the target credential.
本申请实施例可以避免目标证件被替换而影响对证件图像的验证,可以提高对目标证件的合法性验证的准确性。The embodiment of the present application can prevent the target certificate from being replaced and affect the verification of the certificate image, and can improve the accuracy of the legality verification of the target certificate.
附图说明Description of the drawings
图1是本申请实施例提供的一种证件验证方法的流程示意图;FIG. 1 is a schematic flowchart of a certificate verification method provided by an embodiment of the present application;
图2是本申请实施例提供的一种手机的三维方向的示意图;FIG. 2 is a schematic diagram of a three-dimensional direction of a mobile phone according to an embodiment of the present application;
图3是本申请实施例提供的一种根据目标加速度确定目标设备的位移参数方法的示意图;3 is a schematic diagram of a method for determining a displacement parameter of a target device according to a target acceleration provided by an embodiment of the present application;
图4是本申请实施例提供的一种进行积分处理的示意图;FIG. 4 is a schematic diagram of integration processing provided by an embodiment of the present application;
图5是本申请实施例提供的一种对积分处理获得的区间进行划分的示意图;FIG. 5 is a schematic diagram of dividing an interval obtained by integration processing according to an embodiment of the present application; FIG.
图6是本实施例提供的一种获取第二时间段的速度的示意图;FIG. 6 is a schematic diagram of acquiring the speed in the second time period provided by this embodiment;
图7是本实施例提供的一种获取第一时间段的速度的示意图;FIG. 7 is a schematic diagram of acquiring the speed in the first time period provided by this embodiment;
图8是本申请实施例提供的另一种证件验证方法的流程示意图;FIG. 8 is a schematic flowchart of another certificate verification method provided by an embodiment of the present application;
图9是本申请实施例提供的一种证件验证装置的结构示意图;FIG. 9 is a schematic structural diagram of a credential verification device provided by an embodiment of the present application;
图10是本申请另一实施例提供的一种电子设备的结构示意图。FIG. 10 is a schematic structural diagram of an electronic device according to another embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below in conjunction with the figures in the embodiments of the present application.
本申请的技术方案可应用于人工智能、智慧城市和/或区块链技术领域,以实现对证件的验证。可选的,本申请涉及的数据如证件图像等可存储于数据库中,或者可以存储于区块链中,本申请不做限定。The technical solution of this application can be applied to the fields of artificial intelligence, smart city and/or blockchain technology to realize the verification of certificates. Optionally, the data involved in this application, such as credential images, etc., can be stored in a database, or can be stored in a blockchain, which is not limited in this application.
请参见图1,为本申请实施例提供的一种证件验证方法的流程示意图,本申请实施例由电子设备来执行,该一种证件验证方法包括步骤S101~S106。Please refer to FIG. 1, which is a schematic flowchart of a credential verification method provided by an embodiment of this application. The embodiment of this application is executed by an electronic device. The credential verification method includes steps S101 to S106.
S101,在目标设备对目标证件进行拍摄的过程中,获取目标设备的目标加速度。S101: Acquire a target acceleration of the target device during the process of the target device photographing the target certificate.
在目标设备对目标证件进行拍摄之前,目标设备的位置信息与目标证件的位置信息处于对齐状态。目标设备的位置信息与目标证件的位置信息处于对齐状态是指目标设备的位置处于目标证件的位置的正上方的一定区域内,即目标设备的拍摄界面中已经捕捉到目标证件。可以在目标设备对目标证件进行拍摄的过程中,获取目标设备的目标加速度,以便根据该目标加速度确定目标设备是否发生移动。其中,可以由目标设备内部的加速度传感器获取目标设备的目标加速度,其中,加速度传感器可以是线性加速度传感器(Sensor.TYPE_ACCELEROMETER)、角加速度传感器、压电式加速度传感器等等。例如,目标设备可以是指手机,对于手机来说,面向屏幕并竖直摆放是自然方向。手机(如Android)的加速度传感器可以是线性加速度传感器(Sensor.TYPE_ACCELEROMETER),可以根据手机上的加速度传感器,检测手机在三个方向上的加速度,即x轴方向上的加速度,y轴方向上的加速度和z轴方向上的加速度。加速度(Acceleration)是一个矢量,表示在某个方向上的速度变化率。如图2所示,为本申请实施例提供的一种手机的三维方向的示意图,如图2所示,X轴是水平方向且朝向右边,Y轴是竖直方向且朝向上边,Z轴是朝向屏幕外面。但是,TYPE_ACCELEROMETER的加速度测量是包含重力加速度的。即使自然方向上手机静止不动,在Y轴也会有加速度值(测试机上的值是9.6),大约等于重力9.8m/s 2。根据测试结果得知,手机上传感器是有误差的,测出的重力加速度并不等于9.8m/s 2。重力加速度对获取目标加速度来说是干扰因素,因此需要去除重力加速度。 Before the target device shoots the target certificate, the location information of the target device is aligned with the location information of the target certificate. The position information of the target device is aligned with the position information of the target certificate means that the position of the target device is in a certain area directly above the position of the target certificate, that is, the target certificate has been captured in the shooting interface of the target device. The target acceleration of the target device may be acquired during the process of the target device shooting the target certificate, so as to determine whether the target device moves according to the target acceleration. Wherein, the target acceleration of the target device can be obtained by an acceleration sensor inside the target device, where the acceleration sensor can be a linear acceleration sensor (Sensor.TYPE_ACCELEROMETER), an angular acceleration sensor, a piezoelectric acceleration sensor, and so on. For example, the target device may refer to a mobile phone. For a mobile phone, facing the screen and placing it vertically is a natural orientation. The acceleration sensor of a mobile phone (such as Android) can be a linear acceleration sensor (Sensor.TYPE_ACCELEROMETER), which can detect the acceleration of the mobile phone in three directions according to the acceleration sensor on the mobile phone, that is, the acceleration in the x-axis direction and the acceleration in the y-axis direction. Acceleration and acceleration in the z-axis direction. Acceleration is a vector that represents the rate of speed change in a certain direction. As shown in Figure 2, a schematic diagram of the three-dimensional direction of a mobile phone provided by an embodiment of this application. Towards the outside of the screen. However, the acceleration measurement of TYPE_ACCELEROMETER includes the acceleration of gravity. Even if the phone is stationary in the natural direction, there will be an acceleration value on the Y axis (the value on the test machine is 9.6), which is approximately equal to gravity 9.8m/s 2 . According to the test result, the sensor on the mobile phone has an error, and the measured acceleration of gravity is not equal to 9.8m/s 2 . The gravitational acceleration is an interference factor for obtaining the target acceleration, so the gravitational acceleration needs to be removed.
S102,获取目标设备对目标证件进行拍摄得到的证件图像。S102: Acquire a credential image obtained by a target credential taken by the target device.
S103,根据目标设备的目标加速度确定目标设备的位移参数。S103: Determine a displacement parameter of the target device according to the target acceleration of the target device.
可以根据目标设备上的摄像模块对目标证件进行拍摄,获得目标设备对目标证件进行拍摄的过程中拍摄得到的证件图像,并获取目标设备在对目标证件进行拍摄过程所产生的目标加速度。并且在获取目标设备的目标加速度后,根据目标设备的加速度确定目标设备的位移参数,该位移参数是指目标设备在对目标证件进行拍摄时所移动的距离。The target credential can be photographed according to the camera module on the target device, the credential image obtained during the shooting of the target credential by the target device can be obtained, and the target acceleration generated by the shooting of the target credential by the target device can be obtained. And after acquiring the target acceleration of the target device, the displacement parameter of the target device is determined according to the acceleration of the target device, and the displacement parameter refers to the distance moved by the target device when photographing the target document.
可选的,如图3所述,是本申请实施例提供的一种根据目标加速度确定目标设备的位移参数方法的示意图,如图3所示,该一种根据目标加速度确定目标设备的位移参数方法的示意图的步骤包括S21-S23。Optionally, as shown in FIG. 3, it is a schematic diagram of a method for determining the displacement parameter of the target device according to the target acceleration provided by an embodiment of the present application. As shown in FIG. 3, the method for determining the displacement parameter of the target device according to the target acceleration is shown in FIG. The steps of the schematic diagram of the method include S21-S23.
S21,可以对第一方向上的加速度、第二方向上的加速度以及第三方向上的加速度进行求和处理,得到候选加速度。S21, the acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction may be summed to obtain a candidate acceleration.
目标设备的目标加速度包括第一方向上的加速度、第二方向上的加速度以及第三方向上的加速度。如图2所示,为本申请实施例提供的一种手机的三维方向的示意图,第一方向上的加速度可以是指X轴方向上的加速度,水平方向且朝向右边;第二方向上的加速度可以是指Y轴方向上的加速度,竖直方向且朝向上边;第三方向上的加速度可以是指Z轴方向上的加速度,朝向屏幕外面。可以对第一方向上的加速度、第二方向上的加速度以及第三方向上的加速度进行求和处理,得到候选加速度。由于加速度是矢量的特性,可以根据对三个方向上的加速度进行向量求和,获得候选加速度。The target acceleration of the target device includes acceleration in the first direction, acceleration in the second direction, and acceleration in the third direction. As shown in FIG. 2, a schematic diagram of a three-dimensional direction of a mobile phone provided by an embodiment of this application. The acceleration in the first direction may refer to the acceleration in the X-axis direction, which is horizontal and toward the right; the acceleration in the second direction It can refer to the acceleration in the Y-axis direction, which is vertical and toward the upper side; the acceleration in the third direction can refer to the acceleration in the Z-axis direction, which is toward the outside of the screen. The acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction may be summed to obtain candidate accelerations. Since acceleration is a vector characteristic, the candidate acceleration can be obtained by vector summation of the acceleration in the three directions.
其中,第一方向上的加速度、第二方向上的加速度以及第三方向上的加速度可以用如下公式(1)表示为。Among them, the acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction can be expressed by the following formula (1).
Figure PCTCN2020132271-appb-000001
Figure PCTCN2020132271-appb-000001
其中,公式(1)中的x是指第一方向上的加速度,a是指第一方向上的加速度大小;y是指第二方向上的加速度,b是指第二方向上的加速度大小;z是指第三方向上的加速度,c是指第三方向上的加速度大小。由于加速度是矢量的特性,可以根据对三个方向上的加速度进行向量求和,获得目标加速度的大小,对三个方向上的加速度进行向量求和可以用如 下公式(2)表示:Wherein, x in formula (1) refers to the acceleration in the first direction, a refers to the acceleration in the first direction; y refers to the acceleration in the second direction, and b refers to the acceleration in the second direction; z refers to the acceleration in the third direction, and c refers to the acceleration in the third direction. Since acceleration is a vector characteristic, the magnitude of the target acceleration can be obtained by vector summation of the acceleration in the three directions. The vector summation of the acceleration in the three directions can be expressed by the following formula (2):
Figure PCTCN2020132271-appb-000002
Figure PCTCN2020132271-appb-000002
其中,公式(2)中的a是指第一方向上的加速度大小,b是指第二方向上的加速度大小,c是指第三方向上的加速度大小。对三个方向上的加速度进行向量求和后,得到的是一个向量,求向量大小的一般公式可以用如下公式(3)表示。Among them, a in formula (2) refers to the magnitude of acceleration in the first direction, b refers to the magnitude of acceleration in the second direction, and c refers to the magnitude of acceleration in the third direction. After summing the accelerations in the three directions, the result is a vector. The general formula for calculating the magnitude of the vector can be expressed by the following formula (3).
Figure PCTCN2020132271-appb-000003
Figure PCTCN2020132271-appb-000003
其中,公式(3)中的v是指加速度,v i是指第i个加速度,i是指1、2、3等等。由于本申请实施例中是对第一方向上的加速度、第二方向上的加速度以及第三方向上的加速度进行向量求和,因此求候选加速度的向量大小可以用如下公式(4)表示。 Wherein, v (3) in the formula refers to the acceleration, v i is the i-th acceleration means, i is 1, 2, and so on means. Since the embodiment of the present application performs vector summation of the acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction, the vector magnitude of the candidate acceleration can be expressed by the following formula (4).
Figure PCTCN2020132271-appb-000004
Figure PCTCN2020132271-appb-000004
其中,公式(4)中的mag是指候选加速度向量的大小,v x是指第一方向上的加速度大小,v y是指第二方向上的加速度大小,v z是指第三方向上的加速度大小。可以根据目标设备中加速度传感器(LINEAR_ACCELERATION)返回的传感事件对象(SensorEvent)在某一段时间内产生的数据,包括加速度获取时的时间戳、值、精度等等信息。传感事件对象values字段中包括三个元素的数组,即values[0]、values[1]、values[2],分别对应第一方向上的加速度大小、第二方向上的加速度大小以及第三方向上的加速度大小。三个方向上的加速度进行向量和可以用如下公式(5)表示。 Among them, mag in formula (4) refers to the magnitude of the candidate acceleration vector, v x refers to the magnitude of the acceleration in the first direction, v y refers to the magnitude of the acceleration in the second direction, and v z refers to the acceleration in the third direction. size. It can be based on the data generated by the sensor event object (SensorEvent) returned by the acceleration sensor (LINEAR_ACCELERATION) in the target device during a certain period of time, including information such as the timestamp, value, accuracy and so on when the acceleration is acquired. The values field of the sensing event object includes an array of three elements, namely values[0], values[1], values[2], which correspond to the acceleration in the first direction, the acceleration in the second direction, and the third party respectively. The magnitude of the upward acceleration. The vector sum of acceleration in the three directions can be expressed by the following formula (5).
Figure PCTCN2020132271-appb-000005
Figure PCTCN2020132271-appb-000005
其中,公式(5)中的values[0]对应第一方向上的加速度大小,即X轴方向上的加速度大小;values[1]对应第二方向上的加速度大小,即Y轴方向上的加速度大小;values[2]对应第三方向上的加速度大小,即Z轴方向上的加速度大小。另外,求出三个方向上的加速度的向量和的大小可以用如下公式(6)表示。Among them, values[0] in formula (5) corresponds to the acceleration in the first direction, that is, the acceleration in the X-axis direction; values[1] corresponds to the acceleration in the second direction, that is, the acceleration in the Y-axis direction Size; values[2] corresponds to the magnitude of the acceleration in the third direction, that is, the magnitude of the acceleration in the Z-axis direction. In addition, the magnitude of the vector sum of the accelerations in the three directions can be expressed by the following formula (6).
Figure PCTCN2020132271-appb-000006
Figure PCTCN2020132271-appb-000006
S21,从候选加速度中去除重力加速度,得到目标加速度。S21: Remove the gravitational acceleration from the candidate acceleration to obtain the target acceleration.
S21,若目标加速度大于预设加速度阈值,则执行根据目标加速度确定目标设备的位移参数的步骤。S21: If the target acceleration is greater than the preset acceleration threshold, perform the step of determining the displacement parameter of the target device according to the target acceleration.
三个方向上的加速度的向量和的大小为候选加速度。从候选加速度中去除重力加速度,得到目标加速度;若目标加速度大于预设加速度阈值,则根据目标加速度确定目标设备的位移参数。从候选加速度中去除重力加速度,得到目标加速度。通过目标设备的加速度传感器获取三个方向上的加速度时,也会获取到重力加速度,但重力加速度对判断目标设备是否发生移动时是干扰因素,因此需要去除重力加速度。由于重力加速度是已知的,因此可以根据候选加速度的值减去重力加速度的值,获取目标加速度。例如,若目标设备为手机,手机中一般都会安装有重力加速度传感器,用于测量手机三个方向上的重力加速度。根据三个方向上的重力加速度值获得目标重力加速度值。用候选加速度的值减去目标重力加速度的值,就可以获取到目标加速度。其中,由于用户的手举着目标设备的时候通常会有一定的抖动,或者目标设备的加速度传感器会有一定的误差,即使静止不动时所测量的 加速度值也是大于0。因此,若目标加速度大于预设加速度阈值,则执行根据目标加速度确定目标设备的位移参数的步骤;若目标加速度小于或者等于预设加速度阈值,则不执行根据目标加速度确定目标设备的位移参数的步骤,直接确定证件图像具有有效性。只有在目标加速度大于预设加速度阈值的情况下,才会确定目标设备发生了移动,否则有可能是目标设备的加速度传感器的误差或者用户轻微抖动产生的。需要说明的是,本申请实施例中的预设加速度阈值可以根据具体情况具体设置,本申请实施例不作限制。The magnitude of the vector sum of the accelerations in the three directions is the candidate acceleration. Remove the gravitational acceleration from the candidate acceleration to obtain the target acceleration; if the target acceleration is greater than the preset acceleration threshold, the displacement parameter of the target device is determined according to the target acceleration. Remove the gravitational acceleration from the candidate acceleration to obtain the target acceleration. When the acceleration in the three directions is acquired through the acceleration sensor of the target device, the gravitational acceleration will also be acquired, but the gravitational acceleration is an interference factor when determining whether the target device is moving, so the gravitational acceleration needs to be removed. Since the gravitational acceleration is known, the target acceleration can be obtained by subtracting the value of the gravitational acceleration from the value of the candidate acceleration. For example, if the target device is a mobile phone, a gravity acceleration sensor is generally installed in the mobile phone to measure the acceleration of gravity in three directions of the mobile phone. Obtain the target gravitational acceleration value according to the gravitational acceleration values in the three directions. The target acceleration can be obtained by subtracting the value of the target gravitational acceleration from the value of the candidate acceleration. Among them, since the user's hand usually jitters when holding the target device, or the acceleration sensor of the target device has a certain error, the measured acceleration value is greater than 0 even when it is stationary. Therefore, if the target acceleration is greater than the preset acceleration threshold, the step of determining the displacement parameter of the target device according to the target acceleration is executed; if the target acceleration is less than or equal to the preset acceleration threshold, the step of determining the displacement parameter of the target device according to the target acceleration is not executed , Directly confirm the validity of the credential image. Only when the target acceleration is greater than the preset acceleration threshold will it be determined that the target device has moved, otherwise it may be caused by an error in the acceleration sensor of the target device or a slight jitter of the user. It should be noted that the preset acceleration threshold in the embodiment of the present application may be specifically set according to specific conditions, and the embodiment of the present application does not limit it.
可选的,目标加速度为目标设备在预设时间段内的加速度,根据目标加速度确定目标设备的位移参数的方法可以为:根据预设时间段对目标加速度进行积分处理,得到目标设备的速度,根据预设时间段对目标设备的速度进行积分处理,得到目标设备的位移参数。Optionally, the target acceleration is the acceleration of the target device within a preset time period, and the method of determining the displacement parameter of the target device according to the target acceleration may be: integrating the target acceleration according to the preset time period to obtain the speed of the target device, The speed of the target device is integrated according to the preset time period to obtain the displacement parameter of the target device.
本申请实施例中的目标加速度为目标设备在预设时间内的加速度,由于加速度表示速度相对于时间的变化率,而速度本身又表示位移相对于时间的变化率。根据数学上的定义,加速度就是速度相对于时间的导数,速度就是位移相对于时间的导数。对位移进行两次求导获得加速度可以用如下公式(7)表示。The target acceleration in the embodiment of the present application is the acceleration of the target device within a preset time, because the acceleration represents the rate of change of the velocity with respect to time, and the velocity itself represents the rate of change of the displacement with respect to time. According to the mathematical definition, acceleration is the derivative of speed with respect to time, and speed is the derivative of displacement with respect to time. The acceleration obtained by deriving the displacement twice can be expressed by the following formula (7).
Figure PCTCN2020132271-appb-000007
Figure PCTCN2020132271-appb-000007
其中,公式(7)中的
Figure PCTCN2020132271-appb-000008
表示加速度,
Figure PCTCN2020132271-appb-000009
表示速度,
Figure PCTCN2020132271-appb-000010
表示位移,t表示时间。因此,可以根据预设时间对目标加速度进行积分处理,获得目标设备的速度。再根据预设时间对目标设备的速度进行积分处理,获得目标设备的位移参数。对加速度进行两次积分获得位移可以用如下公式(8)表示。
Among them, in formula (7)
Figure PCTCN2020132271-appb-000008
Represents acceleration,
Figure PCTCN2020132271-appb-000009
Represents speed,
Figure PCTCN2020132271-appb-000010
Represents displacement, t represents time. Therefore, the target acceleration can be integrated according to the preset time to obtain the speed of the target device. Then, the speed of the target device is integrated according to the preset time to obtain the displacement parameter of the target device. The displacement obtained by integrating the acceleration twice can be expressed by the following formula (8).
Figure PCTCN2020132271-appb-000011
Figure PCTCN2020132271-appb-000011
可选的,目标加速度包括目标设备在第一时间段的加速度和在第二时间段的加速度,第一时间段和所述第二时间段均属于所述预设时间段。可以根据第一时间段对第一时间段的加速度进行积分处理,获得第一候选速度;根据第二时间段对第二时间段的加速度进行积分处理,获得第二候选速度。获取第一候选速度与第二候选速度之间的差值的一半,若第一候选速度小于第二候选速度,则对上述差值的一半以及第一候选速度进行求和,获得第二时间段的速度;若第一候选速度大于或者等于第二候选速度,则对上述差值的一半以及第二候选速度进行求和,获得第一时间段的速度;根据第二时间段的速度或者第一时间段的速度确定目标设备的速度。Optionally, the target acceleration includes the acceleration of the target device in the first time period and the acceleration in the second time period, and both the first time period and the second time period belong to the preset time period. The acceleration of the first time period may be integrated according to the first time period to obtain the first candidate speed; the acceleration of the second time period may be integrated according to the second time period to obtain the second candidate speed. Get half of the difference between the first candidate speed and the second candidate speed. If the first candidate speed is less than the second candidate speed, then sum up half of the above difference and the first candidate speed to obtain the second time period If the first candidate speed is greater than or equal to the second candidate speed, then sum up half of the above difference and the second candidate speed to obtain the speed of the first time period; according to the speed of the second time period or the first The speed of the time period determines the speed of the target device.
如图4所示,为本申请实施例提供的一种进行积分处理的示意图,如图4所示,对预设时间段内的目标加速度进行积分处理时,相当于获取第一时间刻a、第二时间刻b、X轴,以及目标加速度在预设时间段所形成的曲线围成的曲边梯形的面积S。其中,X是指时间,Y是指加速度,第一时间刻a是指预设时间段的起始时间,第二时间刻b是指预设时间段的结束时间,f(x)是指目标加速度在预设时间段内所形成的曲线。其中,曲边梯形的面积S是指对目标加速度进行积分处理后得到的目标设备的速度。其中,如图5所示,为本申请实施例提供的一种对积分处理获得的区间进行划分的示意图,如图5所示,可以对曲边梯形的面积S进行划分,将曲边梯形的面积S划分成尽可能小的多个矩形面积,各个矩形的面积等于各个矩形面积对应的t n(第n个时间段)与f(n)(第n时间段的加速度)的乘积。获得各个矩形面积可以用如下公式(9)表示。 As shown in FIG. 4, a schematic diagram of integration processing provided by an embodiment of this application. As shown in FIG. The second time tick b, the X axis, and the area S of the curved trapezoid surrounded by the curve formed by the target acceleration in the preset time period. Among them, X refers to time, Y refers to acceleration, the first time tick a refers to the start time of the preset time period, the second time tick b refers to the end time of the preset time period, and f(x) refers to the target The curve formed by the acceleration in the preset time period. Among them, the area S of the curved trapezoid refers to the speed of the target device obtained after the target acceleration is integrated. Wherein, as shown in FIG. 5, a schematic diagram of dividing the interval obtained by the integration processing provided by this embodiment of the application. As shown in FIG. The area S is divided into a plurality of rectangular areas as small as possible, and the area of each rectangle is equal to the product of t n (the n-th time period) and f(n) (the acceleration in the n-th time period) corresponding to each rectangular area. The area of each rectangle can be expressed by the following formula (9).
S n=f(n)×Δt   (9) S n =f(n)×Δt (9)
S n是指第n个时间段的面积,f(n)是指第n个时间段的y值,即目标加速度,Δt是指第n时间段的时间长度。各个矩形面积对应的t n越小,则各个矩形的面积之和越接近曲边梯形的面积S。但是现有技术这种算法,会产生一定的误差。如图6所示,为本实施例提供的获取第二时间段的速度的示意图,如图6所示,若以现有技术中的算法对第二时间段 内的目标加速度进行积分处理,就会将第三部分的面积算入,而第三部分的面积是不属于第二时间段内的,因此需要将多余的第三部分的面积去除。如图6所示,第二时间段对应的目标加速度大于第一时间段对应的目标加速度,可以根据第一时间段对第一时间段内的目标加速度进行积分处理,获取第一时间段对应的第一候选速度,即矩形面积S1。第一时间段内的目标加速度可以是指该第一时间段内的加速度的平均值或者是指该第一时间段内的最高的加速度。同样的,根据第二时间段对第二时间段内的目标加速度进行积分处理,获得第二时间段对应的第二候选速度,第二时间段的目标加速度也可以是指该第二时间段内的加速度的平均值或者是指该第二时间段内的最高的加速度。获取第一时间段对应的第一候选速度与第二时间段对应的第二候选速度之间的差值的一半,如图6所示,第一时间段对应的第一候选速度与第二时间段对应的第二候选速度之间的差值是指第二时间段对应的矩形面积比第一时间段对应的矩形面积多的部分,即第二部分的面积与第三部分的面积之和。由于第一时间段对应的目标加速度小于第二时间段对应的目标加速度,因此第一时间段对应的第一候选速度小于第二时间段对应的第二候选速度。因此可以获取第一候选速度与第二候选速度之间的差值的一半,对第一候选速度与第二候选速度之间的差值的一半与第一候选速度进行求和,就可以获得第二时间段的速度,即第一部分的面积与第二部分的面积之和。以此对曲边梯形的面积S中的对个矩形面积进行积分处理,获得预设时间段内的目标设备的速度。 S n refers to the area of the nth time period, f(n) refers to the y value of the nth time period, that is, the target acceleration, and Δt refers to the time length of the nth time period. The smaller t n corresponding to the area of each rectangle is, the closer the sum of the area of each rectangle is to the area S of the curved trapezoid. However, this kind of algorithm in the prior art will produce certain errors. As shown in FIG. 6, a schematic diagram of obtaining the speed in the second time period provided by this embodiment. As shown in FIG. 6, if the target acceleration in the second time period is integrated by the algorithm in the prior art, then The area of the third part will be included, and the area of the third part does not belong to the second time period, so the excess area of the third part needs to be removed. As shown in Figure 6, the target acceleration corresponding to the second time period is greater than the target acceleration corresponding to the first time period. The target acceleration in the first time period can be integrated according to the first time period to obtain the target acceleration corresponding to the first time period. The first candidate speed is the rectangular area S1. The target acceleration in the first time period may refer to the average value of the acceleration in the first time period or the highest acceleration in the first time period. Similarly, the target acceleration in the second time period is integrated according to the second time period to obtain the second candidate speed corresponding to the second time period. The target acceleration in the second time period may also refer to the target acceleration in the second time period. The average value of acceleration or refers to the highest acceleration in the second time period. Obtain half of the difference between the first candidate speed corresponding to the first time period and the second candidate speed corresponding to the second time period, as shown in FIG. 6, the first candidate speed corresponding to the first time period and the second time period The difference between the second candidate speeds corresponding to the segments refers to the part where the rectangular area corresponding to the second time period is larger than the rectangular area corresponding to the first time period, that is, the sum of the area of the second part and the area of the third part. Since the target acceleration corresponding to the first time period is less than the target acceleration corresponding to the second time period, the first candidate speed corresponding to the first time period is less than the second candidate speed corresponding to the second time period. Therefore, half of the difference between the first candidate speed and the second candidate speed can be obtained, and the first candidate speed can be obtained by summing the half of the difference between the first candidate speed and the second candidate speed and the first candidate speed. The speed in the second time period, that is, the sum of the area of the first part and the area of the second part. In this way, the area of each rectangle in the area S of the curved trapezoid is integrated to obtain the speed of the target device within the preset time period.
如图7所示,为本实施例提供的一种获取第一时间段的速度的示意图,如图7所示,第二时间段对应的目标加速度小于第一时间段对应的目标加速度,可以根据第一时间段对第一时间段内的目标加速度进行积分处理,获取第一时间段对应的第一候选速度。同样的,根据第二时间段对第二时间段内的目标加速度进行积分处理,获得第二时间段对应的第二候选速度。获取第一时间段对应的第一候选速度与第二时间段对应的第二候选速度之间的差值的一半,如图7所示,第一时间段对应的第一候选速度与第二时间段对应的第二候选速度之间的差值是指第一时间段对应的矩形面积比第二时间段对应的矩形面积多的部分,即第二部分的面积与第三部分的面积之和。由于第一时间段对应的目标加速度大于第二时间段对应的目标加速度,因此第一时间段对应的第一候选速度大于第二时间段对应的第二候选速度。因此可以获取第一候选速度与第二候选速度之间的差值的一半,就可以获得第二部分的面积,对第一候选速度与第二候选速度之间的差值的一半与第二候选速度进行求和,就可以获得第一时间段的速度,即第一部分的面积与第二部分的面积之和。以此对曲边梯形的面积S中的对个矩形面积进行积分处理,获得预设时间段内的目标设备的速度。As shown in FIG. 7, a schematic diagram of obtaining the speed in the first time period provided by this embodiment. As shown in FIG. 7, the target acceleration corresponding to the second time period is less than the target acceleration corresponding to the first time period. The first time period performs integration processing on the target acceleration in the first time period to obtain the first candidate speed corresponding to the first time period. Similarly, the target acceleration in the second time period is integrated according to the second time period to obtain the second candidate speed corresponding to the second time period. Obtain half of the difference between the first candidate speed corresponding to the first time period and the second candidate speed corresponding to the second time period. As shown in FIG. 7, the first candidate speed corresponding to the first time period and the second time period The difference between the second candidate speeds corresponding to the segments refers to the part where the rectangular area corresponding to the first time segment is larger than the rectangular area corresponding to the second time segment, that is, the sum of the area of the second part and the area of the third part. Since the target acceleration corresponding to the first time period is greater than the target acceleration corresponding to the second time period, the first candidate speed corresponding to the first time period is greater than the second candidate speed corresponding to the second time period. Therefore, half of the difference between the first candidate speed and the second candidate speed can be obtained, and the area of the second part can be obtained. By summing the speeds, the speed of the first time period can be obtained, that is, the sum of the area of the first part and the area of the second part. In this way, the area of each rectangle in the area S of the curved trapezoid is integrated to obtain the speed of the target device within the preset time period.
可选的,目标设备的速度包括目标设备在第一时间段的速度和在第二时间段的速度,获得预设时间段内目标设备的速度后,对目标设备的速度进行积分处理,获得预设时间段内目标设备的位移参数的方法可以为:根据第一时间段对第一时间段的速度进行积分处理,获得第一候选位移;根据第二时间段对第二时间段的速度进行积分处理,获得第二候选位移;获取第一候选位移与第二候选位移之间的差值的一半;若第一候选位移小于第二候选位移,则对差值以及第一候选位移进行求和,获得第二时间段的位移;若第一候选位移大于或者等于第二候选位移,则对差值以及第二候选位移进行求和,获得第一时间段的位移;根据第二时间段的位移或者第一时间段的位移确定目标设备的位移参数。Optionally, the speed of the target device includes the speed of the target device in the first time period and the speed in the second time period. After the speed of the target device in the preset time period is obtained, the speed of the target device is integrated to obtain the preset speed. The method of setting the displacement parameter of the target device in the time period can be: integrating the speed of the first time period according to the first time period to obtain the first candidate displacement; and integrating the speed of the second time period according to the second time period Process to obtain the second candidate displacement; obtain half of the difference between the first candidate displacement and the second candidate displacement; if the first candidate displacement is less than the second candidate displacement, sum the difference and the first candidate displacement, Obtain the displacement in the second time period; if the first candidate displacement is greater than or equal to the second candidate displacement, sum the difference and the second candidate displacement to obtain the displacement in the first time period; according to the displacement in the second time period or The displacement in the first time period determines the displacement parameter of the target device.
同样的,可以参看根据预设时间段对目标加速度进行积分处理,得到目标设备的速度的处理方法,根据预设时间段对目标设备的速度进行积分处理,得到目标设备的位移参数。根据第一时间段对第一时间段内的速度进行积分处理,获得第一时间段对应的第一候选位移,根据第二时间段对第二时间段的速度进行积分处理,获得第二时间段对应的第二候选位移。并获取第一候选位移与第二候选位移之间的差值的一半。若第一候选位移大于第二候选位移,即根据第一时间段对第一时间段的速度进行积分处理得到的面积大于根据第二 时间段对第二时间段的速度进行积分处理得到的面积,则对第一候选位移与第二候选位移之间的差值的一半与第二时间段对应的第二候选位移进行求和,获得第一时间段的位移。若第一候选位移小于第二候选位移,即根据第一时间段对第一时间段的速度进行积分处理得到的面积小于根据第二时间段对第二时间段的速度进行积分处理得到的面积,则对第一候选位移与第二候选位移之间的差值的一半与第一时间段对应的第一候选位移进行求和,获得第二时间段的位移。以此对预设时间段的速度进行积分处理,获得目标设备的位移参数。Similarly, you can refer to the processing method of integrating the target acceleration according to the preset time period to obtain the speed of the target device, and integrating the speed of the target device according to the preset time period to obtain the displacement parameter of the target device. Perform integration processing on the speed in the first time period according to the first time period to obtain the first candidate displacement corresponding to the first time period, and perform integration processing on the speed in the second time period according to the second time period to obtain the second time period The corresponding second candidate displacement. And obtain half of the difference between the first candidate displacement and the second candidate displacement. If the first candidate displacement is greater than the second candidate displacement, that is, the area obtained by integrating the speed of the first time period according to the first time period is larger than the area obtained by integrating the speed of the second time period according to the second time period, Then, half of the difference between the first candidate displacement and the second candidate displacement is summed with the second candidate displacement corresponding to the second time period to obtain the displacement of the first time period. If the first candidate displacement is smaller than the second candidate displacement, that is, the area obtained by integrating the speed of the first time period according to the first time period is smaller than the area obtained by integrating the speed of the second time period according to the second time period, Then, half of the difference between the first candidate displacement and the second candidate displacement is summed with the first candidate displacement corresponding to the first time period to obtain the displacement of the second time period. In this way, the speed of the preset time period is integrated, and the displacement parameter of the target device is obtained.
S104,根据目标设备的位移参数验证证件图像的有效性。S104: Verify the validity of the credential image according to the displacement parameter of the target device.
S105,若证件图像具有有效性,则根据证件图像对目标证件的合法性进行验证。S105: If the credential image is valid, verify the legitimacy of the target credential based on the credential image.
S106,若证件图像不具有有效性,则输出提示信息,提示信息用于提示对目标证件进行重新拍摄。S106: If the credential image is not valid, output prompt information, which is used to prompt to re-shoot the target credential.
可以根据目标设备的位移参数的值验证证件图像的有效性,证件图像的有效性是指目标设备在拍摄目标证件的时候是否发生目标证件被替换的情况,目标证件被替换是指目标设备的拍摄界面转移到其他证件上,即目标设备的拍摄界面中包含其他证件,而不包含目标证件。证件图像具有有效性是指目标证件没有被替换,即是目标设备对目标证件拍摄得到的证件图像,可以用对目标证件拍摄得到的证件图像对目标证件的合法性进行验证。若证件图像不具有有效性,即是目标设备的拍摄界面转移到其他证件上,对其他证件进行拍摄到的证件图像,则目标证件被替换,不能根据拍摄得到的证件图像对目标证件的合法性进行验证,以此可以验证目标证件是否被替换。若证件图像不具有有效性,则输出提示信息,该提示信息用于提示用户对目标证件进行重新拍摄,以此可以提高对目标证件合法性验证的准确性。The validity of the document image can be verified according to the value of the displacement parameter of the target device. The validity of the document image refers to whether the target document is replaced when the target device is shooting the target document. The replacement of the target document refers to the shooting of the target device The interface is transferred to other documents, that is, the shooting interface of the target device contains other documents but not the target document. The validity of the document image means that the target document has not been replaced, that is, the document image obtained by shooting the target document by the target device, and the legality of the target document can be verified by the document image obtained by shooting the target document. If the document image is not valid, that is, the photographing interface of the target device is transferred to another document, and the document image captured by the other document is replaced, and the legality of the target document cannot be determined based on the photographed document image. Perform verification to verify whether the target certificate has been replaced. If the credential image is not valid, a prompt message is output, and the prompt message is used to prompt the user to re-shoot the target credential, so as to improve the accuracy of verifying the legitimacy of the target credential.
在本申请实施例中,通过在目标设备对目标证件进行拍摄的过程中,获取目标设备的目标加速度;根据目标设备的目标加速度确定所述目标设备的位移参数。同时,确定目标加速度是否大于第一加速度阈值,若目标加速度大于第一加速度阈值,则根据目标设备的目标加速度确定所述目标设备的位移参数,以此可以减少目标设备本身的缺陷所带来的误差。根据目标设备的位移参数验证证件图像的有效性,即根据目标设备的位移参数验证目标证件是否被替换;若证件图像具有有效性,即目标设备是对目标证件进行拍摄得到证件图像,则根据证件图像对所述目标证件的合法性进行验证;若证件图像不具有有效性,即目标设备转移到其他证件,对其他证件进行拍摄得到证件图像的,目标证件被替换成其他证件,则输出提示信息,所述提示信息用于提示对所述目标证件进行重新拍摄,以此可以避免目标证件被替换而影响对证件图像的验证,可以提高对目标证件的合法性验证的准确性。In the embodiment of the present application, the target acceleration of the target device is obtained during the process of the target device photographing the target certificate; the displacement parameter of the target device is determined according to the target acceleration of the target device. At the same time, it is determined whether the target acceleration is greater than the first acceleration threshold. If the target acceleration is greater than the first acceleration threshold, the displacement parameter of the target device is determined according to the target acceleration of the target device, so as to reduce the defects caused by the target device itself error. Verify the validity of the document image according to the displacement parameter of the target device, that is, verify whether the target document is replaced according to the displacement parameter of the target device; The image verifies the legality of the target document; if the document image is not valid, that is, the target device is transferred to another document, and the other document is photographed to obtain the document image, and the target document is replaced with another document, a prompt message will be output The prompt information is used to prompt to re-shoot the target certificate, so as to avoid the target certificate being replaced and affect the verification of the certificate image, and the accuracy of the legality verification of the target certificate can be improved.
如图8所示,为本实施例提供的另一种证件验证方法的流程示意图,如图8所示,该另一种证件验证方法的流程示意图包括步骤S201-S209。As shown in FIG. 8, it is a schematic flowchart of another certificate verification method provided by this embodiment. As shown in FIG. 8, the schematic flowchart of another certificate verification method includes steps S201-S209.
S201,在目标设备对目标证件进行拍摄的过程中,获取目标设备的目标加速度。S201: Acquire the target acceleration of the target device during the process of the target device photographing the target certificate.
S202,获取目标设备对目标证件进行拍摄得到的证件图像。S202: Acquire a credential image obtained by shooting the target credential by the target device.
S203,根据目标设备的目标加速度确定目标设备的位移参数。S203: Determine a displacement parameter of the target device according to the target acceleration of the target device.
本申请实施例中步骤S201-S203的具体内容可以参看图1实施例阐述的内容,在此不再累述。For the specific content of steps S201-S203 in the embodiment of the present application, please refer to the content illustrated in the embodiment of FIG. 1, which will not be repeated here.
S204,判断目标设备的位移参数是否大于预设位移阈值。S204: Determine whether the displacement parameter of the target device is greater than a preset displacement threshold.
S205,若目标设备的位移参数小于或者等于预设位移阈值,则证件图像具有有效性。S205: If the displacement parameter of the target device is less than or equal to the preset displacement threshold, the credential image is valid.
S206,若证件图像具有有效性,则根据证件图像对目标证件的合法性进行验证。S206: If the credential image is valid, verify the legitimacy of the target credential according to the credential image.
获得目标设备的位移参数后,判断目标设备的位移参数是否大于预设位移阈值,若目标设备的位移参数小于或者等于预设位移阈值,则说明目标设备移动的距离比较小,属于 用户正常的移动范围,如用户的手抖动等等,则证件图像具有有效性。若证件图像具有有效性,则说明该证件图像是对目标证件拍摄得到的,目标证件没有被替换,因此可以根据证件图像对目标证件的合法性进行验证。After obtaining the displacement parameter of the target device, determine whether the displacement parameter of the target device is greater than the preset displacement threshold. If the displacement parameter of the target device is less than or equal to the preset displacement threshold, it means that the distance of the target device is relatively small, which is a normal movement of the user Range, such as the user’s hand shaking, etc., the ID image is valid. If the credential image is valid, it means that the credential image was taken from the target credential, and the target credential has not been replaced. Therefore, the legitimacy of the credential can be verified based on the credential image.
可选的,可以从证件图像中提取出目标特征信息,获取关于证件的样本证件图像的样本特征信息集合,将目标特征信息与样本特征信息集合中的样本特征信息进行匹配。若目标特征信息与样本特征信息集合中的目标样本特征信息匹配,则确定目标证件具有合法性;若目标特征信息与样本特征信息集合中的任一样本特征信息不匹配,则确定目标证件不具有合法性。Optionally, the target feature information can be extracted from the credential image, the sample feature information set of the sample credential image about the credential can be obtained, and the target feature information can be matched with the sample feature information in the sample feature information set. If the target characteristic information matches the target sample characteristic information in the sample characteristic information set, the target certificate is determined to be legitimized; if the target characteristic information does not match any sample characteristic information in the sample characteristic information set, it is determined that the target certificate does not have legality.
可以从目标证件对应的证件图像中提取出目标特征信息,该目标特征信息可以是指证件图像中的多个特征信息,如字符特征信息、颜色特征信息或者图案特征信息等等,获取关于证件的样本图像的样本特征信息集合。将证件图像中的目标特征信息与样本特征信息集合中的样本特征信息进行匹配,若证件图像的目标特征信息与样本特征信息集合中的目标样本特征信息均匹配,则确定目标证件具有合法性。若目标特征信息与样本特征信息集合中的任一样本特征信息不匹配,则确定目标证件不具有合法性。如可以训练出字符识别神经网络模型,根据字符识别神经网络模型将证件图像中的字符特征信息与样本特征信息集合中的样本特征信息进行匹配,若目标特征信息与样本特征信息集合中的目标样本特征信息匹配,则确定目标证件具有合法性。若目标特征信息与样本特征信息集合中的任一样本特征信息不匹配,则确定目标证件不具有合法性。The target characteristic information can be extracted from the document image corresponding to the target document. The target characteristic information can refer to multiple characteristic information in the document image, such as character characteristic information, color characteristic information or pattern characteristic information, etc., to obtain information about the document The sample feature information collection of the sample image. The target feature information in the credential image is matched with the sample feature information in the sample feature information set. If the target feature information of the credential image matches the target sample feature information in the sample feature information set, it is determined that the target credential has legitimacy. If the target characteristic information does not match any sample characteristic information in the sample characteristic information set, it is determined that the target certificate is not legal. For example, a character recognition neural network model can be trained, and the character feature information in the document image can be matched with the sample feature information in the sample feature information set according to the character recognition neural network model. If the target feature information matches the target sample in the sample feature information set If the characteristic information matches, it is determined that the target document is legal. If the target characteristic information does not match any sample characteristic information in the sample characteristic information set, it is determined that the target certificate is not legal.
可选的,可以通过对候选信息验证模型进行训练,获得目标信息验证模型,根据目标信息验证对目标证件的合法性进行验证。具体的,可以获取候选信息验证模型以及待验证的证件图像对应的目标特征信息,以及关于证件的样本证件图像对应的样本特征信息集合,以及该待验证证件图像对应的目标验证结果。采用候选信息验证模型验证样本特征信息集合中是否存在与目标特征信息匹配的样本特征信息,获取预测验证结果,该预测验证结果包括不存在与目标特征信息匹配的样本特征信息,或者存在与目标特征信息匹配的样本特征信息。根据上述预测验证结果与目标验证结果对候选信息验证模型进行调整,获得目标信息验证模型。Optionally, the candidate information verification model can be trained to obtain the target information verification model, and the legitimacy of the target certificate can be verified according to the target information verification. Specifically, the candidate information verification model and the target feature information corresponding to the credential image to be verified, the sample feature information set corresponding to the sample credential image of the credential, and the target verification result corresponding to the credential image to be verified can be obtained. The candidate information verification model is used to verify whether there is sample feature information matching the target feature information in the sample feature information set, and obtain the predictive verification result. The predictive verification result includes the absence of sample feature information that matches the target feature information, or the existence of the target feature information Information matching sample feature information. The candidate information verification model is adjusted according to the prediction verification result and the target verification result, and the target information verification model is obtained.
可选的,可以根据上述预测验证结果与目标验证结果,确定候选信息验证模型的损失值,若候选信息验证模型的损失值不满足收敛条件,则根据候选信息验证模型的损失值对所述候选信息验证模型进行调整,得到所述目标信息验证模型。Optionally, the loss value of the candidate information verification model can be determined based on the aforementioned prediction verification result and the target verification result. If the loss value of the candidate information verification model does not meet the convergence condition, the candidate information verification model is compared with the loss value of the candidate information verification model. The information verification model is adjusted to obtain the target information verification model.
若候选信息验证模型的损失值不满足收敛条件,即候选信息验证模型的损失值大于预设阈值,则说明候选信息验证模型对证件图像中目标特征信息的验证的正确率较低。可以根据候选信息验证模型的损失值对候选信息模型进行调整,如收集候选信息验证模型对证件图像中目标特征信息的验证的误判因素,调整证件图像中目标特征信息与样本特征信息集合之间的对应关系,从而对候选信息验证模型进行调整,得到目标信息验证模型。若候选信息验证模型的损失值满足收敛条件,即候选信息验证模型的损失值小于预设阈值,则说明候选信息验证模型对证件图像中目标特征信息的验证的正确率较高,则将候选信息验证模型确定为目标信息验证模型。If the loss value of the candidate information verification model does not meet the convergence condition, that is, the loss value of the candidate information verification model is greater than the preset threshold, it means that the candidate information verification model has a low accuracy in verifying the target feature information in the document image. The candidate information model can be adjusted according to the loss value of the candidate information verification model, such as collecting the misjudgment factors for the verification of the target feature information in the document image by the candidate information verification model, and adjusting the difference between the target feature information in the document image and the sample feature information set Therefore, the candidate information verification model is adjusted to obtain the target information verification model. If the loss value of the candidate information verification model satisfies the convergence condition, that is, the loss value of the candidate information verification model is less than the preset threshold, it means that the candidate information verification model has a high correct rate of verifying the target feature information in the document image, then the candidate information The verification model is determined as the target information verification model.
S207,若目标设备的位移参数大于预设位移阈值,则证件图像不具有有效性。S207: If the displacement parameter of the target device is greater than the preset displacement threshold, the credential image is not valid.
S208,若证件图像不具有有效性,则输出提示信息,提示信息用于提示对目标证件进行重新拍摄。S208: If the credential image is not valid, output prompt information, which is used to prompt to re-shoot the target credential.
若目标设备的位移参数大于预设位移阈值,则说明用户移动目标设备移动的距离比较大,不属于用户正常的移动范围,如用户将目标设备移动到另一张证件的位置。则说明该证件图像不是对目标证件拍摄得到的,而可能是对另一个证件拍摄得到的,则证件图像不具有有效性,不能根据该证件图像验证目标证件的合法性,否则将会影响目标证件验证的 准确性。若目标证件不具有有效性,则不能根据拍摄得到的证件图像对目标证件的合法性进行验证,则输出提示信息,即要求用户重新拍摄的提示信息,以使用户对目标证件进行重新拍摄。如香港身份证鉴伪时,需要三个角度(正角度,前倾,后倾)共四张图片,其中第一个角度需要两张,第一张证件图像是关闭闪光灯对目标证件进行拍摄得到,第二张证件图像是开启闪光灯对目标证件进行拍摄得到。由于第二证件图像拍摄时需要开启闪光灯,若目标设备的位移参数大于预设位移阈值,目标设备在对第二张证件图像进行拍摄时,转移到其他证件,对其他证件拍摄获得,这样拍摄得到的第二张证件图像就不是对目标证件拍摄获得的,强光下替换后的证件图像与之前的证件图像从算法的角度看差别不明显,这样会影响验证的成功率。这是因为强光下证件图像曝光过度丢失很多像素信息,算法很难通过计算证件图像的像素信息得到第二张证件图像是否被替换了。若对根据其他证件拍摄获得的第二张证件图像对目标证件的合法性进行验证,将会影响目标证件验证的准确性,从而影响目标证件验证的成功率。因此,若证件图像不具有有效性,则输出提示信息,要求用户对目标证件进行重新拍摄,即重新从第一张证件图像进行拍摄。If the displacement parameter of the target device is greater than the preset displacement threshold, it means that the distance the user moves the target device is relatively large and does not belong to the user's normal range of movement. For example, the user moves the target device to the location of another certificate. It means that the document image is not taken from the target document, but may be taken from another document. The document image is not valid, and the legality of the target document cannot be verified based on the document image, otherwise it will affect the target document Verification of accuracy. If the target certificate is not valid, the legality of the target certificate cannot be verified based on the captured certificate image, and a prompt message is output, that is, a prompt message that requires the user to re-shoot, so that the user can re-shoot the target certificate. For example, when authenticating a Hong Kong ID card, a total of four pictures are required from three angles (positive angle, forward tilt, backward tilt), of which two are required for the first angle. The first document image is obtained by shooting the target document with the flash off. , The second ID image is obtained by shooting the target ID with the flash. Since the flashlight needs to be turned on when the second ID image is taken, if the displacement parameter of the target device is greater than the preset displacement threshold, when the target device takes the second ID image, it transfers to other IDs and takes the other IDs to obtain the result. The second credential image of is not obtained by shooting the target credential. The credential image after replacement under strong light is not significantly different from the previous credential image from the point of view of the algorithm, which will affect the success rate of verification. This is because the document image is overexposed under strong light and loses a lot of pixel information. It is difficult for the algorithm to calculate whether the second document image has been replaced by calculating the pixel information of the document image. If the validity of the target document is verified on the second document image obtained from other documents, it will affect the accuracy of the target document verification, and thus affect the success rate of the target document verification. Therefore, if the credential image is not valid, a prompt message is output to request the user to re-shoot the target credential, that is, to re-shoot the first credential image.
需知,本申请可适用于数字医疗、智慧医疗领域,可以对医保卡、社保卡证件进行验证,从而进一步杜绝不正当使用社保医保卡的行为,有利于医疗社保卡系统的管理。It should be noted that this application can be applied to the fields of digital medical and smart medical care, and can verify medical insurance cards and social security card certificates, so as to further prevent improper use of social security medical insurance cards, which is conducive to the management of the medical social security card system.
在本申请实施例中,通过在目标设备对目标证件进行拍摄的过程中,获取目标设备的目标加速度;根据目标设备的目标加速度确定所述目标设备的位移参数。同时,确定目标加速度是否大于第一加速度阈值,若目标加速度大于第一加速度阈值,则根据目标设备的目标加速度确定所述目标设备的位移参数,以此可以减少目标设备本身的缺陷所带来的误差。根据目标设备的位移参数验证证件图像的有效性,即根据目标设备的位移参数验证目标证件是否被替换;若证件图像具有有效性,即目标设备是对目标证件进行拍摄得到证件图像,则根据证件图像对所述目标证件的合法性进行验证;若证件图像不具有有效性,即目标设备转移到其他证件,对其他证件进行拍摄得到证件图像的,目标证件被替换成其他证件,则输出提示信息,所述提示信息用于提示对所述目标证件进行重新拍摄,以此可以避免目标证件被替换而影响对证件图像的验证,可以提高对目标证件的合法性验证的准确性。In the embodiment of the present application, the target acceleration of the target device is obtained during the process of the target device photographing the target certificate; the displacement parameter of the target device is determined according to the target acceleration of the target device. At the same time, it is determined whether the target acceleration is greater than the first acceleration threshold. If the target acceleration is greater than the first acceleration threshold, the displacement parameter of the target device is determined according to the target acceleration of the target device, so as to reduce the defects caused by the target device itself error. Verify the validity of the document image according to the displacement parameter of the target device, that is, verify whether the target document is replaced according to the displacement parameter of the target device; The image verifies the legality of the target document; if the document image is not valid, that is, the target device is transferred to another document, and the other document is photographed to obtain the document image, and the target document is replaced with another document, a prompt message will be output The prompt information is used to prompt to re-shoot the target certificate, so as to avoid the target certificate being replaced and affect the verification of the certificate image, and the accuracy of the legality verification of the target certificate can be improved.
请参见图9,是本申请实施例提供的一种证件验证装置的结构示意图,本申请实施例的所述装置可以在上述提及的电子设备中。本实施例中,该证件验证装置包括以:Please refer to FIG. 9, which is a schematic structural diagram of a credential verification device provided in an embodiment of the present application. The device in the embodiment of the present application may be in the above-mentioned electronic device. In this embodiment, the certificate verification device includes:
第一获取模块11,用于在目标设备对目标证件进行拍摄的过程中,获取所述目标设备的目标加速度;在所述目标设备对所述目标证件进行拍摄之前,所述目标设备的位置信息与所述目标证件的位置信息处于对齐状态;The first acquisition module 11 is configured to acquire the target acceleration of the target device during the process of shooting the target certificate by the target device; before the target device shoots the target certificate, the location information of the target device Is in alignment with the position information of the target certificate;
第二获取模块12,用于获取所述目标设备对所述目标证件进行拍摄得到的证件图像;The second acquiring module 12 is configured to acquire a credential image obtained by shooting the target credential by the target device;
确定模块13,用于根据所述目标设备的目标加速度确定所述目标设备的位移参数;The determining module 13 is configured to determine the displacement parameter of the target device according to the target acceleration of the target device;
其中,所述目标设备的目标加速度包括第一方向上的加速度、第二方向上的加速度以及第三方向上的加速度;上述装置还包括:Wherein, the target acceleration of the target device includes acceleration in the first direction, acceleration in the second direction, and acceleration in the third direction; the above device further includes:
求和处理模块,用于对所述第一方向上的加速度、所述第二方向上的加速度以及所述第三方向上的加速度进行求和处理,得到候选加速度;A summation processing module, configured to perform summation processing on the acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction to obtain a candidate acceleration;
去除模块,用于从所述候选加速度中去除重力加速度,得到目标加速度;A removing module, used to remove the gravitational acceleration from the candidate acceleration to obtain the target acceleration;
执行模块,用于若所述目标加速度大于预设加速度阈值,则执行所述根据所述目标加速度确定所述目标设备的位移参数的步骤。The execution module is configured to execute the step of determining the displacement parameter of the target device according to the target acceleration if the target acceleration is greater than a preset acceleration threshold.
其中,所述目标加速度为所述目标设备在预设时间段内的加速度;Wherein, the target acceleration is the acceleration of the target device in a preset time period;
上述确定模块13还包括:第一积分处理单元、第二积分处理单元。The above determination module 13 further includes: a first integration processing unit and a second integration processing unit.
第一积分处理单元,用于根据所述预设时间段对所述目标加速度进行积分处理,得到所述目标设备的速度;A first integration processing unit, configured to perform integration processing on the target acceleration according to the preset time period to obtain the speed of the target device;
第二积分处理单元,用于根据所述预设时间段对所述目标设备的速度进行积分处理,得到所述目标设备的位移参数。The second integration processing unit is configured to perform integration processing on the speed of the target device according to the preset time period to obtain the displacement parameter of the target device.
其中,所述目标加速度包括所述目标设备在第一时间段的加速度和目标设备在第二时间段的加速度,所述第一时间段和所述第二时间段均属于所述预设时间段;Wherein, the target acceleration includes the acceleration of the target device in a first time period and the acceleration of the target device in a second time period, and both the first time period and the second time period belong to the preset time period ;
上述第一积分处理单元具体用于:The above-mentioned first integral processing unit is specifically used for:
根据所述第一时间段对所述第一时间段的加速度进行积分处理,获得第一候选速度;Performing integration processing on the acceleration in the first time period according to the first time period to obtain a first candidate speed;
根据所述第二时间段对所述第二时间段的加速度进行积分处理,获得第二候选速度;Performing integration processing on the acceleration in the second time period according to the second time period to obtain a second candidate speed;
获取所述第一候选速度与所述第二候选速度之间的差值的一半;Acquiring half of the difference between the first candidate speed and the second candidate speed;
若所述第一候选速度小于所述第二候选速度,则对所述差值的一半以及所述第一候选速度进行求和,获得所述第二时间段的速度;If the first candidate speed is less than the second candidate speed, sum half of the difference and the first candidate speed to obtain the speed in the second time period;
若所述第一候选速度大于或者等于所述第二候选速度,则对所述差值的一半以及所述第二候选速度进行求和,获得所述第一时间段的速度;If the first candidate speed is greater than or equal to the second candidate speed, sum half of the difference and the second candidate speed to obtain the speed in the first time period;
根据所述第二时间段的速度或者所述第一时间段的速度确定所述目标设备的速度。The speed of the target device is determined according to the speed of the second time period or the speed of the first time period.
其中,所述目标设备的速度包括所述目标设备在所述第一时间段的速度和目标设备在所述第二时间段的速度;Wherein, the speed of the target device includes the speed of the target device in the first time period and the speed of the target device in the second time period;
上述第二积分处理单元具体用于:The above-mentioned second integral processing unit is specifically used for:
根据所述第一时间段对所述第一时间段的速度进行积分处理,获得第一候选位移;Performing integration processing on the velocity in the first time period according to the first time period to obtain a first candidate displacement;
根据所述第二时间段对所述第二时间段的速度进行积分处理,获得第二候选位移;Performing integration processing on the velocity in the second time period according to the second time period to obtain a second candidate displacement;
获取所述第一候选位移与所述第二候选位移之间的差值的一半;Obtaining half of the difference between the first candidate displacement and the second candidate displacement;
若所述第一候选位移小于所述第二候选位移,则对所述差值的一半以及所述第一候选位移进行求和,获得所述第二时间段的位移;If the first candidate displacement is smaller than the second candidate displacement, sum up half of the difference and the first candidate displacement to obtain the displacement in the second time period;
若所述第一候选位移大于或者等于所述第二候选位移,则对所述差值的一半以及所述第二候选位移进行求和,获得所述第一时间段的位移;If the first candidate displacement is greater than or equal to the second candidate displacement, sum half of the difference and the second candidate displacement to obtain the displacement in the first time period;
根据所述第二时间段的位移或者所述第一时间段的位移确定所述目标设备的位移参数。The displacement parameter of the target device is determined according to the displacement in the second time period or the displacement in the first time period.
第一验证模块14,用于根据所述目标设备的位移参数验证所述证件图像的有效性;The first verification module 14 is configured to verify the validity of the credential image according to the displacement parameter of the target device;
其中,上述第一验证模块14包括:判断单元、第二确定单元、第三确定单元。Wherein, the above-mentioned first verification module 14 includes: a judgment unit, a second determination unit, and a third determination unit.
判断单元,用于判断所述目标设备的位移参数是否大于预设位移阈值;A judging unit for judging whether the displacement parameter of the target device is greater than a preset displacement threshold;
第一确定单元,用于若所述目标设备的位移参数小于或者等于预设位移阈值,则确定所述证件图像具有有效性;The first determining unit is configured to determine that the credential image is valid if the displacement parameter of the target device is less than or equal to a preset displacement threshold;
第二确定单元,用于若所述目标设备的位移参数大于所述预设位移阈值,则所述确定证件图像不具有有效性。The second determining unit is configured to determine that the document image is not valid if the displacement parameter of the target device is greater than the preset displacement threshold.
第二验证模块15,用于若所述证件图像具有有效性,则根据所述证件图像对所述目标证件的合法性进行验证;The second verification module 15 is configured to verify the legality of the target certificate according to the certificate image if the certificate image is valid;
其中,上述第二验证模块15包括:提取单元、获取单元、匹配单元、第四确定单元、第五确定单元。Wherein, the above-mentioned second verification module 15 includes: an extraction unit, an acquisition unit, a matching unit, a fourth determination unit, and a fifth determination unit.
提取单元,用于从所述证件图像中提取出目标特征信息;An extraction unit for extracting target feature information from the document image;
获取单元,用于获取关于证件的样本证件图像对应的样本特征信息集合;The obtaining unit is used to obtain the sample feature information set corresponding to the sample credential image of the credential;
匹配单元,用于将所述目标特征信息与所述样本特征信息集合中的样本特征信息进行匹配;A matching unit, configured to match the target feature information with the sample feature information in the sample feature information set;
第三确定单元,用于若所述目标特征信息与所述样本特征信息集合中的目标样本特征信息匹配,则确定所述目标证件具有合法性;The third determining unit is configured to determine that the target document is legal if the target characteristic information matches the target sample characteristic information in the sample characteristic information set;
第四确定单元,用于若所述目标特征信息与所述样本特征信息集合中的任一样本特征信息不匹配,则确定所述目标证件不具有合法性。The fourth determining unit is configured to determine that the target certificate does not have legitimacy if the target characteristic information does not match any sample characteristic information in the sample characteristic information set.
输出模块16,用于若所述证件图像不具有有效性,则输出提示信息,所述提示信息用 于提示对所述目标证件进行重新拍摄。The output module 16 is configured to output prompt information if the credential image is not valid, and the prompt information is used to prompt to re-shoot the target credential.
请参见图10,是本申请实施例提供的一种电子设备的结构示意图。可选的,该电子设备可以包括处理器、存储器以及网络接口;所述处理器与存储器、网络接口相连,其中,网络接口用于提供数据通信功能,所述存储器用于存储程序代码(或程序指令),所述处理器用于调用所述程序代码,以执行上述实施例中的方法。或者,可选的,如图10所示的本实施例中的电子设备可以包括:一个或多个处理器21;一个或多个输入装置22,一个或多个输出装置23和存储器24。上述处理器21、输入装置22、输出装置23和存储器24通过总线25连接。Refer to FIG. 10, which is a schematic structural diagram of an electronic device according to an embodiment of the present application. Optionally, the electronic device may include a processor, a memory, and a network interface; the processor is connected to the memory and the network interface, wherein the network interface is used to provide data communication functions, and the memory is used to store program codes (or program codes). Instruction), the processor is used to call the program code to execute the method in the foregoing embodiment. Or, optionally, the electronic device in this embodiment as shown in FIG. 10 may include: one or more processors 21; one or more input devices 22, one or more output devices 23, and a memory 24. The aforementioned processor 21, input device 22, output device 23, and memory 24 are connected by a bus 25.
所处理器21可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 21 may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (ASICs). ), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
输入装置22可以包括触控板、指纹采传感器(用于采集用户的指纹信息和指纹的方向信息)、麦克风等,输出装置23可以包括显示器(LCD等)、扬声器等,输出装置23可以输出校正处理后的数据表。The input device 22 may include a touch panel, a fingerprint sensor (used to collect user fingerprint information and fingerprint orientation information), a microphone, etc., the output device 23 may include a display (LCD, etc.), a speaker, etc., and the output device 23 may output calibration The processed data sheet.
该存储器24可以包括只读存储器和随机存取存储器,并向处理器21提供指令和数据。存储器24的一部分还可以包括非易失性随机存取存储器,存储器24用于存储计算机程序,所述计算机程序包括程序指令,处理器21用于执行存储器24存储的程序指令,以用于执行一种证件验证方法。The memory 24 may include a read-only memory and a random access memory, and provides instructions and data to the processor 21. A part of the memory 24 may also include a non-volatile random access memory. The memory 24 is used to store a computer program. The computer program includes program instructions. The processor 21 is used to execute the program instructions stored in the memory 24 to execute a program. A method of certificate verification.
可选的,处理器21用于执行存储器24存储的程序指令,用于执行以下操作:Optionally, the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
在目标设备对目标证件进行拍摄的过程中,获取所述目标设备的目标加速度;在所述目标设备对所述目标证件进行拍摄之前,所述目标设备的位置信息与所述目标证件的位置信息处于对齐状态;During the process of the target device photographing the target certificate, the target acceleration of the target device is acquired; before the target device photographs the target certificate, the position information of the target device and the position information of the target certificate In alignment
获取所述目标设备对所述目标证件进行拍摄得到的证件图像;Acquiring a credential image obtained by shooting the target credential by the target device;
根据所述目标设备的目标加速度确定所述目标设备的位移参数;Determining the displacement parameter of the target device according to the target acceleration of the target device;
根据所述目标设备的位移参数验证所述证件图像的有效性;Verify the validity of the credential image according to the displacement parameter of the target device;
若所述证件图像具有有效性,则根据所述证件图像对所述目标证件的合法性进行验证;If the credential image is valid, verify the legitimacy of the target credential according to the credential image;
若所述证件图像不具有有效性,则输出提示信息,所述提示信息用于提示对所述目标证件进行重新拍摄。If the credential image is not valid, a prompt message is output, and the prompt information is used to prompt to re-shoot the target credential.
可选的,处理器21用于执行存储器24存储的程序指令,用于执行以下操作:Optionally, the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
对所述第一方向上的加速度、所述第二方向上的加速度以及所述第三方向上的加速度进行求和处理,得到候选加速度;Performing summation processing on the acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction to obtain a candidate acceleration;
从所述候选加速度中去除重力加速度,得到目标加速度;Remove the gravitational acceleration from the candidate acceleration to obtain the target acceleration;
若所述目标加速度大于预设加速度阈值,则执行所述根据所述目标加速度确定所述目标设备的位移参数的步骤。If the target acceleration is greater than a preset acceleration threshold, the step of determining the displacement parameter of the target device according to the target acceleration is performed.
可选的,处理器21用于执行存储器24存储的程序指令,用于执行以下操作:Optionally, the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
根据所述预设时间段对所述目标加速度进行积分处理,得到所述目标设备的速度;Performing integration processing on the target acceleration according to the preset time period to obtain the speed of the target device;
根据所述预设时间段对所述目标设备的速度进行积分处理,得到所述目标设备的位移参数。Perform integration processing on the speed of the target device according to the preset time period to obtain the displacement parameter of the target device.
可选的,处理器21用于执行存储器24存储的程序指令,用于执行以下操作:Optionally, the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
根据所述第一时间段对所述第一时间段的加速度进行积分处理,获得第一候选速度;Performing integration processing on the acceleration in the first time period according to the first time period to obtain a first candidate speed;
根据所述第二时间段对所述第二时间段的加速度进行积分处理,获得第二候选速度;Performing integration processing on the acceleration in the second time period according to the second time period to obtain a second candidate speed;
获取所述第一候选速度与所述第二候选速度之间的差值的一半;Acquiring half of the difference between the first candidate speed and the second candidate speed;
若所述第一候选速度小于所述第二候选速度,则对所述差值的一半以及所述第一候选速度进行求和,获得所述第二时间段的速度;If the first candidate speed is less than the second candidate speed, sum half of the difference and the first candidate speed to obtain the speed in the second time period;
若所述第一候选速度大于或者等于所述第二候选速度,则对所述差值的一半以及所述第二候选速度进行求和,获得所述第一时间段的速度;If the first candidate speed is greater than or equal to the second candidate speed, sum half of the difference and the second candidate speed to obtain the speed in the first time period;
根据所述第二时间段的速度或者所述第一时间段的速度确定所述目标设备的速度。The speed of the target device is determined according to the speed of the second time period or the speed of the first time period.
可选的,处理器21用于执行存储器24存储的程序指令,用于执行以下操作:Optionally, the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
根据所述第一时间段对所述第一时间段的速度进行积分处理,获得第一候选位移;Performing integration processing on the velocity in the first time period according to the first time period to obtain a first candidate displacement;
根据所述第二时间段对所述第二时间段的速度进行积分处理,获得第二候选位移;Performing integration processing on the velocity in the second time period according to the second time period to obtain a second candidate displacement;
获取所述第一候选位移与所述第二候选位移之间的差值的一半;Obtaining half of the difference between the first candidate displacement and the second candidate displacement;
若所述第一候选位移小于所述第二候选位移,则对所述差值的一半以及所述第一候选位移进行求和,获得所述第二时间段的位移;If the first candidate displacement is smaller than the second candidate displacement, sum up half of the difference and the first candidate displacement to obtain the displacement in the second time period;
若所述第一候选位移大于或者等于所述第二候选位移,则对所述差值的一半以及所述第二候选位移进行求和,获得所述第一时间段的位移;If the first candidate displacement is greater than or equal to the second candidate displacement, sum half of the difference and the second candidate displacement to obtain the displacement in the first time period;
根据所述第二时间段的位移或者所述第一时间段的位移确定所述目标设备的位移参数。The displacement parameter of the target device is determined according to the displacement in the second time period or the displacement in the first time period.
可选的,处理器21用于执行存储器24存储的程序指令,用于执行以下操作:Optionally, the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
判断所述目标设备的位移参数是否大于预设位移阈值;Judging whether the displacement parameter of the target device is greater than a preset displacement threshold;
若所述目标设备的位移参数小于或者等于预设位移阈值,则确定所述证件图像具有有效性;If the displacement parameter of the target device is less than or equal to the preset displacement threshold, it is determined that the credential image is valid;
若所述目标设备的位移参数大于所述预设位移阈值,则确定所述证件图像不具有有效性。If the displacement parameter of the target device is greater than the preset displacement threshold, it is determined that the credential image is not valid.
可选的,处理器21用于执行存储器24存储的程序指令,用于执行以下操作:Optionally, the processor 21 is configured to execute program instructions stored in the memory 24, and is configured to perform the following operations:
从所述证件图像中提取出目标特征信息;Extracting target feature information from the document image;
获取关于证件的样本证件图像对应的样本特征信息集合;Obtain the sample feature information set corresponding to the sample certificate image of the certificate;
将所述目标特征信息与所述样本特征信息集合中的样本特征信息进行匹配;Matching the target feature information with the sample feature information in the sample feature information set;
若所述目标特征信息与所述样本特征信息集合中的目标样本特征信息匹配,则确定所述目标证件具有合法性;If the target characteristic information matches the target sample characteristic information in the sample characteristic information set, it is determined that the target certificate is legal;
若所述目标特征信息与所述样本特征信息集合中的任一样本特征信息不匹配,则确定所述目标证件不具有合法性。If the target characteristic information does not match any sample characteristic information in the sample characteristic information set, it is determined that the target certificate does not have legitimacy.
本申请实施例中所描述的处理器21、输入装置22、输出装置23可执行本申请实施例提供的证件验证方法的实施例中所描述的实现方式,也可执行本申请实施例所描述的电子设备的实现方式,在此不再赘述。The processor 21, input device 22, and output device 23 described in the embodiments of this application can perform the implementation described in the embodiment of the certificate verification method provided in the embodiments of this application, and can also perform the implementation described in the embodiments of this application. The implementation of the electronic device will not be repeated here.
在本申请实施例中,通过在目标设备对目标证件进行拍摄的过程中,获取目标设备的目标加速度;根据目标设备的目标加速度确定所述目标设备的位移参数。同时,确定目标加速度是否大于第一加速度阈值,若目标加速度大于第一加速度阈值,则根据目标设备的目标加速度确定所述目标设备的位移参数,以此可以减少目标设备本身的缺陷所带来的误差。根据目标设备的位移参数验证证件图像的有效性,即根据目标设备的位移参数验证目标证件是否被替换;若证件图像具有有效性,即目标设备是对目标证件进行拍摄得到证件图像,则根据证件图像对所述目标证件的合法性进行验证;若证件图像不具有有效性,即目标设备转移到其他证件,对其他证件进行拍摄得到证件图像的,目标证件被替换成其他证件,则输出提示信息,所述提示信息用于提示对所述目标证件进行重新拍摄,以此可以避免目标证件被替换而影响对证件图像的验证,可以提高对目标证件的合法性验证的准确性。In the embodiment of the present application, the target acceleration of the target device is obtained during the process of the target device photographing the target certificate; the displacement parameter of the target device is determined according to the target acceleration of the target device. At the same time, it is determined whether the target acceleration is greater than the first acceleration threshold. If the target acceleration is greater than the first acceleration threshold, the displacement parameter of the target device is determined according to the target acceleration of the target device, so as to reduce the defects caused by the target device itself error. Verify the validity of the document image according to the displacement parameter of the target device, that is, verify whether the target document is replaced according to the displacement parameter of the target device; The image verifies the legality of the target document; if the document image is not valid, that is, the target device is transferred to another document, and the other document is photographed to obtain the document image, and the target document is replaced with another document, a prompt message will be output The prompt information is used to prompt to re-shoot the target certificate, so as to avoid the target certificate being replaced and affect the verification of the certificate image, and the accuracy of the legality verification of the target certificate can be improved.
本申请实施例中还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令被处理器执行时实现如图1及图 8实施例中所示的证件验证方法。例如,该程序指令当被处理器执行时,可执行以下步骤:在目标设备对目标证件进行拍摄的过程中,获取所述目标设备的目标加速度;在所述目标设备对所述目标证件进行拍摄之前,所述目标设备的位置信息与所述目标证件的位置信息处于对齐状态;获取所述目标设备对所述目标证件进行拍摄得到的证件图像;根据所述目标设备的目标加速度确定所述目标设备的位移参数;根据所述目标设备的位移参数验证所述证件图像的有效性;若所述证件图像具有有效性,则根据所述证件图像对所述目标证件的合法性进行验证;若所述证件图像不具有有效性,则输出提示信息,所述提示信息用于提示对所述目标证件进行重新拍摄。可选的,该程序指令被处理器执行时还可实现上述实施例中方法的其他步骤,这里不再赘述。进一步可选的,本申请涉及的存储介质如计算机可读存储介质可以是非易失性的,也可以是易失性的。An embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, the computer program includes program instructions, when the program instructions are executed by a processor, the implementation is shown in FIG. 1 and FIG. 8. The certificate verification method shown in the embodiment. For example, when the program instructions are executed by the processor, the following steps may be performed: during the process of the target device photographing the target document, the target acceleration of the target device is obtained; the target device photographs the target document Previously, the location information of the target device was aligned with the location information of the target certificate; the certificate image obtained by the target device shooting the target certificate was acquired; the target was determined according to the target acceleration of the target device The displacement parameter of the device; verify the validity of the credential image according to the displacement parameter of the target device; if the credential image is valid, verify the legitimacy of the target credential according to the credential image; If the credential image is not valid, a prompt message is output, and the prompt information is used to prompt to re-shoot the target credential. Optionally, when the program instructions are executed by the processor, other steps of the method in the foregoing embodiment may be implemented, which will not be repeated here. Further optionally, the storage medium involved in this application, such as a computer-readable storage medium, may be non-volatile or volatile.
所述计算机可读存储介质可以是前述任一实施例所述的电子设备的内部存储单元,例如控制设备的硬盘或内存。所述计算机可读存储介质也可以是所述控制设备的外部存储设备,例如所述控制设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述计算机可读存储介质还可以既包括所述控制设备的内部存储单元也包括外部存储设备。所述计算机可读存储介质用于存储所述计算机程序以及所述控制设备所需的其他程序和数据。所述计算机可读存储介质还可以用于暂时地存储已经输出或者将要输出的数据。The computer-readable storage medium may be an internal storage unit of the electronic device described in any of the foregoing embodiments, such as a hard disk or a memory of a control device. The computer-readable storage medium may also be an external storage device of the control device, for example, a plug-in hard disk equipped on the control device, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital, SD) ) Card, Flash Card, etc. Further, the computer-readable storage medium may also include both an internal storage unit of the control device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the control device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的控制设备和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person of ordinary skill in the art may be aware that the units and algorithm steps of the examples described in the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both, in order to clearly illustrate the hardware and software Interchangeability, in the above description, the composition and steps of each example have been generally described in accordance with the function. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application. Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the control device and unit described above can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的控制设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例是示意性的,例如,所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the several embodiments provided in this application, it should be understood that the disclosed control device and method may be implemented in other ways. For example, the device embodiments described above are illustrative. For example, the division of the units may be a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not implemented.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Any person skilled in the art can easily think of various equivalents within the technical scope disclosed in this application. Modifications or replacements, these modifications or replacements shall be covered within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims (20)

  1. 一种证件验证方法,其中,包括:A certificate verification method, which includes:
    在目标设备对目标证件进行拍摄的过程中,获取所述目标设备的目标加速度;在所述目标设备对所述目标证件进行拍摄之前,所述目标设备的位置信息与所述目标证件的位置信息处于对齐状态;During the process of the target device photographing the target certificate, the target acceleration of the target device is acquired; before the target device photographs the target certificate, the position information of the target device and the position information of the target certificate In alignment
    获取所述目标设备对所述目标证件进行拍摄得到的证件图像;Acquiring a credential image obtained by shooting the target credential by the target device;
    根据所述目标设备的目标加速度确定所述目标设备的位移参数;Determining the displacement parameter of the target device according to the target acceleration of the target device;
    根据所述目标设备的位移参数验证所述证件图像的有效性;Verify the validity of the credential image according to the displacement parameter of the target device;
    若所述证件图像具有有效性,则根据所述证件图像对所述目标证件的合法性进行验证;If the credential image is valid, verify the legitimacy of the target credential according to the credential image;
    若所述证件图像不具有有效性,则输出提示信息,所述提示信息用于提示对所述目标证件进行重新拍摄。If the credential image is not valid, a prompt message is output, and the prompt information is used to prompt to re-shoot the target credential.
  2. 根据权利要求1所述的方法,其中,所述目标设备的目标加速度包括第一方向上的加速度、第二方向上的加速度以及第三方向上的加速度;所述方法还包括:The method according to claim 1, wherein the target acceleration of the target device includes acceleration in a first direction, acceleration in a second direction, and acceleration in a third direction; the method further comprises:
    对所述第一方向上的加速度、所述第二方向上的加速度以及所述第三方向上的加速度进行求和处理,得到候选加速度;Performing summation processing on the acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction to obtain a candidate acceleration;
    从所述候选加速度中去除重力加速度,得到目标加速度;Remove the gravitational acceleration from the candidate acceleration to obtain the target acceleration;
    若所述目标加速度大于预设加速度阈值,则执行所述根据所述目标加速度确定所述目标设备的位移参数的步骤。If the target acceleration is greater than a preset acceleration threshold, the step of determining the displacement parameter of the target device according to the target acceleration is performed.
  3. 根据权利要求2所述的方法,其中,所述目标加速度为所述目标设备在预设时间段内的加速度;The method according to claim 2, wherein the target acceleration is the acceleration of the target device in a preset time period;
    所述根据所述目标加速度确定所述目标设备的位移参数,包括:The determining the displacement parameter of the target device according to the target acceleration includes:
    根据所述预设时间段对所述目标加速度进行积分处理,得到所述目标设备的速度;Performing integration processing on the target acceleration according to the preset time period to obtain the speed of the target device;
    根据所述预设时间段对所述目标设备的速度进行积分处理,得到所述目标设备的位移参数。Perform integration processing on the speed of the target device according to the preset time period to obtain the displacement parameter of the target device.
  4. 根据权利要求3所述的方法,其中,所述目标加速度包括所述目标设备在第一时间段的加速度和所述目标设备在第二时间段的加速度,所述第一时间段和所述第二时间段均属于所述预设时间段;The method according to claim 3, wherein the target acceleration includes the acceleration of the target device in a first time period and the acceleration of the target device in a second time period, and the first time period and the second time period Both time periods belong to the preset time period;
    所述根据所述预设时间段对所述目标加速度进行积分处理,得到所述目标设备的速度,包括:The performing integration processing on the target acceleration according to the preset time period to obtain the speed of the target device includes:
    根据所述第一时间段对所述第一时间段的加速度进行积分处理,获得第一候选速度;Performing integration processing on the acceleration in the first time period according to the first time period to obtain a first candidate speed;
    根据所述第二时间段对所述第二时间段的加速度进行积分处理,获得第二候选速度;Performing integration processing on the acceleration in the second time period according to the second time period to obtain a second candidate speed;
    获取所述第一候选速度与所述第二候选速度之间的差值的一半;Acquiring half of the difference between the first candidate speed and the second candidate speed;
    若所述第一候选速度小于所述第二候选速度,则对所述差值的一半以及所述第一候选速度进行求和,获得所述第二时间段的速度;If the first candidate speed is less than the second candidate speed, sum half of the difference and the first candidate speed to obtain the speed in the second time period;
    若所述第一候选速度大于或者等于所述第二候选速度,则对所述差值的一半以及所述第二候选速度进行求和,获得所述第一时间段的速度;If the first candidate speed is greater than or equal to the second candidate speed, sum half of the difference and the second candidate speed to obtain the speed in the first time period;
    根据所述第二时间段的速度或者所述第一时间段的速度确定所述目标设备的速度。The speed of the target device is determined according to the speed of the second time period or the speed of the first time period.
  5. 根据权利要求3所述的方法,其中,所述目标设备的速度包括所述目标设备在所述第一时间段的速度和所述目标设备在所述第二时间段的速度;The method according to claim 3, wherein the speed of the target device includes the speed of the target device in the first time period and the speed of the target device in the second time period;
    所述根据所述预设时间段对所述目标设备的速度进行积分处理,得到所述目标设备的位移参数,包括:The performing integration processing on the speed of the target device according to the preset time period to obtain the displacement parameter of the target device includes:
    根据所述第一时间段对所述第一时间段的速度进行积分处理,获得第一候选位移;Performing integration processing on the velocity in the first time period according to the first time period to obtain a first candidate displacement;
    根据所述第二时间段对所述第二时间段的速度进行积分处理,获得第二候选位移;Performing integration processing on the velocity in the second time period according to the second time period to obtain a second candidate displacement;
    获取所述第一候选位移与所述第二候选位移之间的差值的一半;Obtaining half of the difference between the first candidate displacement and the second candidate displacement;
    若所述第一候选位移小于所述第二候选位移,则对所述差值的一半以及所述第一候选位移进行求和,获得所述第二时间段的位移;If the first candidate displacement is smaller than the second candidate displacement, sum up half of the difference and the first candidate displacement to obtain the displacement in the second time period;
    若所述第一候选位移大于或者等于所述第二候选位移,则对所述差值的一半以及所述第二候选位移进行求和,获得所述第一时间段的位移;If the first candidate displacement is greater than or equal to the second candidate displacement, sum half of the difference and the second candidate displacement to obtain the displacement in the first time period;
    根据所述第二时间段的位移或者所述第一时间段的位移确定所述目标设备的位移参数。The displacement parameter of the target device is determined according to the displacement in the second time period or the displacement in the first time period.
  6. 根据权利要求1所述的方法,其中,所述根据所述目标设备的位移参数验证所述证件图像的有效性,包括:The method according to claim 1, wherein the verifying the validity of the credential image according to the displacement parameter of the target device comprises:
    判断所述目标设备的位移参数是否大于预设位移阈值;Judging whether the displacement parameter of the target device is greater than a preset displacement threshold;
    若所述目标设备的位移参数小于或者等于预设位移阈值,则确定所述证件图像具有有效性;If the displacement parameter of the target device is less than or equal to the preset displacement threshold, it is determined that the credential image is valid;
    若所述目标设备的位移参数大于所述预设位移阈值,则确定所述证件图像不具有有效性。If the displacement parameter of the target device is greater than the preset displacement threshold, it is determined that the credential image is not valid.
  7. 根据权利要求1所述的方法,其中,所述根据所述证件图像对所述目标证件的合法性进行验证,包括:The method according to claim 1, wherein the verifying the legality of the target document according to the document image comprises:
    从所述证件图像中提取出目标特征信息;Extracting target feature information from the document image;
    获取关于证件的样本证件图像对应的样本特征信息集合;Obtain the sample feature information set corresponding to the sample certificate image of the certificate;
    将所述目标特征信息与所述样本特征信息集合中的样本特征信息进行匹配;Matching the target feature information with the sample feature information in the sample feature information set;
    若所述目标特征信息与所述样本特征信息集合中的目标样本特征信息匹配,则确定所述目标证件具有合法性;If the target characteristic information matches the target sample characteristic information in the sample characteristic information set, it is determined that the target certificate is legal;
    若所述目标特征信息与所述样本特征信息集合中的任一样本特征信息不匹配,则确定所述目标证件不具有合法性。If the target characteristic information does not match any sample characteristic information in the sample characteristic information set, it is determined that the target certificate does not have legitimacy.
  8. 一种证件验证装置,其中,包括:A certificate verification device, which includes:
    第一获取模块,用于在目标设备对目标证件进行拍摄的过程中,获取所述目标设备的目标加速度;在所述目标设备对所述目标证件进行拍摄之前,所述目标设备的位置信息与所述目标证件的位置信息处于对齐状态;The first acquisition module is configured to acquire the target acceleration of the target device during the process of the target device photographing the target certificate; before the target device photographs the target certificate, the location information of the target device is the same as The position information of the target certificate is in an aligned state;
    第二获取模块,用于获取所述目标设备对所述目标证件进行拍摄得到的证件图像;The second acquisition module is configured to acquire a credential image obtained by shooting the target credential by the target device;
    确定模块,用于根据所述目标设备的目标加速度确定所述目标设备的位移参数;A determining module, configured to determine the displacement parameter of the target device according to the target acceleration of the target device;
    第一验证模块,用于根据所述目标设备的位移参数验证所述证件图像的有效性;The first verification module is configured to verify the validity of the credential image according to the displacement parameter of the target device;
    第二验证模块,用于若所述证件图像具有有效性,则根据所述证件图像对所述目标证件的合法性进行验证;The second verification module is configured to verify the validity of the target certificate according to the certificate image if the certificate image is valid;
    输出模块,用于若所述证件图像不具有有效性,则输出提示信息,所述提示信息用于提示对所述目标证件进行重新拍摄。The output module is configured to output prompt information if the credential image is not valid, and the prompt information is used to prompt to re-shoot the target credential.
  9. 一种电子设备,其中,包括:处理器、存储器以及网络接口;An electronic device, including: a processor, a memory, and a network interface;
    所述处理器与存储器、网络接口相连,其中,网络接口用于提供数据通信功能,所述存储器用于存储程序代码,所述处理器用于调用所述程序代码,以执行以下步骤:The processor is connected to a memory and a network interface, where the network interface is used to provide data communication functions, the memory is used to store program codes, and the processor is used to call the program codes to perform the following steps:
    在目标设备对目标证件进行拍摄的过程中,获取所述目标设备的目标加速度;在所述目标设备对所述目标证件进行拍摄之前,所述目标设备的位置信息与所述目标证件的位置信息处于对齐状态;During the process of the target device photographing the target certificate, the target acceleration of the target device is acquired; before the target device photographs the target certificate, the position information of the target device and the position information of the target certificate In alignment
    获取所述目标设备对所述目标证件进行拍摄得到的证件图像;Acquiring a credential image obtained by shooting the target credential by the target device;
    根据所述目标设备的目标加速度确定所述目标设备的位移参数;Determining the displacement parameter of the target device according to the target acceleration of the target device;
    根据所述目标设备的位移参数验证所述证件图像的有效性;Verify the validity of the credential image according to the displacement parameter of the target device;
    若所述证件图像具有有效性,则根据所述证件图像对所述目标证件的合法性进行验证;If the credential image is valid, verify the legitimacy of the target credential according to the credential image;
    若所述证件图像不具有有效性,则输出提示信息,所述提示信息用于提示对所述目标证件进行重新拍摄。If the credential image is not valid, a prompt message is output, and the prompt information is used to prompt to re-shoot the target credential.
  10. 根据权利要求9所述的电子设备,其中,所述目标设备的目标加速度包括第一方向上的加速度、第二方向上的加速度以及第三方向上的加速度;所述处理器还用于执行:The electronic device according to claim 9, wherein the target acceleration of the target device includes acceleration in a first direction, acceleration in a second direction, and acceleration in a third direction; and the processor is further configured to execute:
    对所述第一方向上的加速度、所述第二方向上的加速度以及所述第三方向上的加速度进行求和处理,得到候选加速度;Performing summation processing on the acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction to obtain a candidate acceleration;
    从所述候选加速度中去除重力加速度,得到目标加速度;Remove the gravitational acceleration from the candidate acceleration to obtain the target acceleration;
    若所述目标加速度大于预设加速度阈值,则执行所述根据所述目标加速度确定所述目标设备的位移参数的步骤。If the target acceleration is greater than a preset acceleration threshold, the step of determining the displacement parameter of the target device according to the target acceleration is performed.
  11. 根据权利要求10所述的电子设备,其中,所述目标加速度为所述目标设备在预设时间段内的加速度;The electronic device according to claim 10, wherein the target acceleration is an acceleration of the target device within a preset time period;
    所述根据所述目标加速度确定所述目标设备的位移参数时,具体执行:When determining the displacement parameter of the target device according to the target acceleration, specifically execute:
    根据所述预设时间段对所述目标加速度进行积分处理,得到所述目标设备的速度;Performing integration processing on the target acceleration according to the preset time period to obtain the speed of the target device;
    根据所述预设时间段对所述目标设备的速度进行积分处理,得到所述目标设备的位移参数。Perform integration processing on the speed of the target device according to the preset time period to obtain the displacement parameter of the target device.
  12. 根据权利要求11所述的电子设备,其中,所述目标加速度包括所述目标设备在第一时间段的加速度和所述目标设备在第二时间段的加速度,所述第一时间段和所述第二时间段均属于所述预设时间段;The electronic device according to claim 11, wherein the target acceleration includes the acceleration of the target device in a first time period and the acceleration of the target device in a second time period, the first time period and the The second time period belongs to the preset time period;
    所述根据所述预设时间段对所述目标加速度进行积分处理,得到所述目标设备的速度时,具体执行:When performing integration processing on the target acceleration according to the preset time period to obtain the speed of the target device, specifically execute:
    根据所述第一时间段对所述第一时间段的加速度进行积分处理,获得第一候选速度;Performing integration processing on the acceleration in the first time period according to the first time period to obtain a first candidate speed;
    根据所述第二时间段对所述第二时间段的加速度进行积分处理,获得第二候选速度;Performing integration processing on the acceleration in the second time period according to the second time period to obtain a second candidate speed;
    获取所述第一候选速度与所述第二候选速度之间的差值的一半;Acquiring half of the difference between the first candidate speed and the second candidate speed;
    若所述第一候选速度小于所述第二候选速度,则对所述差值的一半以及所述第一候选速度进行求和,获得所述第二时间段的速度;If the first candidate speed is less than the second candidate speed, sum half of the difference and the first candidate speed to obtain the speed in the second time period;
    若所述第一候选速度大于或者等于所述第二候选速度,则对所述差值的一半以及所述第二候选速度进行求和,获得所述第一时间段的速度;If the first candidate speed is greater than or equal to the second candidate speed, sum half of the difference and the second candidate speed to obtain the speed in the first time period;
    根据所述第二时间段的速度或者所述第一时间段的速度确定所述目标设备的速度。The speed of the target device is determined according to the speed of the second time period or the speed of the first time period.
  13. 根据权利要求11所述的电子设备,其中,所述目标设备的速度包括所述目标设备在所述第一时间段的速度和所述目标设备在所述第二时间段的速度;The electronic device according to claim 11, wherein the speed of the target device comprises the speed of the target device in the first time period and the speed of the target device in the second time period;
    所述根据所述预设时间段对所述目标设备的速度进行积分处理,得到所述目标设备的位移参数时,具体执行:When performing integration processing on the speed of the target device according to the preset time period to obtain the displacement parameter of the target device, specifically execute:
    根据所述第一时间段对所述第一时间段的速度进行积分处理,获得第一候选位移;Performing integration processing on the velocity in the first time period according to the first time period to obtain a first candidate displacement;
    根据所述第二时间段对所述第二时间段的速度进行积分处理,获得第二候选位移;Performing integration processing on the velocity in the second time period according to the second time period to obtain a second candidate displacement;
    获取所述第一候选位移与所述第二候选位移之间的差值的一半;Obtaining half of the difference between the first candidate displacement and the second candidate displacement;
    若所述第一候选位移小于所述第二候选位移,则对所述差值的一半以及所述第一候选位移进行求和,获得所述第二时间段的位移;If the first candidate displacement is smaller than the second candidate displacement, sum up half of the difference and the first candidate displacement to obtain the displacement in the second time period;
    若所述第一候选位移大于或者等于所述第二候选位移,则对所述差值的一半以及所述第二候选位移进行求和,获得所述第一时间段的位移;If the first candidate displacement is greater than or equal to the second candidate displacement, sum half of the difference and the second candidate displacement to obtain the displacement in the first time period;
    根据所述第二时间段的位移或者所述第一时间段的位移确定所述目标设备的位移参数。The displacement parameter of the target device is determined according to the displacement in the second time period or the displacement in the first time period.
  14. 根据权利要求9所述的电子设备,其中,所述根据所述目标设备的位移参数验证所述证件图像的有效性时,具体执行:The electronic device according to claim 9, wherein when the validity of the credential image is verified according to the displacement parameter of the target device, the following is specifically executed:
    判断所述目标设备的位移参数是否大于预设位移阈值;Judging whether the displacement parameter of the target device is greater than a preset displacement threshold;
    若所述目标设备的位移参数小于或者等于预设位移阈值,则确定所述证件图像具有有效性;If the displacement parameter of the target device is less than or equal to the preset displacement threshold, it is determined that the credential image is valid;
    若所述目标设备的位移参数大于所述预设位移阈值,则确定所述证件图像不具有有效 性。If the displacement parameter of the target device is greater than the preset displacement threshold, it is determined that the credential image is not valid.
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时,执行以下步骤:A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, the following steps are performed:
    在目标设备对目标证件进行拍摄的过程中,获取所述目标设备的目标加速度;在所述目标设备对所述目标证件进行拍摄之前,所述目标设备的位置信息与所述目标证件的位置信息处于对齐状态;During the process of the target device photographing the target certificate, the target acceleration of the target device is acquired; before the target device photographs the target certificate, the position information of the target device and the position information of the target certificate In alignment
    获取所述目标设备对所述目标证件进行拍摄得到的证件图像;Acquiring a credential image obtained by shooting the target credential by the target device;
    根据所述目标设备的目标加速度确定所述目标设备的位移参数;Determining the displacement parameter of the target device according to the target acceleration of the target device;
    根据所述目标设备的位移参数验证所述证件图像的有效性;Verify the validity of the credential image according to the displacement parameter of the target device;
    若所述证件图像具有有效性,则根据所述证件图像对所述目标证件的合法性进行验证;If the credential image is valid, verify the legitimacy of the target credential according to the credential image;
    若所述证件图像不具有有效性,则输出提示信息,所述提示信息用于提示对所述目标证件进行重新拍摄。If the credential image is not valid, a prompt message is output, and the prompt information is used to prompt to re-shoot the target credential.
  16. 根据权利要求15所述的计算机可读存储介质,其中,所述目标设备的目标加速度包括第一方向上的加速度、第二方向上的加速度以及第三方向上的加速度;所述程序指令当被处理器执行时还用于执行:The computer-readable storage medium according to claim 15, wherein the target acceleration of the target device includes acceleration in a first direction, acceleration in a second direction, and acceleration in a third direction; when the program instructions are processed It is also used to execute:
    对所述第一方向上的加速度、所述第二方向上的加速度以及所述第三方向上的加速度进行求和处理,得到候选加速度;Performing summation processing on the acceleration in the first direction, the acceleration in the second direction, and the acceleration in the third direction to obtain a candidate acceleration;
    从所述候选加速度中去除重力加速度,得到目标加速度;Remove the gravitational acceleration from the candidate acceleration to obtain the target acceleration;
    若所述目标加速度大于预设加速度阈值,则执行所述根据所述目标加速度确定所述目标设备的位移参数的步骤。If the target acceleration is greater than a preset acceleration threshold, the step of determining the displacement parameter of the target device according to the target acceleration is performed.
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述目标加速度为所述目标设备在预设时间段内的加速度;The computer-readable storage medium according to claim 16, wherein the target acceleration is an acceleration of the target device within a preset time period;
    所述根据所述目标加速度确定所述目标设备的位移参数时,具体执行:When determining the displacement parameter of the target device according to the target acceleration, specifically execute:
    根据所述预设时间段对所述目标加速度进行积分处理,得到所述目标设备的速度;Performing integration processing on the target acceleration according to the preset time period to obtain the speed of the target device;
    根据所述预设时间段对所述目标设备的速度进行积分处理,得到所述目标设备的位移参数。Perform integration processing on the speed of the target device according to the preset time period to obtain the displacement parameter of the target device.
  18. 根据权利要求17所述的计算机可读存储介质,其中,所述目标加速度包括所述目标设备在第一时间段的加速度和所述目标设备在第二时间段的加速度,所述第一时间段和所述第二时间段均属于所述预设时间段;The computer-readable storage medium according to claim 17, wherein the target acceleration comprises an acceleration of the target device in a first time period and an acceleration of the target device in a second time period, the first time period And the second time period belong to the preset time period;
    所述根据所述预设时间段对所述目标加速度进行积分处理,得到所述目标设备的速度时,具体执行:When performing integration processing on the target acceleration according to the preset time period to obtain the speed of the target device, specifically execute:
    根据所述第一时间段对所述第一时间段的加速度进行积分处理,获得第一候选速度;Performing integration processing on the acceleration in the first time period according to the first time period to obtain a first candidate speed;
    根据所述第二时间段对所述第二时间段的加速度进行积分处理,获得第二候选速度;Performing integration processing on the acceleration in the second time period according to the second time period to obtain a second candidate speed;
    获取所述第一候选速度与所述第二候选速度之间的差值的一半;Acquiring half of the difference between the first candidate speed and the second candidate speed;
    若所述第一候选速度小于所述第二候选速度,则对所述差值的一半以及所述第一候选速度进行求和,获得所述第二时间段的速度;If the first candidate speed is less than the second candidate speed, sum half of the difference and the first candidate speed to obtain the speed in the second time period;
    若所述第一候选速度大于或者等于所述第二候选速度,则对所述差值的一半以及所述第二候选速度进行求和,获得所述第一时间段的速度;If the first candidate speed is greater than or equal to the second candidate speed, sum half of the difference and the second candidate speed to obtain the speed in the first time period;
    根据所述第二时间段的速度或者所述第一时间段的速度确定所述目标设备的速度。The speed of the target device is determined according to the speed of the second time period or the speed of the first time period.
  19. 根据权利要求17所述的计算机可读存储介质,其中,所述目标设备的速度包括所述目标设备在所述第一时间段的速度和所述目标设备在所述第二时间段的速度;18. The computer-readable storage medium according to claim 17, wherein the speed of the target device includes the speed of the target device in the first time period and the speed of the target device in the second time period;
    所述根据所述预设时间段对所述目标设备的速度进行积分处理,得到所述目标设备的位移参数时,具体执行:When performing integration processing on the speed of the target device according to the preset time period to obtain the displacement parameter of the target device, specifically execute:
    根据所述第一时间段对所述第一时间段的速度进行积分处理,获得第一候选位移;Performing integration processing on the velocity in the first time period according to the first time period to obtain a first candidate displacement;
    根据所述第二时间段对所述第二时间段的速度进行积分处理,获得第二候选位移;Performing integration processing on the velocity in the second time period according to the second time period to obtain a second candidate displacement;
    获取所述第一候选位移与所述第二候选位移之间的差值的一半;Obtaining half of the difference between the first candidate displacement and the second candidate displacement;
    若所述第一候选位移小于所述第二候选位移,则对所述差值的一半以及所述第一候选位移进行求和,获得所述第二时间段的位移;If the first candidate displacement is smaller than the second candidate displacement, sum up half of the difference and the first candidate displacement to obtain the displacement in the second time period;
    若所述第一候选位移大于或者等于所述第二候选位移,则对所述差值的一半以及所述第二候选位移进行求和,获得所述第一时间段的位移;If the first candidate displacement is greater than or equal to the second candidate displacement, sum half of the difference and the second candidate displacement to obtain the displacement in the first time period;
    根据所述第二时间段的位移或者所述第一时间段的位移确定所述目标设备的位移参数。The displacement parameter of the target device is determined according to the displacement in the second time period or the displacement in the first time period.
  20. 根据权利要求15所述的计算机可读存储介质,其中,所述根据所述目标设备的位移参数验证所述证件图像的有效性时,具体执行:15. The computer-readable storage medium according to claim 15, wherein when verifying the validity of the credential image according to the displacement parameter of the target device, the following is specifically executed:
    判断所述目标设备的位移参数是否大于预设位移阈值;Judging whether the displacement parameter of the target device is greater than a preset displacement threshold;
    若所述目标设备的位移参数小于或者等于预设位移阈值,则确定所述证件图像具有有效性;If the displacement parameter of the target device is less than or equal to the preset displacement threshold, it is determined that the credential image is valid;
    若所述目标设备的位移参数大于所述预设位移阈值,则确定所述证件图像不具有有效性。If the displacement parameter of the target device is greater than the preset displacement threshold, it is determined that the credential image is not valid.
PCT/CN2020/132271 2020-10-10 2020-11-27 Certificate verification method and apparatus, and device and storage medium WO2021151348A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011078719.9 2020-10-10
CN202011078719.9A CN112215232B (en) 2020-10-10 2020-10-10 Certificate verification method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2021151348A1 true WO2021151348A1 (en) 2021-08-05

Family

ID=74053369

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/132271 WO2021151348A1 (en) 2020-10-10 2020-11-27 Certificate verification method and apparatus, and device and storage medium

Country Status (2)

Country Link
CN (1) CN112215232B (en)
WO (1) WO2021151348A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100141799A1 (en) * 2008-12-08 2010-06-10 Sony Corporation Imaging apparatus, imaging method, and program
CN105049734A (en) * 2015-08-31 2015-11-11 广州市幸福网络技术有限公司 License camera capable of giving shooting environment shooting prompt and shooting environment detection method
CN109255218A (en) * 2017-07-12 2019-01-22 上海荆虹电子科技有限公司 A kind of motional induction unlocking method and system based on bio-identification terminal
CN110493522A (en) * 2019-08-26 2019-11-22 Oppo广东移动通信有限公司 Anti-fluttering method and device, electronic equipment, computer readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256315A (en) * 2018-01-15 2018-07-06 北京明华联盟科技有限公司 Terminal and cipher authentication method and computer readable storage medium
CN109711415A (en) * 2018-11-13 2019-05-03 平安科技(深圳)有限公司 Certificate profile determines method, apparatus and storage medium, server
CN110570209A (en) * 2019-07-30 2019-12-13 平安科技(深圳)有限公司 Certificate authenticity verification method and device, computer equipment and storage medium
CN110648314B (en) * 2019-09-05 2023-08-04 创新先进技术有限公司 Method, device and equipment for identifying flip image

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100141799A1 (en) * 2008-12-08 2010-06-10 Sony Corporation Imaging apparatus, imaging method, and program
CN105049734A (en) * 2015-08-31 2015-11-11 广州市幸福网络技术有限公司 License camera capable of giving shooting environment shooting prompt and shooting environment detection method
CN109255218A (en) * 2017-07-12 2019-01-22 上海荆虹电子科技有限公司 A kind of motional induction unlocking method and system based on bio-identification terminal
CN110493522A (en) * 2019-08-26 2019-11-22 Oppo广东移动通信有限公司 Anti-fluttering method and device, electronic equipment, computer readable storage medium

Also Published As

Publication number Publication date
CN112215232B (en) 2023-10-24
CN112215232A (en) 2021-01-12

Similar Documents

Publication Publication Date Title
WO2021196548A1 (en) Distance determination method, apparatus and system
WO2017181899A1 (en) Facial in-vivo verification method and device
US20200019760A1 (en) Three-dimensional living-body face detection method, face authentication recognition method, and apparatuses
US10043089B2 (en) Personal identification method and apparatus for biometrical identification
WO2015131712A1 (en) Face recognition method, device and computer readable storage medium
WO2011030441A1 (en) Biometric authentication device, biometric authentication system, and biometric authentication method
JP2007249586A (en) Authentication device, authentication method, authentication program and computer-readable recording medium
US11017552B2 (en) Measurement method and apparatus
TW201727537A (en) Face recognition system and face recognition method
CN111028205B (en) Eye pupil positioning method and device based on binocular distance measurement
WO2020164266A1 (en) Living body detection method and system, and terminal device
WO2022078168A1 (en) Identity verification method and apparatus based on artificial intelligence, and computer device and storage medium
US10268873B2 (en) Method and fingerprint sensing system for analyzing biometric measurements of a user
WO2022083479A1 (en) Method and apparatus for capturing face image, and electronic device
US20210182584A1 (en) Methods and systems for displaying a visual aid and enhancing user liveness detection
WO2021151348A1 (en) Certificate verification method and apparatus, and device and storage medium
CN109840515B (en) Face posture adjusting method and device and terminal
WO2018179723A1 (en) Facial authentication processing apparatus, facial authentication processing method, and facial authentication processing system
EP3839775A1 (en) Methods and systems for displaying a visual aid while capturing user image
CN111767845B (en) Certificate identification method and device
CN110971820B (en) Photographing method, photographing device, mobile terminal and computer readable storage medium
WO2016180221A1 (en) Photographing method and apparatus
US10447691B2 (en) Method for generating an authenticating document
CN113743396A (en) Method and device for identifying injection attack in certificate identification process
CN113268778A (en) Electronic file processing method, system, device, medium and intelligent seal

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20917133

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20917133

Country of ref document: EP

Kind code of ref document: A1