Patent Description:
At present, a fingerprint sensor is configured in some electronic devices. A user can normally use the electronic device after placing a finger on the fingerprint sensor and passing the fingerprint identification. The accuracy of fingerprint matching may be relatively low due to user finger peeling, temperature changes, moisture changes, or wounds.

To improve the accuracy of fingerprint matching, some fingerprint identification algorithms may have template updating and template learning capabilities. For example, when a fingerprint image matches a fingerprint template, the fingerprint image is stored in a fingerprint template library as a new fingerprint template, and then when fingerprint information is subsequently acquired, the fingerprint information is compared with the new fingerprint template, thereby improving the accuracy of fingerprint matching. D1 (<CIT>) discloses a method of authenticating a finger of a user against a stored template and expanding the stored template to acquire a larger template. In the method of expanding the stored template, the blank image is not acquired. D2 (<CIT>) discloses a method for automatically determining a set of default settings (with respect to a blank image) so that a uniform and high contrast image results when a finger is present on a sensor device. The objective to acquire the blank image during initialization in D2 is to determine diagnostic data. D3 (<NPL>)) discloses an easy way to update the biometric reference data. Specifically, the authenticated test sample is included into the reference data.

Based on this, the present disclosure provides a method of updating a fingerprint template, an electronic device and a non-transitory machine readable medium.

In a first aspect, a method of updating a fingerprint template is provided as defined by claim <NUM>.

In a second aspect, an electronic device is provided as defined by claim <NUM>.

In a third aspect, a non-transitory machine readable medium is provided as defined by claim <NUM>.

Illustrative examples will be described in detail here with the examples thereof expressed in the drawings. Where the following descriptions involve the drawings, like numerals in different drawings refer to like or similar elements unless otherwise indicated. The examples described in the following examples do not represent all examples consistent with the present disclosure. Rather, they are merely device examples consistent with some aspects of the present disclosure as detailed in the appended claims.

The terminology used in the present disclosure is for the purpose of describing particular examples only and is not intended to limit the present disclosure. As used in this disclosure and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

It shall be understood that, although the terms "first," "second," "third," and the like may be used herein to describe various information, the information should not be limited by these terms. These terms are only used to distinguish one category of information from another. For example, without departing from the scope of the present disclosure, first information may be termed as second information; and similarly, second information may also be termed as first information. As used herein, the term "if' may be understood to mean "when" or "upon" or "in response to" depending on the context.

Under the condition that the fingerprint identification algorithm has template learning and template updating capabilities, when a fingerprint sensor has hardware damage or residues, in the fingerprint matching process, a updated fingerprint template eliminates influence regions (hereinafter also referred to as foreign object regions), such as hardware damages or residues. When the remaining part of the fingerprint image except the foreign object region matches the updated fingerprint template, the electronic device is automatically unlocked. In this case, the area of the matched region is reduced. When the two fingerprints are similar, the recognition error rate is increased, and the safety performance of the electronic device is reduced.

Based on this, the present disclosure provides a method of updating a fingerprint template. <FIG> is a flow diagram illustrating a method of updating a fingerprint template according to an example. The method may be configured in a fingerprint sensor or a processor. Briefly, the method is performed by a processor in examples of the disclosure. Referring to <FIG>, the method of updating a fingerprint template includes steps <NUM>-<NUM>.

At step <NUM>, a blank image is acquired when the fingerprint sensor in the electronic device scans a fingerprint sensor region and no finger is detected.

In an example, the fingerprint sensor is configured in the electronic device, such as a mobile terminal, and is configured to scan the fingerprint sensor region according to a set cycle to obtain the blank image of the fingerprint sensor region. The fingerprint sensor then sends the blank image to the processor.

The blank image refers to an image of a fingerprint sensor region acquired by the fingerprint sensor without being interfered by a user. It can be understood that when the hardware of the fingerprint sensor is damaged or there is a residue in the fingerprint sensor region, the hardware damage or the residue affects a capacitance distribution of the fingerprint sensor, and thus the blank image includes a foreign object region. The foreign object region included in the blank image corresponds to a hardware damage or a residue. The foreign object region shows an approximate shape and an approximate position of the hardware damage or the residue.

In practical applications, the fingerprint sensor may be a capacitive sensor. When a finger enters a sensing region of the fingerprint sensor, the capacitance value of each capacitance dot in the sensing region of the fingerprint sensor changes, and thus an output voltage of the fingerprint sensor changes. In an example, the processor may obtain the output voltage of the fingerprint sensor. The output voltage of the fingerprint sensor may refer to an average value of the voltage corresponding to each of the capacitance dots). When the output voltage of the fingerprint sensor exceeds a preset voltage range, the processor does not receive the blank image corresponding to the output voltage. When the output voltage of the fingerprint sensor is within the preset voltage range, for example, <NUM>-<NUM> mV, it indicates that the output voltage of the fingerprint sensor is stable and the acquired blank image is valid, and at this case the processor receives the blank image.

It will be appreciated that the processor may further obtain an output current of the fingerprint sensor. When the finger enters the sensing region of the fingerprint sensor, the capacitance value of each capacitance dot in the sensing region of the fingerprint sensor changes, and thus the current value in a loop formed by each of the capacitance dots and the power supply is different. In an example, the processor may obtain the output current of the fingerprint sensor. When the output current of the fingerprint sensor exceeds a preset current range, the processor does not receive the blank image corresponding to the output current. When the output current of the fingerprint sensor is within the preset current range, for example, <NUM>-<NUM> uA, it indicates that the output current of the fingerprint sensor is stable and the acquired blank image is valid, and at this case the processor receives the blank image.

In another example, the processor takes a blank image received within a preset period (such as, several milliseconds, several tens milliseconds) after fluctuation of the output (may be an output voltage or an output current) of the fingerprint sensor is ended as a final acquired blank image.

At step <NUM>, it is determined whether the fingerprint template is to be updated according to the blank image.

After acquiring the blank image, the processor of the mobile terminal determines whether the blank image includes a foreign object region with an area exceeding an area threshold to obtain a determination result, and then determines whether the fingerprint template is to be updated according to the determination result. Determining whether the fingerprint template is to be updated according to the determination result includes: when the blank image includes a foreign object region with the area exceeding the area threshold, confirming not to update the fingerprint template.

When it is determined that the fingerprint template is not updated, the processor may not perform the operation of updating the fingerprint template in a preset period (for example, several minutes, or several hours) started from the determination time. That is, when detecting that the finger of the user is close to or pressing the fingerprint sensor, the processor determines whether an acquired fingerprint image matches the fingerprint template and confirms not to update the fingerprint template. When the fingerprint image matches the fingerprint template, the processor unlocks the mobile terminal. When the fingerprint image does not match the fingerprint template, the locked state of the mobile terminal is maintained. Therefore, when the blank image is abnormal, the frequency of determining whether the fingerprint template is to be updated or not can be reduced and thus the computing resource of the processor can be saved.

When it is determined that the fingerprint template is not updated, the processor does not use first acquired fingerprint image after the determined time to update the fingerprint template. After the first fingerprint image is acquired, the processor re-executes step <NUM>. In this way, it can be found out in time whether the user removes the foreign object, and the efficiency of updating the fingerprint template can be ensured.

Determining whether the fingerprint template is to be updated according to the determination result may further include: when the blank image includes a foreign object region with an area less than or equal to the area threshold or no foreign object region, the fingerprint template may be updated. In an example, the method of updating a fingerprint template further includes: storing a fingerprint image matched with the fingerprint template into a fingerprint template library as a new fingerprint template.

In some cases, the number of fingerprint templates in the fingerprint template library is preset, for example, <NUM>. In the early stage of using the mobile terminal, the number of fingerprint templates configured in the mobile terminal and fingerprint templates stored when the user registers is N, where N is an integer equal to or less than <NUM>. In this case, the subsequent fingerprint image passing the fingerprint identification may be directly stored in the fingerprint template library as the fingerprint template. In this way, the number of the fingerprint templates can be stably increased, and thus the fingerprint template library can adapt to more fingerprint identification scenes.

In another example, the method of updating a fingerprint template further includes: removing the foreign object region with the area less than or equal to the area threshold in the fingerprint image based on an image processing algorithm to obtain a processed fingerprint image; storing the processed fingerprint image into the fingerprint template library; and deleting a previous fingerprint template in the fingerprint template library.

In some cases, the fingerprint template algorithm continuously updates the fingerprint template, such that the number of templates in the fingerprint template library is maintained at <NUM>. At this case, an old fingerprint template in the fingerprint template library is replaced with a current processed fingerprint image, that is, when a new fingerprint template is added in the fingerprint template library, an old fingerprint template is removed from the fingerprint template library. In this way, the fingerprint template library does not occupy too many storage resources, and thus the updating speed and the matching accuracy of the fingerprint template can be ensured.

The size of the area threshold can be reasonably set according to a relationship between the area threshold and a similarity between the fingerprint image and the fingerprint template. For example, the ratio of the area threshold to the fingerprint sensor region may be <NUM> % to <NUM> %, and at this case, the similarity between the fingerprint image and the fingerprint template is <NUM> % to <NUM> %. Of course, those skilled in the art may adjust the area threshold according to a specific scene, and the area threshold is not limited herein.

It can be seen that the fingerprint template is not updated when the area of the foreign object region in the blank image exceeds the area threshold. In this way, the accuracy of the fingerprint template can be ensured, it is avoided that the fingerprint image with the hardware damage or the residue is used as the fingerprint template and that the fingerprint identification can be succeeded as long as fingerprints around the foreign object region passes the fingerprint matching, so that the accuracy of the fingerprint identification is prevented from being reduced and the safety performance of the electronic device is ensured.

<FIG> is a flow diagram illustrating a method of updating a fingerprint template according to an example. Referring to <FIG>, the method of updating a fingerprint template includes steps <NUM>-<NUM>.

At step <NUM>, a blank image is acquired when a fingerprint sensor in the electronic device scans a fingerprint sensor region and no finger is detected.

Step <NUM> is the same as step <NUM> and detailed description may refer to <FIG> and step <NUM>, which are not repeated herein.

At step <NUM>, a fingerprint image matched with a fingerprint template is acquired.

It is noted that, in examples of the disclosure, the sequence of step <NUM> and step <NUM> is not limited, for example, step <NUM> may precede step <NUM>, and step <NUM> may follow step <NUM>.

At step <NUM>, it is determined whether the fingerprint template is to be updated according to the fingerprint image and the blank image. For example, the electronic device may determine whether to update the fingerprint template according to the fingerprint image, the blank image, and other factors such as an area threshold.

<FIG> is a flow diagram illustrating a method of updating a fingerprint template according to an example. Referring to <FIG>, the method of updating a fingerprint template is performed by a processor in an electronic device and includes steps <NUM>-<NUM>.

At step <NUM>, a blank image in the fingerprint sensor region is acquired.

At step <NUM>, it is determined whether the blank image includes a foreign object region with an area greater than an area threshold. When yes, step <NUM> is executed; and when no, step <NUM> is performed.

At step <NUM>, it is determined that the fingerprint template is not updated and go back to step <NUM>.

At step <NUM>, a fingerprint image matched with the fingerprint template is acquired.

At step <NUM>, the blank image and the fingerprint image are compared.

At step <NUM>, it is determined whether the fingerprint image includes a foreign object region with an area greater than the area threshold. When yes, go back to step <NUM>; and when no, step <NUM> is performed.

At step <NUM>, the fingerprint template is updated.

The fingerprint template is updated when there is no foreign object region in the blank image and no foreign object region in the fingerprint image. In another example, the fingerprint template is updated when there is no foreign object region in the blank image and the fingerprint image includes a foreign object region with an area less than or equal to the area threshold. In yet another example, it is determined that the fingerprint template is not updated when there is no foreign object region in the blank image and the fingerprint image includes a foreign object region with an area exceeding the area threshold.

When there is no foreign object region in the blank image, it is determined that the fingerprint sensor has no hardware damage and that the fingerprint sensor region has no residue. In this case, when the fingerprint image includes a foreign object region, the processor may directly determine that the foreign object exists in the finger of the user, and prompt the user, such as by popping up a dialog box, a message and the like, so that the user can remove the foreign object in the finger in time.

In some cases, the fingerprint template is updated when the blank image includes a foreign object region with an area less than or equal to the area threshold and the fingerprint image includes a foreign object region with an area less than or equal to the area threshold. In some cases, it is determined that the fingerprint template is not updated when the blank image includes a foreign object region with an area less than or equal to the area threshold and the fingerprint image includes a foreign object region with an area exceeding the area threshold.

When the blank image includes a foreign object region, and the foreign object region in the blank image and the foreign object region in the fingerprint image have substantially the same shape, it may be determined that the hardware damage of the fingerprint sensor or the residue on the fingerprint sensor affects the fingerprint image. When the blank image includes a foreign object region, and the area of the foreign object region in the fingerprint image is larger than that of the foreign object region in the blank image, it may be determined that there is a foreign object in the finger of the user. In this case, the processor may prompt a user, such as by popping up a dialog box, a message and the like, so that the user can remove the foreign object in the finger in time.

When detecting that the finger of the user is close or pressing the fingerprint sensor, the fingerprint sensor scans the fingerprint sensor region to acquire a fingerprint image and transmits the fingerprint image to the processor. Then the processor determines whether the fingerprint image matches the fingerprint template. When the fingerprint image does not match the fingerprint template, the fingerprint sensor continues to scan the fingerprint sensor region. When the fingerprint image matches the fingerprint template, the fingerprint sensor acquires a blank image after the finger leaves the fingerprint sensor region and sends the blank image to the processor.

At step <NUM>, the fingerprint image and the blank image are compared.

At step <NUM>, it is determined whether the blank image or the fingerprint image includes a foreign object region with an area exceeding the area threshold. When yes, step <NUM> is performed; and when no, step <NUM> is performed.

The processor compares the blank image with the fingerprint image and determines whether to update the fingerprint template according to the comparison result. In an example, the fingerprint template is updated when there is no foreign object region in the blank image and no foreign object region in the fingerprint image. In another example, the fingerprint template is updated when there is no foreign object region in the blank image and the fingerprint image includes a foreign object region with an area less than or equal to the area threshold. In yet another example, it is determined that the fingerprint template is not updated when there is no foreign object region in the blank image and the fingerprint image includes a foreign object region with an area exceeding the area threshold. In yet another example, the fingerprint template is updated when the blank image includes a foreign object region with an area less than or equal to the area threshold and the fingerprint image includes a foreign object region with an area less than or equal to the area threshold. In yet another example, it is determined that the fingerprint template is not updated when the blank image includes a foreign object region with an area exceeding the area threshold and the fingerprint image includes a foreign object region with an area exceeding the area threshold.

In this example, the user may be prompted about the comparison result, and for possible ways of prompting, reference may be made to the description about <FIG>, which is not described in detail herein.

In above examples, the blank image and the fingerprint image both are considered. In a case that the blank image and the fingerprint image both include no foreign object or that the blank image and the fingerprint image both include a foreign object region with an area less than or equal to the area threshold, the fingerprint template is updated. In other cases, it is determined that the fingerprint template is not updated. In this way, the accuracy of the fingerprint template can be ensured, at some cases, such as a relatively large area of the hardware damage of the fingerprint sensor region, a relatively large residue in the fingerprint sensor region, a relatively large area in which the finger of the user is hurt or a relatively large residue in the finger of the user, it can be avoided that the fingerprint template is updated and thus the accuracy of the fingerprint identification is not reduced, so that the safety performance of the electronic device is ensured.

<FIG> is a flow diagram illustrating a method of updating a fingerprint template according to an example. Referring to <FIG>, the method includes steps <NUM>-<NUM>.

For step <NUM>, refer to <FIG>, which is not described herein.

At step <NUM>, it is determined whether the fingerprint template is to be updated according to the fingerprint image and the blank image.

At step <NUM>, the foreign object region with the area less than or equal to the area threshold in the fingerprint image is removed based on an image processing algorithm to obtain a processed fingerprint image.

In some cases, the processor removes the foreign object region in the fingerprint image based on the image processing algorithm when the blank image includes a foreign object region with an area less than the area threshold and the fingerprint image includes a foreign object region with an area less than the area threshold.

The image processing algorithm may be an image processing algorithm well known to those skilled in the art, and the image processing algorithm is used to remove the foreign object region from the corresponding fingerprint image. Of course, an image processing algorithm with a fingerprint repairing function can be used to adjust the fingerprints according to the trend of the fingerprints around the foreign object region, so that a processed fingerprint image is obtained.

At step <NUM>, the fingerprint template is updated with the processed fingerprint image.

The processed fingerprint image without the foreign object region is used as the fingerprint template, so that the accuracy of the fingerprint template can be improved, the accuracy of the fingerprint identification can be improved, and the safety performance of the electronic device is ensured.

An apparatus for updating a fingerprint template is provided by examples of the present disclosure. <FIG> is a block diagram of an apparatus for updating a fingerprint template according to an example. Referring to <FIG>, the apparatus <NUM> for updating a fingerprint template includes:.

In an example, <FIG> is a block diagram of an apparatus for updating a fingerprint template according to an example. On the basis of the apparatus for updating a fingerprint template shown in <FIG>, referring to <FIG>, the blank image acquiring module <NUM> includes:.

In an example, <FIG> is a block diagram of an apparatus for updating a fingerprint template according to an example. On the basis of the apparatus for updating the fingerprint template shown in <FIG>, referring to <FIG>, the fingerprint template updating module <NUM> includes:.

In an example, <FIG> is a block diagram of an apparatus for updating a fingerprint template according to an example. On the basis of the apparatus for updating a fingerprint template shown in <FIG>, referring to <FIG>, the apparatus further includes:
a fingerprint image acquiring module <NUM>, configured to obtain a fingerprint image matched with the fingerprint template.

The fingerprint template updating module <NUM> is further configured to determine whether the fingerprint template is to be updated according to the fingerprint image and the blank image when the fingerprint image matches the fingerprint template.

In an example, <FIG> is a block diagram of an apparatus for updating a fingerprint template according to an example. On the basis of the apparatus for updating the fingerprint template shown in <FIG>, referring to <FIG>, the fingerprint template updating module <NUM> further includes:.

In an example, the second fingerprint template updating unit <NUM> is further configured to update the fingerprint template when the fingerprint image includes a foreign object region with an area less than or equal to the area threshold and the blank image includes a foreign object region with an area less than or equal to the area threshold.

In an example, <FIG> is a block diagram of an apparatus for updating a fingerprint template according to an example. On the basis of the apparatus for updating the fingerprint template shown in <FIG>, referring to <FIG>, the fingerprint template updating module <NUM> further includes:
a foreign object region removing unit <NUM>, configured to remove the foreign object region with the area less than or equal to the area threshold in the fingerprint image based on an image processing algorithm to obtain a processed fingerprint image.

The second fingerprint template updating unit <NUM> is further configured to update the fingerprint template with the processed fingerprint image.

In an example, the second fingerprint template updating unit <NUM> is further configured to confirm not to update the fingerprint template when the fingerprint template includes a foreign object region with the area greater than the area threshold.

It is noted that the apparatus for updating a fingerprint template provided by examples of the present disclosure substantially corresponds to the method of updating a fingerprint template, and since the steps of the method of updating a fingerprint template have been described in detail in the above examples, the apparatus examples may refer to the method examples. In addition, different application scenarios, the method of updating the fingerprint template may also make corresponding adjustment, and the apparatus for updating the fingerprint template may also adopt different functional components to re-adjust, and further detail is omitted.

<FIG> shows a block diagram of an electronic device according to an example. The electronic device <NUM> may be a mobile phone, a computer, a digital broadcasting terminal, a message transceiver, a game console, a tablet device, a medical device, a fitness facility, and a personal digital assistant.

With reference to <FIG>, the electronic device <NUM> may include one or more of: a processing component <NUM>, a memory <NUM>, a power supply component <NUM>, a multimedia component <NUM>, an audio component <NUM>, an Input/Output (I/O) interface <NUM>, a sensor component <NUM>, and a communication component <NUM>.

The processing component <NUM> generally controls the overall operations of the electronic device <NUM>, such as operations associated with display, calling, data communication, camera operation and recording operation. The processing component <NUM> may include one or more processors <NUM> for executing instructions to complete all or part of steps of the above-described method. Besides, the processing component <NUM> may include one or more modules to facilitate interactions between the processing component <NUM> and other components. For example, the processing component <NUM> may include a multimedia module to facilitate the interaction between the multimedia component <NUM> and the processing component <NUM>. In an example, when reading the machine executable instructions, the processor <NUM> is caused to perform the above method.

The memory <NUM> is configured to store different types of data to support the operations of the electronic device <NUM>. Examples of such data include instructions of any application program or method operable on the electronic device <NUM>, contact data, telephone directory data, messages, pictures, videos, and the like. The memory <NUM> may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Electrically Programmable Read-Only-Memory (EPROM), a Programmable Read-Only-Memory (PROM), a Read-Only Memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk.

The power supply component <NUM> provides power for different components of the electronic device <NUM>. The power supply component <NUM> may include a power management system, one or more power sources, and other components associated with generating, managing and distributing power for the electronic device <NUM>.

The multimedia component <NUM> may include a screen for providing an output interface between the electronic device <NUM> and a user. In some examples, the screen may include a Liquid Crystal Display (LCD) and/or a Touch Panel (TP). When the screen includes a touch panel, the screen may be implemented as a touch screen to receive input information from a user. The touch panel may include one or more touch sensors to sense touch, slide and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide motion but also detect duration and pressure related to the touch or slide operation.

The audio component <NUM> is configured to output and/or input an audio signal. For example, the audio component <NUM> may include a microphone (MIC). When the electronic device <NUM> is in an operating mode, such as a call mode, a recording mode and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal may be further stored in the memory <NUM> or transmitted via the communication component <NUM>.

The I/O interface <NUM> provides an interface between the processing component <NUM> and a peripheral interface module. The peripheral interface module may be a keyboard, a click wheel, a button and the like. Such buttons may include but not limited to: a home button, a volume button, a start button and a lock button.

The sensor component <NUM> may include one or more sensors for providing state assessments in different aspects for the electronic device <NUM>. For example, the sensor component <NUM> may detect the on/off state of the electronic device <NUM>, and relative locations of components, such as a display and a small keyboard of the electronic device <NUM>. The sensor component <NUM> may also detect a position change of the electronic device <NUM> or a component of the electronic device <NUM>, the presence or absence of contact of a user with the electronic device <NUM>, an orientation or acceleration/deceleration of the electronic device <NUM> and a temperature change of the electronic device <NUM>. The sensor component <NUM> may include a proximity sensor configured to detect a nearby object without any physical contact. The sensor component <NUM> may also include an optical sensor, such as a CMOS or CCD image sensor for being used in imaging application. In some examples, the sensor component <NUM> may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

The communication component <NUM> is configured to facilitate wired or wireless communication between the electronic device <NUM> and other devices. The electronic device <NUM> may access a wireless network based on a communication standard, such as WIFI, <NUM> or <NUM>, or a combination thereof. In an example, the communication component <NUM> receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an example, the communication component <NUM> may also include a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra-Wide Band (UWB) technology, Bluetooth (BT) technology and other technology.

In an example, the electronic device <NUM> may be implemented by one or more of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processor (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components, so as to perform the above method.

In an example, the present disclosure further provides a non-transitory machine-readable storage medium storing machine executable instructions, such as memory <NUM> to store instructions. The instructions may be executed by processor <NUM> in the electronic device <NUM> to implement the above methods as shown in <FIG>. In an example, the non-transitory machine-readable storage medium includes ROM, RAM, CD-ROM, magnetic tape, soft disk and optical data storage.

Claim 1:
A method for updating a fingerprint template in a fingerprint template library, the method comprising:
acquiring by an electronic device, a fingerprint image of a finger in a fingerprint sensor region of a fingerprint sensor in the electronic device;
determining whether the fingerprint image matches the fingerprint template;
characterised by:
when the fingerprint image matches the fingerprint template,
acquiring (<NUM>), by the electronic device, a blank image of the fingerprint sensor region after the finger leaves the fingerprint sensor region;
determining (<NUM>), by the electronic device, whether the blank image or the fingerprint image includes a foreign object region with an area greater than an area threshold;
(<NUM>) when the blank image or the fingerprint image includes a foreign object region with an area greater than the area threshold, confirming, by the electronic device, not to update the fingerprint template; and
(<NUM>) when neither the blank image nor the fingerprint image includes any foreign object region with an area greater than the area threshold, updating, by the electronic device, the fingerprint template with the fingerprint image;
wherein the foreign object region in the blank image corresponds to a hardware damage of the fingerprint sensor or a residue in the fingerprint sensor region, and the foreign object region in the fingerprint image corresponds to a foreign object in the finger.