In an embodiment, the server may further perform a Fourier transform on the extracted facial feature data to perform feature analysis in a frequency domain space. When a frequency domain feature of the extracted facial feature data matches a frequency domain feature of the facial feature data of a live facial image, the target image is classified as a live facial image. When a frequency domain feature of the extracted facial feature data matches a frequency domain feature of the facial feature data of a non-live facial image, the target image is classified as a non-live facial image.
S308. Extract background feature data from an extended facial image. The extended facial image is obtained by extending a region that covers the facial image.
The extended facial image includes the facial image, and is an image intercepted along a region obtained by extending a region that covers the facial image and that exists in the target image. The size of the extended facial image is larger than the size of the facial image. For example, the region that covers the extended facial image may be obtained by extending the region that covers the facial image to a double size in all four directions. In this case, a horizontal size of the extended facial image is three times a horizontal size of the facial image, and a vertical size of the extended facial image is three times a vertical size of the facial image. Understandably, the scale relationship between the size of the extended facial image and the size of the facial image is not limited here, and may be set depending on the needs of the actual application scenes, as long as the extended facial image includes the facial image and the size of the extended facial image is larger than the size of the facial image.