Background feature data is data that reflects features of a background part in an image. Background feature data includes distribution of color values of pixel points in a background image, pixel continuity features of a background image, and the like. Understandably, an image frame obtained by re-photographing is an image frame obtained by acquiring a two-dimensional planar image, and the image frame may include a margin or boundary of the two-dimensional planar image. In this case, image pixels at the margin or boundary in the image frame are discrete. However, this does not occur to an image frame acquired from a live face/person as the image frame is obtained by acquiring a three-dimensional stereoscopic object from a real scene.
Specifically, after obtaining the target image, the server may obtain, according to a preset region extension manner, an extended facial image formed by extending the region that covers the facial image, and then extract background feature data of the extended facial image in the target image according to a preset image feature extraction policy. The preset region extension manner may be extending in only one direction or extending in multiple directions. The preset image feature extraction policy may be a preset image feature extraction algorithm or a pre-trained feature extraction machine learning model.
In an embodiment, the server may extract background feature data from only a background image other than the facial image in the extended facial image, or extract background feature data from the extended facial image.
S310. Perform face liveness recognition according to the background feature data to obtain a second confidence level. The second confidence level denotes a second probability of recognizing a live face/person.