Fingerprint identification method and device for intelligent water cup
By collecting grayscale fingerprint images from smart water cups, identifying and extracting core feature points, and combining multi-scale window and grid region matching, the problem of low fingerprint recognition accuracy in smart water cups is solved, achieving higher recognition accuracy and security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN TUQIANG WULIAN TECH CO LTD
- Filing Date
- 2025-12-17
- Publication Date
- 2026-05-01
AI Technical Summary
In smart water bottles, the accuracy of fingerprint recognition technology is low, making it difficult to effectively distinguish the fingerprint characteristics of different users. This could lead to unauthorized users potentially using the water bottle, affecting user privacy and security.
By acquiring fingerprint grayscale images, identifying core feature points, calculating the initial orientation field map using the Sobel operator, performing Gaussian smoothing and local consistency verification, and combining multi-scale window sliding scan, calculating the orientation distribution variance and the number of target peaks, extracting core feature points, and achieving alignment processing by matching the standard grayscale image with the grid region, thereby improving recognition accuracy.
It improves the accuracy of fingerprint recognition, reduces the probability of false recognition, ensures the reliability of user authentication and the security of the water cup, and is especially suitable for shared environments such as homes and offices.
Smart Images

Figure CN121963259A_ABST
Abstract
Description
A fingerprint recognition method and device for a smart water bottle Technical Field
[0001] This invention belongs to the technical field of data recognition, and particularly relates to a fingerprint recognition method and device for a smart water cup. Background Technology
[0002] Water bottles are essential tools for children's daily drinking. In group settings such as schools, children often share water bottles, leading to hygiene risks. Smart water bottles, as a new type of intelligent product, are increasingly attracting consumer attention. Traditional water bottles only have basic drinking functions, while smart water bottles integrate advanced technologies to provide various additional functions, such as temperature monitoring, drinking reminders, and health records. Among these, the introduction of user identification technology allows smart water bottles to better meet personalized needs and improve user experience.
[0003] Fingerprint recognition technology, as a biometric technology, boasts advantages such as high security and convenience, and is widely used in areas such as mobile phone unlocking and payment authentication. Applying fingerprint recognition technology to smart water bottles can effectively prevent unauthorized users from using the bottle, protecting user privacy and security. Furthermore, different users have different drinking habits and health needs; smart water bottles, through fingerprint recognition technology, can identify the user and thus provide customized drinking plans and health advice.
[0004] Currently, in the fingerprint recognition technology of smart water bottles, the fingerprint characteristics of different users vary greatly, and how to improve the recognition accuracy is a challenge in technology research and development. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a fingerprint recognition method and device for a smart water cup to solve the technical problem of low recognition accuracy.
[0006] A first aspect of this invention provides a fingerprint recognition method for a smart water bottle. The fingerprint recognition method for the smart water bottle includes: acquiring a fingerprint grayscale image through a fingerprint unit, identifying core feature points in the fingerprint grayscale image; performing alignment processing based on the core feature points to obtain a target grayscale image; wherein the target grayscale image and a standard grayscale image are aligned, and the standard grayscale image refers to the image corresponding to the fingerprint information of the fingerprint user; dividing the target grayscale image and the standard grayscale image into multiple grid regions, and matching the target grayscale image to determine whether the user to be identified is the fingerprint user based on the multiple grid regions.
[0007] Further, the step of acquiring a fingerprint grayscale image through a fingerprint unit and identifying core feature points in the fingerprint grayscale image includes: acquiring a fingerprint grayscale image through a fingerprint unit; calculating an initial orientation field map of the fingerprint grayscale image based on the Sobel operator; performing Gaussian smoothing and local consistency verification on the initial orientation field map to obtain a fingerprint orientation field map; performing sliding scans on the fingerprint orientation field map using various square windows, and calculating histogram arrays corresponding to multiple pixel orientation angle ranges within the square windows; wherein the sizes of the various square windows include 16 pixels x 16 pixels, 24 pixels x 24 pixels, and 32 pixels. The system comprises 32 pixels x 32 pixels, and the multiple pixel orientation angle ranges include 16 orientation range intervals corresponding to 360°. The histogram array is used to represent the number of pixels corresponding to the multiple pixel orientation angle ranges. The maximum value in the histogram array is extracted, and the center orientation angle of the pixel orientation angle range corresponding to the maximum value is taken as the main direction. Based on the histogram array and the main direction, the orientation distribution variance and the number of target peaks are calculated. The local curvature is calculated within a square window based on the orientation gradients in the x-axis and y-axis directions. The core feature points are extracted based on the absolute values of the orientation distribution variance, the number of target peaks, and the local curvature.
[0008] Further, the step of calculating the directional distribution variance and the number of target peaks based on the histogram array and the main direction includes: calculating the directional distribution variance corresponding to the main direction based on a preset function; wherein, the preset function is: directional distribution variance = (Σ[H[b]×min( |angle)) / ( ... b -θ dom |, 180°-|angle b -θ dom | )²]) / (N * (90°)²), H[b] represents the value corresponding to the direction angle range of the b-th pixel in the histogram array, angle b θ represents the center angle of the directional angle range of the b-th pixel. dom The main direction is indicated by N, the total number of pixels within the square window is indicated by min(), and (90°)² is the normalization factor. Local maximum values are extracted from the histogram array. A local maximum value is defined as a value whose current value is greater than its two adjacent values. Local maximum values greater than the filtering threshold are used as target peaks, and the number of target peaks is counted. The filtering threshold is 0.5 × the maximum value of the histogram array.
[0009] Further, the step of extracting the core feature points based on the directional distribution variance, the number of target peaks, and the absolute value of the local curvature includes: weighted summing of the directional distribution variance, the number of target peaks, and the absolute value of the local curvature corresponding to each square window to obtain a core score; performing non-maximum suppression on the score map composed of the core scores to obtain a current score map; filtering out candidate core points with scores greater than a score threshold in the current score map; clustering all candidate core points corresponding to all square windows based on a distance threshold method to obtain multiple clusters; and using the candidate core point corresponding to the maximum core score in the cluster as the core feature point.
[0010] Further, the step of aligning the core feature points to obtain the target grayscale image includes: obtaining the first pixel position of the core feature points in the standard grayscale image; extracting the second pixel position of the core feature points in the fingerprint grayscale image; and translating and / or rotating the fingerprint grayscale image based on the first pixel position and the second pixel position to obtain the target grayscale image.
[0011] Further, the step of dividing the target grayscale image and the standard grayscale image into multiple grid regions, and matching the target grayscale image to determine whether the user to be identified is the fingerprint user based on the multiple grid regions includes: dividing the target grayscale image and the standard grayscale image into N rows and M columns of grid regions; assigning a preset weight to each grid region; wherein the weight of the central grid region is greater than the weight of the edge grid regions; calculating the first ridge distribution feature vector of each grid region in the target grayscale image; obtaining the second ridge distribution feature vector in the standard grayscale image; calculating the cosine similarity between the first ridge distribution feature vector and the second ridge distribution feature vector; multiplying and summing the cosine similarity corresponding to each grid region with the preset weight to obtain the total similarity; if the total similarity is greater than the similarity threshold, then confirming the user to be identified as the fingerprint user.
[0012] Further, the step of calculating the first ridge distribution feature vector of each grid region in the target grayscale image includes: calculating the first gradient in the horizontal direction and the second gradient in the vertical direction for each pixel in the grid region; calculating the sum of the first gradient components in the horizontal direction and the sum of the second gradient components in the vertical direction for all pixels in the grid region based on the first gradient and the second gradient; calculating the grid orientation angle based on the sum of the first gradient components and the sum of the second gradient components; wherein the grid orientation angle represents the average direction of the fingerprint ridges in the grid region; calculating the pixel orientation angle based on the first gradient and the second gradient of each pixel; dividing the grid orientation angle into K directional intervals; counting the number of pixels whose pixel orientation angles fall into the directional intervals; constructing a vector from the number of pixels corresponding to each of the K directional regions to obtain the first ridge distribution feature vector.
[0013] A second aspect of this invention provides a fingerprint recognition device for a smart water bottle, comprising: a collection unit for collecting a fingerprint grayscale image through a fingerprint unit and identifying core feature points in the fingerprint grayscale image; an alignment unit for performing alignment processing based on the core feature points to obtain a target grayscale image; wherein the target grayscale image and a standard grayscale image are aligned, and the standard grayscale image refers to the image corresponding to the fingerprint information of the fingerprint user; and a matching unit for dividing the target grayscale image and the standard grayscale image into multiple grid regions, and matching whether the user to be identified in the target grayscale image is the fingerprint user based on the multiple grid regions.
[0014] A third aspect of the present invention provides a smart water cup, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the fingerprint recognition method for the smart water cup described in the first aspect.
[0015] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the fingerprint recognition method for the smart water cup described in the first aspect.
[0016] The beneficial effects of this invention compared to existing technologies are as follows: integrating fingerprint recognition into a smart water bottle effectively prevents unauthorized users from using the bottle, thereby protecting user privacy and drinking water safety. This feature is particularly suitable for shared environments such as homes and offices, ensuring an undisturbed user experience and enhancing product security. By acquiring fingerprint grayscale images and identifying core feature points through the fingerprint unit, this invention can accurately extract the unique features of a user's fingerprint. This process not only improves the accuracy of fingerprint recognition but also effectively reduces the probability of false recognition, laying the foundation for the reliability of the smart water bottle in user authentication. Combined with the alignment processing of standard grayscale images, reasonable matching of fingerprint features from different users is ensured, further improving the overall recognition success rate. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 shows a schematic flowchart of a fingerprint recognition method for a smart water cup provided by the present invention; Figure 2 shows a schematic diagram of a fingerprint recognition device for a smart water cup provided by an embodiment of the present invention; Figure 3 shows a schematic diagram of a smart water cup provided by an embodiment of the present invention. Detailed Implementation
[0019] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.
[0020] This invention provides a fingerprint recognition method and device for a smart water cup, which solves the technical problem that traditional technologies fail to consider the dynamic changes in communication traffic, causing the device to still operate in high-power mode when communication traffic is low, resulting in unnecessary energy consumption.
[0021] First, this invention provides a fingerprint recognition method for a smart water cup. Please refer to Figure 1, which shows a schematic flowchart of the fingerprint recognition method for a smart water cup provided by this invention. As shown in Figure 1, the fingerprint recognition method for the smart water cup may include the following steps: Step 101: Acquire a fingerprint grayscale image through a fingerprint unit, and identify the core feature points in the fingerprint grayscale image; the fingerprint sensor (fingerprint unit) on the smart water cup captures the image when the user's finger presses down. This image is grayscale (only brightness information, no color), which is more conducive to extracting stable fingerprint features than a color image.
[0022] The acquired grayscale fingerprint images are processed to locate and extract core feature points. These core feature points include, but are not limited to, the center point of the pattern (such as the center of a whorl pattern, the center of a loop pattern, etc.), triangular points, endpoints, or a set of feature points that are highly unique, stable, and easy to locate.
[0023] Core feature points serve as anchor points or reference points for the entire fingerprint. Accurate identification of these points is fundamental to subsequent alignment steps. If this step is incorrect or unstable, the accuracy of the entire identification process will be significantly reduced.
[0024] Specifically, step 101 includes steps 1011 to 1018: Step 1011: Acquire a grayscale image of a fingerprint through the fingerprint unit; the fingerprint sensor (fingerprint unit) of the smart water bottle acquires an image of the user's finger pressing. This image is grayscale (only brightness information), which simplifies subsequent processing and reduces noise.
[0025] Step 1012: Calculate the initial orientation field map of the fingerprint grayscale image based on the Sobel operator; the Sobel operator is a classic edge detection operator that senses edge orientation and intensity by calculating the gradient (rate of change) of the image in the horizontal and vertical directions. Here, it is used to estimate the orientation of local ridges, resulting in a map of the same size as the fingerprint image (or slightly lower resolution), where each value represents the local ridge orientation angle of the pixel neighborhood at that location (typically ranging from 0° to 180° or 0 to π, because the orientation is periodic).
[0026] The core feature points are essentially points where the fingerprint ridge orientation pattern changes significantly or converges / diversifies. The orientation field is the most basic and important information for identifying these points. This step provides raw orientation data for subsequent analysis.
[0027] Step 1013: Perform Gaussian smoothing and local consistency verification on the initial orientation field map to obtain the fingerprint orientation field map; use a Gaussian filter to perform convolution operation on the orientation field map. This can effectively filter out orientation jumps or discontinuities caused by noise, making the orientation field change smoother and more consistent with the continuous change trend of actual fingerprint ridges.
[0028] Local consistency checks are used to verify whether the orientation of a pixel is consistent with the orientation of its surrounding neighborhood (e.g., 3x3, 5x5). If they are inconsistent (e.g., the difference exceeds a certain threshold), the orientation of the pixel may be calculated incorrectly (e.g., it is located at a break or is a noise point), and it needs to be corrected based on the orientation of its neighborhood (e.g., by taking the neighborhood average or median).
[0029] The above processing yields a more accurate, smoother, and more consistent orientation field map, significantly improving the reliability of the orientation field data. Noise and inconsistencies can severely interfere with subsequent core point detection algorithms. Smoothing and verification are crucial preprocessing steps to ensure orientation field quality and improve core point recognition accuracy.
[0030] Step 1014: Perform sliding scans on the fingerprint orientation field map using various square windows, and calculate histogram arrays corresponding to multiple pixel orientation angle ranges within the square windows; wherein the sizes of the various square windows include 16 pixels x 16 pixels, 24 pixels x 24 pixels, and 32 pixels x 32 pixels, and the multiple pixel orientation angle ranges include 16 orientation range intervals corresponding to 360°, and the histogram array is used to represent the number of pixels corresponding to the multiple pixel orientation angle ranges; slide square windows of different sizes on the smoothed orientation field map. At each window position, statistically analyze the orientation angle distribution of all pixels within the window. Use a sliding window of size Scale_s x Scale_s, and traverse the entire effective foreground region of the image (excluding the background) with a certain step size Step_s (usually smaller than the window size, such as Step_s = Scale_s / 4 or Scale_s / 2 to maintain coverage).
[0031] Using multi-scale windows can avoid missing or misdetecting features of different scales that a single window size may miss, improve the algorithm's robustness to fingerprint size and image resolution, and more comprehensively capture directional pattern changes in different neighborhood ranges.
[0032] The azimuth angle range (360° / 16 = 22.5° range) discretizes the continuous azimuth angle (0°-360°) into 16 ranges (e.g., 0°-22.5°, 22.5°-45°,...,337.5°-360°).
[0033] The number of pixels falling within each directional interval is counted. This results in an array of 16 elements, where each element represents the number of pixels within the corresponding directional interval. This visually reflects the distribution of fingerprint ridge directions within the window.
[0034] The core detection logic for key feature points occurs during this sliding window statistical process. By analyzing the histograms of directional distribution within windows of different positions and sizes, regions where directional patterns undergo unusual changes (such as convergence, divergence, or sharp bending) can be identified. These regions are likely to be the locations of core points or triangulation points.
[0035] Step 1015: Extract the maximum value from the histogram array and take the center angle of the pixel orientation angle range corresponding to the maximum value as the principal direction; find the interval containing the most pixels among the 16 orientation intervals. This represents the most prevalent ridge direction within the window region. Define the center angle of this most prevalent interval (e.g., the center of the 0°-22.5° interval is 11.25°) as the principal direction of the window. Determining the dominant direction of the window region serves as the benchmark or reference direction for calculating subsequent features (variance, number of peaks, curvature).
[0036] Step 1016: Calculate the directional distribution variance and the number of target peaks based on the histogram array and the main direction; calculate the variance of the orientation angle of all pixels (or the representative value of its interval) relative to the main direction.
[0037] Low variance indicates that directions are highly concentrated near the principal direction (high consistency). High variance indicates that directions are widely distributed (low consistency). Core point regions (such as the center point) typically have low variance because ridges flow in regular concentric circles or symmetrical directions around the core point. Triangular point regions exhibit drastic changes in direction and may have higher variance.
[0038] Analyze the histogram array to identify the number of significant peaks (e.g., intervals with heights exceeding a certain threshold or those significantly different from adjacent intervals). This reflects the multimodal nature of the directional distribution. A single peak indicates a high concentration of directional flow (common in ordinary ridge regions or at the center point). Bimodal or multimodal flows indicate the presence of multiple dominant flow directions (common in triangular regions, where different flow ridges converge).
[0039] The variance of the directional distribution and the number of target peaks provide important indicators for distinguishing between core point types and background regions. The variance of the directional distribution and the number of target peaks are key features for identifying singular points (core points, triangulation points) in the directional field.
[0040] Specifically, step 1016 includes steps A1 to A3: Step A1: Calculate the direction distribution variance corresponding to the main direction based on a preset function; wherein, the preset function is: direction distribution variance = (Σ[H[b]×min( |angle)) / (H[b]×min( |angle ... b -θ dom |, 180°-|angle b -θ dom| )²]) / (N * (90°)²), H[b] represents the value corresponding to the direction angle range of the b-th pixel in the histogram array, angle b θ represents the center angle of the directional angle range of the b-th pixel. dom The main direction is represented by N, which represents the total number of pixels within the square window. min() is used to take the shortest distance on the circumference, and (90°)² is the normalization factor. The variance of the direction distribution is: (Σ[H[b] × min( |angleb-θdom|, 180°-|angleb-θdom| )²]) / (N * (90°)²). Σ (summation) represents summing all directional intervals b (b=1 to 16) of the histogram.
[0041] H[b] represents the number of pixels corresponding to the b-th direction interval in the histogram array. It represents the weight of that direction interval within the window.
[0042] min( |angleb-θdom|, 180°-|angleb-θdom| ) This is one of the key points of the function and one of the points that ensures accuracy.
[0043] angleb represents the center angle of the b-th direction interval (for example, the center of the 0°-22.5° interval is 11.25°).
[0044] θdom represents the main direction of the window.
[0045] |angleb-θdom| represents the absolute difference between the center angle and the principal direction angle.
[0046] The calculation method `min(|diff|, 180°-|diff|)` is based on the periodicity of direction angles (0°≡180°≡360°). The actual minimum difference angle (shortest arc length) between two directions is the smaller value between `|diff|` and `(180° - |diff|)`. For example: if `|diff| = 10°`, `min(10°, 170°) = 10°`; if `|diff| = 170°`, `min(170°, 10°) = 10°` (because a difference of 170° is equivalent to moving 10° in the other direction); if `|diff| = 90°`, `min(90°, 90°) = 90°`. Correctly calculating direction differences is crucial for core point detection. Directional changes near the core point are continuous, but when crossing 180°, the direct difference becomes large, while the actual direction change is small (e.g., from 179° to 181°, the actual difference is only 2°). The min() function ensures that the shortest distance on the circumference is calculated, which truly reflects the continuity of the orientation field changes and significantly improves the accuracy of variance calculation, especially near the core point where the orientation field changes drastically.
[0047] [min(...)]² squares the smallest directional difference angle. The squaring operation amplifies the effect of large difference angles (variance focuses more on the degree of deviation) and ensures the result is non-negative.
[0048] H[b] × [min(...)]² multiplies the number of pixels (weight) in each directional interval b by the square of its minimum directional difference. This represents the contribution of all pixels in that interval to the total directional deviation.
[0049] Σ[H[b] × ... ] sums up the contributions of all directional intervals b to obtain the weighted sum of squared differences of all pixels in the window relative to the main direction.
[0050] Denominator / (N * (90°)²): N is the total number of pixels within the square window. This is intended to make calculations comparable across different window positions and image sizes. Using N is a specific normalization choice that scales the variance relative to the entire image size.
[0051] (90°)² is the normalization factor. 90° is the theoretical maximum value of the directional difference on the circumference (because min(|diff|, 180-|diff|) is at most 90°), and its square (90°)² is the theoretical maximum value of [min(...)]². Dividing by (90°)² aims to normalize the range of variance values to the interval [0, 1].
[0052] When all pixel directions are exactly equal to the principal direction, the variance is 0.
[0053] When all pixel orientations are strictly perpendicular to the main direction (i.e., 90° apart), the variance = (Σ[H[b] * (90°)^2]) / (N * (90°)^2) = (ΣH[b]) / N. If ΣH[b] ≈ N (the window covers most of the image or the boundary is ignored), then the variance ≈ 1.
[0054] The normalized variance value has a clear range and physical meaning, which makes it easier to set a uniform threshold for judgment (e.g., low variance < 0.2 indicates that the direction is highly consistent), thus improving the robustness and configurability of the algorithm.
[0055] This function accurately and normally calculates the consistency (variance) of the fingerprint ridge orientation relative to the main orientation within the current sliding window region. By cleverly handling orientation periodicity (min function) and normalizing ((90°)²), it ensures that the calculation results accurately reflect the concentration / dispersion characteristics of the orientation field, providing a reliable basis for core point identification. Low variance typically indicates areas with highly consistent orientations (such as near the center of the core point), while high variance indicates areas with drastic or dispersed orientation changes (such as triangulation points or ordinary background).
[0056] Step A2: Extract local maxima from the histogram array; where a local maxima is defined as a value whose current value is greater than its two adjacent values. In the histogram array (a one-dimensional array of 16 elements), an element H[i] is considered a local maxima if and only if: H[i] > H[i-1] (if i>1); and H[i] > H[i+1] (if i<16). This is a simple and effective peak detection method. It identifies all the convex vertices in the histogram, which represent some relatively concentrated local dominant directions in the directional distribution. This is the basis for detecting multi-peak distributions (such as triangular point features).
[0057] Step A3: Take the local maximum value that is greater than the filtering threshold as the target peak and count the number of target peaks; wherein, the filtering threshold = 0.5 × the maximum value of the histogram array.
[0058] The filtering threshold is 0.5 × Max_H. Max_H is the maximum value in the entire histogram array (i.e., the number of pixels in the interval containing the most pixels, which is the interval corresponding to the main direction).
[0059] Only local maxima whose height exceeds the screening threshold (> 0.5 * Max_H) are considered valid target peaks. The total number of target peaks meeting the criteria is calculated and denoted as the number of target peaks, P.
[0060] The histogram may contain many small peaks caused by noise or minor fluctuations. Filtering using a threshold (0.5 * Max_H) related to the height of the main peak retains only those significant peaks whose height is at least half the height of the main peak. This effectively removes spurious peaks caused by noise.
[0061] The number of target peaks, P, directly reflects the significant multimodality of the directional distribution within the window. P = 1: This usually indicates only one dominant direction (single peak), commonly found in ordinary ridge regions or near the core point (center point). P >= 2: This indicates the presence of two or more significantly different dominant directions (multi-peak), which is a typical characteristic of the core point region because the core point is the convergence point of different flow ridges.
[0062] Using a relative threshold (0.5 * Max_H) instead of an absolute threshold allows the algorithm to adapt to changes in image quality and pixel density within different windows, improving detection stability.
[0063] In the embodiments corresponding to steps A1 to A3, the periodicity of direction is perfectly handled by min(|diff|, 180-|diff|), ensuring accurate measurement of directional changes near the core point. Normalization using (90°)² ensures the variance falls within the range [0,1], possessing clear physical meaning and comparability. Scaling using N (total pixels) is a specific normalization strategy (its effectiveness needs verification). A quantitative index (V) reliably reflecting the consistency / dispersion of the direction field is obtained, serving as the core basis for distinguishing core points, triangular points, and stable regions. All potential peaks are located through a strict definition of local maxima (greater than their left and right neighbors). Significant peaks are filtered using an adaptive threshold (0.5 * Max_H), effectively suppressing noise interference. An index reliably reflecting the multimodality (P) of the direction field is obtained, serving as a key basis for identifying directional convergence features such as triangular points.
[0064] Step 1017: Calculate the local curvature within the square window based on the directional gradients in the x-axis and y-axis directions; calculate the spatial rate of change of the orientation field map in the horizontal (x-axis) and vertical (y-axis) directions (i.e., the partial derivatives of the orientation angles with respect to x and y).
[0065] The curvature of the orientation field in this window region is calculated using the orientation gradient: (∂θ / ∂x * sin(θ(x, y)) - ∂θ / ∂y * cos(θ(x, y))) or its variants to estimate the total curvature. The core point is usually the point where the orientation field curvature is greatest because the ridge line makes a sharp 180° turn here.
[0066] One of the most prominent features of the core point is the sharp curvature of the orientation field. Calculating the local curvature is a key step in directly capturing this feature and can effectively distinguish between the core point and gentle regions.
[0067] Step 1018: Extract the core feature points based on the directional distribution variance, the number of target peaks, and the absolute value of the local curvature.
[0068] Using the three key features calculated earlier (directional distribution variance V, number of target peaks P, and absolute value of local curvature |C|), rules are designed to determine whether the current window center is a valid core feature point. Finally, the core feature point is identified and located. By combining three complementary features—directional consistency (V), directional pattern complexity (P), and the degree of directional change (|C|)—this method can more accurately and robustly identify true core points and triangulation points, avoiding false detections caused by noise, scars, or low-quality regions. This is the final output of the entire core point identification process.
[0069] In the embodiments corresponding to steps 1011 to 1018, a very systematic and detailed core point detection method based on fingerprint orientation field characteristics is described. Its multi-scale, multi-feature fusion approach is a key technical guarantee for improving fingerprint recognition accuracy in practical application scenarios such as smart water cups. It clearly defines the specific technical means to achieve the function of recognizing core feature points.
[0070] Specifically, step 1016 includes steps B1 to B5: Step B1: The absolute values of the direction distribution variance, the number of target peaks, and the local curvature corresponding to each square window are weighted and summed to obtain the core score; For each sliding window position (the center of the window usually represents a candidate point position), the three key feature quantities calculated are: V: direction distribution variance (low value is good, indicating consistent direction); P: number of target peaks (specific value indicates core point or triangular point type); |C|: absolute value of local curvature (high value is good, indicating drastic change in direction).
[0071] Calculate a comprehensive score S (core score) = w_v * V + w_p * P + w_c * |C|; where w_v, w_p, and w_c are the weighting coefficients of V, P, and |C|, respectively (w_v may be negative because low variance is good; w_c is positive because high curvature is good; w_p is set according to the target point type). Among these, directional variance (V) is usually the most stable and should be given the highest weight (0.3-0.5). The number of target peaks (P) is crucial in triangulation detection but occurs infrequently, so its weight is moderate (0.2-0.4). Curvature (|C|), although sensitive, is easily affected by noise, so its weight is slightly lower (0.1-0.3). The sum of the three is 1 to maintain normalization.
[0072] This score comprehensively reflects the degree to which the window location matches a core feature point (such as a core point or triangulation point). The higher the score, the greater the likelihood that the location is a true core point.
[0073] This involves fusing multidimensional features into a single, comparable metric. This forms the basis of decision-making, allowing different positions to be ranked and compared based on the overall score. The weighting reflects prior knowledge of the importance of different features.
[0074] Step B2: Perform non-maximum suppression on the rating map composed of the core scores to obtain the current rating map; the resolution of the rating map is determined by the sliding window step size, and the value at each position is the core score S calculated by the window at that position.
[0075] Nonmaximum suppression is a classic local maximum search technique commonly used in object detection and feature point detection to remove duplicate responses. Its operation is as follows: for each point (candidate location) in the rating map, check if there is a point with a higher rating within its neighborhood (e.g., 3x3, 5x5, or related to window size). If a higher-rated neighbor exists, the rating of that point is suppressed (usually set to 0 or a very low value). If the point has the highest rating within its neighborhood, its rating is retained.
[0076] The score map after nonmaximum suppression processing. Only local maxima (i.e., the locations near which the highest scores are found) are retained in the map, while the scores at other locations are significantly reduced or reduced to zero.
[0077] Because sliding windows may overlap, and a true feature point (such as a core point) may produce high scores in multiple adjacent windows (but with slight positional deviations), non-maximum suppression ensures that each local feature peak retains only the location with the strongest response. The retained location is usually the true peak point of the feature response, improving localization accuracy. It also significantly reduces the number of candidate points requiring further processing.
[0078] Step B3: Filter out candidate core points with scores greater than the score threshold in the current score graph; traverse the current score graph after non-maximum suppression processing, and only retain those points whose scores S are greater than the threshold T_score. These points are called candidate core points.
[0079] Even after non-maximum suppression, some low-score residues may still remain in the image background or weak feature regions. Setting a threshold T_score can filter out these low-confidence false positive responses.
[0080] Ensure that the candidate points in subsequent processing all have sufficiently high evidence that they may be true core feature points.
[0081] Step B4: Cluster all candidate core points corresponding to the square windows based on the distance threshold method to obtain multiple clusters; multi-scale windows (16x16, 24x24, 32x32) are used for sliding scanning. A real large core feature point (such as a relatively "fat" core point) may be detected by windows of different scales at different locations (but all fall within the region of that feature point), generating multiple spatially adjacent candidate points.
[0082] Distance-threshold clustering uses a preset spatial distance threshold (e.g., 5-10 pixels, or defined according to image resolution). All candidate core points (from windows at all scales) are treated as a set of points. If the Euclidean distance between two candidate points is less than D_threshold, they are considered to belong to the same latent feature and should be grouped into the same cluster. A simple algorithm (such as connected component analysis or a simplified version of DBSCAN) is used to aggregate all points that meet the distance condition, forming several clusters. Each cluster contains one or more candidate points that are spatially close. This ensures that the same true feature point, regardless of the window scale it is detected by, is ultimately identified as only one entity, avoiding duplicate counting. Even if detection is unstable at one scale, stable detection results at other scales can still be included through clustering. Each cluster represents a latent, spatially consistent core feature point location.
[0083] Step B5: Select the candidate core point corresponding to the maximum core score in the cluster as the core feature point.
[0084] Find the point with the highest core score S among all candidate core points within the cluster. Select this point with the highest score as the output location of the final core feature point (such as a core point or triangulation point) represented by the cluster. Among the neighboring points of the cluster, select the point with the highest confidence (largest score S) as the final output point. This is usually the point that best represents the center or most salient location of the feature point. This completes the entire process from the original image to the localization of the core feature point.
[0085] In the embodiments corresponding to steps B1 to B5, a unified confidence score is generated by integrating directional consistency (V), directional pattern (P), and directional abrupt change (|C|) to quantify the probability of a core point at each location. Non-maximum suppression addresses the local redundancy problem within a single scale, accurately locates local response peaks, and reduces the number of candidate points. Score threshold filtering removes low-confidence responses, improving the overall quality of candidate points. Distance threshold clustering solves the problem of neighbor point aggregation caused by multi-scale detection, ensuring that a true feature point corresponds to only one cluster. Maximum score selection within each cluster chooses the point with the highest confidence as the final core feature point, ensuring the reliability of the output results. This constitutes a complete and detailed technical solution from fingerprint image acquisition to accurate localization of core feature points, with particular emphasis on strategies to address challenges such as multi-scale and noise in practical applications (e.g., smart water cups), which is crucial for improving the overall accuracy and reliability of fingerprint recognition systems.
[0086] Step 102: Alignment processing is performed based on the core feature points to obtain the target grayscale image; wherein, the target grayscale image and the standard grayscale image are aligned, and the standard grayscale image refers to the image corresponding to the fingerprint information of the fingerprint user; this step solves the problem of translation, rotation, or even slight deformation that may occur when the fingerprint is pressed each time. The core feature points identified in the first step are used as a reference.
[0087] The newly acquired fingerprint grayscale image is adjusted through geometric transformations (such as rotation, translation, and sometimes slight scaling or affine transformations) to make the positions of its core feature points coincide as closely as possible with the corresponding core feature point positions of the pre-stored standard fingerprint grayscale image. The newly acquired image after alignment transformation is called the target grayscale image.
[0088] After alignment, the target grayscale image and the standard grayscale image stored during user registration achieve maximum spatial matching (core point alignment), eliminating the main deviation caused by inconsistent pressing postures.
[0089] This is one of the core steps to improve accuracy. One of the biggest challenges in fingerprint recognition is that the angle and position of a user's press will never be exactly the same each time. Directly comparing misaligned images, even for the same fingerprint, will result in very low similarity. By using precise alignment (relying on stable core feature points), we ensure that subsequent comparisons of fingerprint details at the same location are possible, greatly improving the reliability and accuracy of feature matching.
[0090] Specifically, step 102 includes steps 1021 to 1023: Step 1021: Obtain the first pixel position of the core feature point in the standard grayscale image; a high-quality, baseline fingerprint image is collected and stored in the smart water bottle when the user registers or registers their fingerprint. This image represents the user's template fingerprint.
[0091] The core feature points in a standard grayscale image refer to the core feature points that have been pre-detected and stored in the standard grayscale image.
[0092] The first pixel position refers to the coordinates (x_s, y_s) of the core feature point in the standard grayscale image coordinate system. This position is fixed and known (determined and stored during registration).
[0093] The first pixel position provides a stable and reliable reference point for subsequent alignment. The goal of alignment is to make the corresponding point in the newly acquired image coincide with this point (or satisfy a certain fixed spatial relationship).
[0094] Step 1022: Extract the second pixel position of the core feature point in the fingerprint grayscale image; the second pixel position of the core feature point is obtained through the above embodiment.
[0095] Step 1023: Based on the first pixel position and the second pixel position, translate and / or rotate the fingerprint grayscale image to obtain the target grayscale image.
[0096] The newly acquired fingerprint grayscale image, after applying the calculated translation and / or rotation transformations, yields an image called the target grayscale image. This image is spatially aligned with the standard grayscale image (at least at its core point).
[0097] Translation: The simplest transformation. Calculate the coordinate difference between two points: dx = x_s - x_c, dy = y_s - y_c. Then shift the entire newly acquired fingerprint image along the plane by the distance (dx, dy). This solves the problem of positional offset when the fingerprint is pressed.
[0098] Rotation: If the core points in two images differ not only in position but also in direction (i.e., the user's finger has rotated), it's necessary to calculate the vector angle difference from the second position (x_c, y_c) to the first position (x_s, y_s). Then, the newly acquired fingerprint image is rotated around a point (usually the image center or the core point itself) by this angle difference. This solves the problem of rotation angle differences during fingerprint pressing.
[0099] Geometric transformations minimize image differences caused by varying positions and angles when a user presses their fingerprint, ensuring the target grayscale image and the standard grayscale image are comparable within the same coordinate system. This is a prerequisite for effective subsequent gridded region matching. Without precise alignment, meaningful local comparisons of fingerprint regions at different locations are impossible.
[0100] In the embodiments corresponding to steps 1021 to 1023, fingerprint image alignment is achieved using the location information of core feature points. This process is a crucial step in the fingerprint recognition method, effectively improving recognition accuracy and making subsequent matching processes more reliable.
[0101] Step 103: Divide the target grayscale image and the standard grayscale image into multiple grid regions, and match the target grayscale image to determine whether the user to be identified is the fingerprint user based on the multiple grid regions.
[0102] This step involves fine-grained feature comparison on the aligned image. It's understandable that step 102 matches core feature points, which has limitations in recognizing the overall fingerprint. Therefore, a fine-grained comparison of the entire grayscale image is needed to improve fingerprint recognition accuracy.
[0103] The aligned target grayscale image (the user's current press) and the standard grayscale image (the registered user's standard fingerprint) are simultaneously and in the same manner divided into several small blocks (grid areas).
[0104] Within each corresponding grid region (i.e., the i-th row and j-th column grid of the target image corresponds to the i-th row and j-th column grid of the standard image), calculate the similarity or feature matching degree of that local region between the two images. Summarize the matching results of all grid regions (to ultimately determine whether the user pressing the fingerprint (target grayscale image) is the same person as the registered user (standard grayscale image).
[0105] Traditional global matching is susceptible to poor fingerprint quality in certain areas (smudges, wear, uneven pressure). Region-based matching allows for localized failures. Even if some grid areas have low matching accuracy (such as contaminated or dry areas around the finger edge), correct identification is still possible as long as other areas have high matching accuracy. This significantly improves robustness.
[0106] Comparisons within a small grid can more accurately capture local fingerprint details, which are more distinguishable than global features. Grid matching strongly depends on accurate alignment in the second step. Dividing the grid and comparing at the same locations is only meaningful after image alignment. Without alignment, grid matching will be very ineffective.
[0107] Specifically, step 103 includes steps 1031 to 1037: Step 1031: Divide the target grayscale image and the standard grayscale image into a grid region of N rows and M columns; uniformly divide the aligned target grayscale image (user to be identified) and standard grayscale image (registered user) into a rectangular grid of N rows and M columns. Each grid is an independent local region.
[0108] The alignment step ensures that the grid divisions in the two images are strictly corresponding in spatial location. That is, the fingerprint region covered by the grid in the i-th row and j-th column of the target image corresponds to the region covered by the grid in the i-th row and j-th column of the standard image.
[0109] This transforms the global matching problem into a matching problem involving multiple local regions. This allows the algorithm to focus on local details and tolerate poor quality in some local regions (such as stains, wear, or uneven pressure).
[0110] Step 1032: Assign a preset weight to each grid region; wherein the weight of the central grid region is greater than the weight of the edge grid regions; assign a preset weight value w_ij (i=1..N, j=1..M) to each grid.
[0111] The weight of the central grid region is greater than the weight of the edge grid regions. Generally, the weight values decrease from the image center towards the edge. For example, the central grid has the highest weight (e.g., 1.0).
[0112] The grid weights closer to the center are secondary (e.g., 0.8).
[0113] Edge grids have the lowest weight (e.g., 0.5 or 0.6).
[0114] The central region of a fingerprint typically exhibits more stable, unique features and is less affected by pressure. This central region contains a central point and dense ridge details, making it key to distinguishing different fingerprints.
[0115] Fingerprint edge features are volatile and unstable. Edge regions are greatly affected by the pressure applied and the area where the finger is placed, resulting in generally poor image quality (blurred, partially missing) and low feature reliability.
[0116] By assigning higher weights to the central region, the importance of matching results in the central region is emphasized, while the impact of unreliable matching results in the peripheral regions is reduced. This significantly improves the overall matching decision's tolerance to edge noise and variations.
[0117] Step 1033: Calculate the first ridge distribution feature vector for each grid region in the target grayscale image; for each grid region in the target grayscale image, calculate a feature vector F_target_ij that characterizes the fingerprint ridge distribution characteristics within that region. This is the first ridge distribution feature vector.
[0118] The visual information of each grid is converted into a computable mathematical vector for subsequent similarity comparison.
[0119] Specifically, step 1033 includes steps C1 to C7: Step C1: Calculate the first gradient in the horizontal direction and the second gradient in the vertical direction for each pixel in the grid area; for each pixel in the grid, calculate its gradient (Gx) in the x-axis (horizontal) direction and its gradient (Gy) in the y-axis (vertical) direction.
[0120] Convolution is performed using gradient operators (such as Sobel, Prewitt, and Scharr operators): Gx = horizontal gradient operator * image patch (detecting vertical edges - corresponding horizontal changes); Gy = vertical gradient operator * image patch (detecting horizontal edges - corresponding vertical changes); the gradient reflects the intensity and direction of the gray-level change at that pixel. In fingerprint images, strong gradients perpendicular to the ridge direction are generated at the intersection of ridges and valleys (grooves). This is the basis for extracting orientation information.
[0121] Step C2: Based on the first gradient and the second gradient, calculate the sum of the first gradient components in the horizontal direction and the sum of the second gradient components in the vertical direction for all pixels within the grid region; sum the gradient components of all pixels within the grid: SumGx = Σ(Gx) (algebraic sum of the horizontal gradient values of all pixels); SumGy = Σ(Gy) (algebraic sum of the vertical gradient values of all pixels); this step aggregates the gradient information of all pixels within the grid. SumGx and SumGy represent the overall gradient trend of the entire grid in the horizontal and vertical directions. They are the basis for calculating the overall average direction of the grid. Here, the original gradient component values (Gx, Gy) are summed, not the gradient magnitude or orientation angle.
[0122] Step C3: Calculate the grid orientation angle based on the sum of the first gradient components and the sum of the second gradient components; wherein the grid orientation angle represents the average direction of the fingerprint ridges within the grid area; calculate the dominant orientation angle of the entire grid using SumGx and SumGy obtained in the previous step.
[0123] The grid orientation angle θ_grid = arctan2(SumGy, SumGx).
[0124] arctan2(y, x) is the four-quadrant arctangent function, which determines the correct angular quadrant based on the signs of SumGx and SumGy (the result range is usually [-π, π] or [0, 2π)).
[0125] The angle θ_grid represents the macroscopic average orientation of the fingerprint ridges (or valleys) within the entire grid. For example, if the ridges are mainly vertical (up and down) within the grid, then the gradient mainly appears in the horizontal direction (left and right edges), SumGx will be larger (positive or negative depending on brightness), SumGy will be smaller, and θ_grid will be close to 0° or 180°.
[0126] If the ridge line is mainly horizontal (left-right direction), then the gradient mainly appears in the vertical direction (top and bottom edges), SumGy will be larger, and θ_grid will be close to 90° or 270°.
[0127] The network orientation angle determines the global principal orientation of the grid. This orientation will be used as a reference (coordinate system) for subsequent statistical analysis of local pixel orientation angles. This is a crucial step in improving robustness to overall fingerprint rotation.
[0128] Step C4: Calculate the pixel orientation angle based on the first and second gradients of each pixel; for each pixel in the grid, calculate its local orientation angle using its own gradient components (Gx, Gy).
[0129] Pixel orientation angle φ_pixel = arctan2(Gy, Gx). This angle represents the angle perpendicular to the direction of maximum grayscale change (i.e., perpendicular to the ridge direction) at that pixel. Note: In practical applications, sometimes φ_pixel + π / 2 is used to obtain the direction of the ridge itself (because the gradient direction is perpendicular to the edge / ridge).
[0130] It captures detailed directional information at each pixel of the image, reflecting local changes in the direction of the ridges.
[0131] Step C5: Divide the grid orientation angle into K directional intervals on an average basis; quantize the calculated grid orientation angle θ into K discrete directional intervals (e.g., K=8, the grid orientation angle is 0°-180°, divide 0°-180° into 8 intervals on an average basis, each interval being 22.5°).
[0132] Step C6: Count the number of pixels whose pixel orientation angle falls into the defined orientation interval; traverse each pixel in the grid and check which of the K orientation intervals defined in step 5 its calculated pixel orientation angle φ_pixel falls into. Count the number of pixels falling into each orientation interval.
[0133] This step compresses and quantizes the orientation information of tens of thousands of pixels within the grid into a discrete, K-dimensional statistical distribution. This distribution describes the deviation of local ridge orientations from the main grid direction θ_grid. It characterizes the overall shape and consistency of the orientation pattern within the grid.
[0134] Step C7: Construct a vector from the number of pixels corresponding to each of the K directional regions to obtain the first ridge distribution feature vector.
[0135] Arrange the number of pixels (or normalized frequency and proportion) of each of the K directional intervals obtained in step 6 in order to form a K-dimensional vector.
[0136] Example: If K=8, the feature vector V = [count1, count2, count3, count4, count5, count6, count7, count8], where counti is the number of pixels falling into the i-th directional interval.
[0137] Normalize this vector (e.g., L1 normalization, so that the sum of the components is 1; or L2 normalization) to make it a probability distribution vector, thereby improving robustness to changes in illumination and area size.
[0138] The resulting K-dimensional orientation histogram vector is the ridge distribution feature vector. It encodes the main orientation of the fingerprint ridges (implied by θ_grid) and the detailed statistical distribution pattern of orientation changes within the grid region in a compact and robust manner.
[0139] In the embodiments corresponding to steps C1 to C7, dividing the interval using the main grid direction as a reference is equivalent to performing orientation normalization during the feature extraction stage. This ensures that even with slight fingerprint rotation (e.g., the angle at which the user holds the water bottle changes each time), the extracted feature vectors remain consistent. Traditional methods either require complex orientation field correction or use rotation-invariant texture features (such as LBP), but the former is computationally intensive, and the latter lacks sufficient discriminative power. This method achieves a balance between accuracy and efficiency. By statistically analyzing the orientation distribution of the entire grid, it avoids over-reliance on individual pixels or minutiae. Small local damage to the fingerprint (e.g., peeling skin on the finger) only affects the orientation angle statistics of a few pixels, but the overall histogram shape does not change drastically. This is particularly important for devices like smart water bottles used in complex environments.
[0140] Step 1034: Obtain the second ridge distribution feature vector in the standard grayscale image; for each grid region in the standard grayscale image, calculate (or pre-calculate and store) its feature vector F_standard_ij. This is the second ridge distribution feature vector.
[0141] Step 1035: Calculate the cosine similarity between the first ridge distribution feature vector and the second ridge distribution feature vector; for each corresponding grid region (i, j), calculate the cosine similarity sim_ij between its target image feature vector F_target_ij and standard image feature vector F_standard_ij.
[0142] Cosine similarity formula: sim_ij = (F_target_ij • F_standard_ij) / (||F_target_ij|| * ||F_standard_ij||); • represents the vector dot product.
[0143] || || represents the vector magnitude (L2 norm).
[0144] Cosine similarity characteristics: The value ranges from [-1, 1]. The closer the value is to 1, the more consistent the directions of the two vectors are (i.e., the more similar the feature distributions). The closer the value is to 0, the less correlated they are. The closer the value is to -1, the opposite the directions are (rare in fingerprint features).
[0145] A high sim_ij value indicates that the fingerprint to be identified is highly similar to the registered fingerprint within the grid (i, j); a low value indicates that the difference in that region is relatively large. Cosine similarity is not sensitive to the absolute magnitude of the vector, but focuses more on the distribution pattern (direction) of the features, which makes it somewhat robust to changes in illumination and contrast.
[0146] Step 1036: Multiply and sum the cosine similarity of each grid region with the preset weight to obtain the total similarity; calculate a global similarity score Total_Sim: Total_Sim = Σ_{i=1}^{N} Σ_{j=1}^{M}(w_ij * sim_ij); that is, traverse all grids (i, j), multiply the cosine similarity sim_ij of the grid by its preset weight w_ij, and then sum the weighted results of all grids to obtain Total_Sim.
[0147] By using weights w_ij, more emphasis is placed on the matching results of the central region (where features are stable and reliable), while the impact of matching results of the peripheral region (where features are volatile and unreliable) is reduced. This is a key strategy to improve the overall matching accuracy and robustness. Even if the matching degree of the peripheral region is low due to the pressing problem, as long as the matching degree of the central region is high, the weighted total score may still meet the target.
[0148] Step 1037: If the total similarity is greater than the similarity threshold, then the user to be identified is confirmed as the fingerprint user.
[0149] The calculated total similarity Total_Sim is compared with a preset similarity threshold T_sim (e.g., 87.9%).
[0150] If Total_Sim > T_sim, then the user to be identified is determined to be the registered fingerprint user (verification passed). Otherwise, it is determined not to be the user (verification failed).
[0151] The final authentication decision is made based on a global matching score that incorporates regional importance. The threshold T_sim needs to be set in a balance between security and convenience (a high threshold is more secure but may reject genuine users, while a low threshold is more convenient but may accept fake users).
[0152] In the embodiments corresponding to steps 1031 to 1037, by giving a greater weight to the central region than the edge region, the tolerance for missing edge information or noise is significantly improved, and the role of the core reliable region in the decision-making process is highlighted, greatly improving robustness and accuracy (especially in scenarios such as water cups where the pressure may be irregular). Using ridge distribution feature vectors instead of original pixels effectively resists environmental interference (light, stains, wetness / dryness) and enhances discriminative power. Cosine similarity is used to measure local features, which is insensitive to changes in feature amplitude and suitable for fingerprint features. A weighted sum of local similarity and region weights is obtained to obtain the total similarity, which is then compared with an adjustable threshold for decision-making. This process is quantifiable and adjustable, fully considering the differences in contribution from different regions. From feature extraction, similarity calculation, weighted fusion to threshold decision-making, a complete, clear, and technically sophisticated fingerprint matching process is formed.
[0153] In the embodiments corresponding to steps 101 to 103, integrating fingerprint recognition into the smart water bottle effectively prevents unauthorized users from using the bottle, thereby protecting user privacy and drinking water safety. This feature is particularly suitable for shared environments such as homes and offices, ensuring an undisturbed user experience and enhancing product security. By acquiring fingerprint grayscale images and identifying core feature points through the fingerprint unit, this invention can accurately extract the unique features of a user's fingerprint. This process not only improves the accuracy of fingerprint recognition but also effectively reduces the probability of false recognition, laying the foundation for the reliability of the smart water bottle in user authentication. Combined with the alignment processing of standard grayscale images, reasonable matching of fingerprint features from different users is ensured, further improving the overall recognition success rate.
[0154] Smart water bottles include, but are not limited to, biometric identification modules, water level sensors, temperature sensors, communication modules, voice broadcasting modules, and power modules.
[0155] Biometric identification module: installed on the cup lid or handle, used to collect the user's biometric information for identity verification and to control the unlocking of the cup lid; the biometric identification module is a fingerprint recognition sensor.
[0156] Water level sensor: Used to detect the water level in the cup in real time.
[0157] Temperature sensor: Used to detect the temperature of the liquid inside the cup in real time.
[0158] Communication module: used for data interaction with a remote server; preferably, the communication module is a Wi-Fi module or a 4G / 5G cellular mobile communication module.
[0159] Voice broadcast module: used to play water temperature prompts, drinking reminders, and motivational voice messages.
[0160] Power supply module: Provides power to each power-consuming module.
[0161] The control module is configured to: determine a valid drinking event based on the changing patterns of the water level sensor data; for example, when the water level drops in a stepwise manner within a short period of time, and the drop exceeds a preset threshold, it is determined to be a valid drinking event. The module records the number of valid drinking events for each verified user per day. Through the communication module, the user's identity information, number of drinking events, drinking timestamp, and water temperature data are uploaded to the remote server.
[0162] The remote server receives and stores data uploaded from all water cups; it also performs real-time statistics and ranking of the number of times users drink water within a specified group (such as a class or a school). Parent / teacher terminals (APPs or mini-programs) allow for visual viewing of children's real-time drinking data, historical records, water temperature, and ranking within the group. Upon receiving a new drinking record, the remote server instantly calculates the user's percentage ranking within the current group and generates an encouraging voice command (e.g., "Congratulations! You've already surpassed 95% of the children in today's drinking frequency, keep it up!") which is then sent to the corresponding water cup and played by the voice broadcast module.
[0163] The water level sensor can be either a pressure-type or a photoelectric-type water level sensor. The control module (such as an STM32 series microcontroller) will collect water level data at a certain frequency and filter out interference caused by shaking through an algorithm. The logic for determining a valid drinking event is as follows: if the water level continues to drop within three consecutive sampling periods, and the total drop corresponds to a volume greater than 20 ml, it is recorded as a valid drinking event, and the counter is incremented by one.
[0164] The communication module sends encrypted data packets (containing device ID, number of drinking times, time, and water temperature) to the cloud server via MQTT or HTTP protocol. The server has a database and a computing engine. Each time a new data is received, a ranking calculation is triggered, and personalized incentive voice text is immediately sent to the corresponding water cup via TTS (text-to-speech) service or pre-recorded audio index.
[0165] After logging in via a mobile app, parents can see their child's daily water intake curve, total water intake, water temperature at each drinking session, and ranking trend chart within the class.
[0166] Figure 2 shows a fingerprint recognition device for a smart water cup provided by the present invention. The device includes: a collection unit 21, used to collect a fingerprint grayscale image through a fingerprint unit and identify core feature points in the fingerprint grayscale image; an alignment unit 22, used to perform alignment processing based on the core feature points to obtain a target grayscale image; wherein the target grayscale image and a standard grayscale image are aligned, and the standard grayscale image refers to the image corresponding to the fingerprint information of the user whose fingerprint was collected; and a matching unit 23, used to divide the target grayscale image and the standard grayscale image into multiple grid regions, and match the target grayscale image to determine whether the user to be identified is the fingerprint user based on the multiple grid regions.
[0167] This invention provides a fingerprint recognition device for a smart water bottle. Integrating fingerprint recognition into the smart water bottle effectively prevents unauthorized users from using the bottle, thereby protecting user privacy and drinking water safety. This feature is particularly suitable for shared environments such as homes and offices, ensuring an undisturbed user experience and enhancing product security. By acquiring fingerprint grayscale images and identifying core feature points through the fingerprint unit, this invention can accurately extract the unique features of a user's fingerprint. This process not only improves the accuracy of fingerprint recognition but also effectively reduces the probability of false recognition, laying the foundation for the reliability of the smart water bottle in user authentication. Combined with the alignment processing of standard grayscale images, reasonable matching of fingerprint features from different users is ensured, further improving the overall recognition success rate.
[0168] Figure 3 is a schematic diagram of a smart water cup according to an embodiment of the present invention. As shown in Figure 3, the smart water cup 3 of this embodiment includes: a fingerprint unit 30, a water level sensor 31, a temperature sensor 32, a voice broadcast module 33, a processor 34, a memory 35, and a computer program 36 stored in the memory 35 and executable on the processor 34, such as a fingerprint recognition program for a smart water cup. When the processor 34 executes the computer program 36, it implements the steps in the various embodiments of the fingerprint recognition method for a smart water cup described above, such as steps 101 to 103 shown in Figure 1. Alternatively, when the processor 34 executes the computer program 36, it implements the functions of each unit in the various device embodiments described above, such as the functions of the units shown in Figure 2.
[0169] For example, the computer program 36 can be divided into one or more units, which are stored in the memory 35 and executed by the processor 34 to complete the present invention. The one or more units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 36 in the smart water cup 3. For example, the specific functions of each unit of the computer program 36 are as follows: a collection unit, used to collect a fingerprint grayscale image through a fingerprint unit and identify core feature points in the fingerprint grayscale image; an alignment unit, used to perform alignment processing based on the core feature points to obtain a target grayscale image; wherein the target grayscale image and a standard grayscale image are aligned, and the standard grayscale image refers to the image corresponding to the fingerprint information of the fingerprint user; a matching unit, used to divide the target grayscale image and the standard grayscale image into multiple grid regions, and match the target grayscale image to determine whether the user to be identified is the fingerprint user based on the multiple grid regions.
[0170] The smart water cup includes, but is not limited to, a processor 34 and a memory 35. Those skilled in the art will understand that Figure 3 is merely an example of a smart water cup 3 and does not constitute a limitation on a single smart water cup 3. It may include more or fewer components than shown, or combine certain components, or use different components. For example, the smart water cup may also include input / output devices, network access devices, buses, etc.
[0171] The processor 34 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0172] The memory 35 can be an internal storage unit of the smart water cup 3, such as a hard drive or memory of the smart water cup 3. The memory 35 can also be an external storage device of the smart water cup 3, such as a plug-in hard drive, smart media card (SMC), secure digital card (SD) card, flash card, etc., equipped on the smart water cup 3. Furthermore, the memory 35 can include both internal storage units and external storage devices of the smart water cup 3. The memory 35 is used to store the computer program and other programs and data required by the roaming control device. The memory 35 can also be used to temporarily store data that has been output or will be output.
[0173] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0174] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0175] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0176] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0177] This invention provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps described in the above-described method embodiments.
[0178] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a camera / smart water bottle, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks.
[0179] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0180] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0181] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0182] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units.
[0183] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0184] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0185] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."
[0186] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0187] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0188] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A fingerprint recognition method for a smart water bottle, characterized in that, The fingerprint recognition method of the smart water cup includes: acquiring a fingerprint grayscale image through a fingerprint unit, identifying core feature points in the fingerprint grayscale image; performing alignment processing based on the core feature points to obtain a target grayscale image; wherein the target grayscale image and a standard grayscale image are aligned, and the standard grayscale image refers to the image corresponding to the fingerprint information of the fingerprint user; dividing the target grayscale image and the standard grayscale image into multiple grid regions, and matching the target grayscale image to determine whether the user to be identified is the fingerprint user based on the multiple grid regions.
2. The fingerprint recognition method for the smart water cup as described in claim 1, characterized in that, The step of acquiring a fingerprint grayscale image through a fingerprint unit and identifying core feature points in the fingerprint grayscale image includes: acquiring a fingerprint grayscale image through a fingerprint unit; calculating an initial orientation field map of the fingerprint grayscale image based on the Sobel operator; performing Gaussian smoothing and local consistency verification on the initial orientation field map to obtain a fingerprint orientation field map; performing sliding scans on the fingerprint orientation field map using various square windows, and calculating histogram arrays corresponding to multiple pixel orientation angle ranges within the square windows; wherein the sizes of the various square windows include 16 pixels x 16 pixels, 24 pixels x 24 pixels, 32 pixels x 16 pixels, and 24 pixels x 24 pixels. The system uses 32 pixels, with the plurality of pixel orientation angle ranges comprising 16 orientation range intervals corresponding to 360°. A histogram array is used to represent the number of pixels corresponding to the plurality of pixel orientation angle ranges. The maximum value in the histogram array is extracted, and the center orientation angle of the pixel orientation angle range corresponding to the maximum value is taken as the principal direction. Based on the histogram array and the principal direction, the orientation distribution variance and the number of target peaks are calculated. Within a square window, local curvature is calculated based on the orientation gradients along the x-axis and y-axis. The core feature points are extracted based on the absolute values of the orientation distribution variance, the number of target peaks, and the local curvature.
3. The fingerprint recognition method for the smart water cup as described in claim 2, characterized in that, The step of calculating the directional distribution variance and the number of target peaks based on the histogram array and the main direction includes: calculating the directional distribution variance corresponding to the main direction based on a preset function; wherein, the preset function is: directional distribution variance = (Σ[H[b]×min( |angle)) / ( ... b -θ dom |, 180°-|angle b -θ dom | )²]) / (N * (90°)²), H[b] represents the value corresponding to the direction angle range of the b-th pixel in the histogram array, angle b θ represents the center angle of the directional angle range of the b-th pixel. dom The main direction is indicated by N, the total number of pixels within the square window is indicated by min(), and (90°)² is the normalization factor. Local maximum values are extracted from the histogram array. A local maximum value is defined as a value whose current value is greater than its two adjacent values. Local maximum values greater than the filtering threshold are used as target peaks, and the number of target peaks is counted. The filtering threshold is 0.5 × the maximum value of the histogram array.
4. The fingerprint recognition method for the smart water cup as described in claim 2, characterized in that, The step of extracting the core feature points based on the directional distribution variance, the number of target peaks, and the absolute value of the local curvature includes: weighted summing of the directional distribution variance, the number of target peaks, and the absolute value of the local curvature corresponding to each square window to obtain a core score; performing non-maximum suppression on the score map composed of the core scores to obtain a current score map; filtering out candidate core points with scores greater than a score threshold in the current score map; clustering all candidate core points corresponding to the square windows based on a distance threshold method to obtain multiple clusters; and selecting the candidate core point corresponding to the maximum core score in the cluster as the core feature point.
5. The fingerprint recognition method for the smart water cup as described in claim 1, characterized in that, The step of aligning the core feature points to obtain the target grayscale image includes: obtaining the first pixel position of the core feature points in the standard grayscale image; extracting the second pixel position of the core feature points in the fingerprint grayscale image; and translating and / or rotating the fingerprint grayscale image based on the first pixel position and the second pixel position to obtain the target grayscale image.
6. The fingerprint recognition method for the smart water cup as described in claim 1, characterized in that, The step of dividing the target grayscale image and the standard grayscale image into multiple grid regions, and matching the target grayscale image to determine whether the user to be identified is the fingerprint user based on the multiple grid regions, includes: dividing the target grayscale image and the standard grayscale image into N rows and M columns of grid regions; assigning a preset weight to each grid region; wherein the weight of the central grid region is greater than the weight of the edge grid regions; calculating the first ridge distribution feature vector of each grid region in the target grayscale image; obtaining the second ridge distribution feature vector in the standard grayscale image; calculating the cosine similarity between the first ridge distribution feature vector and the second ridge distribution feature vector; multiplying and summing the cosine similarity corresponding to each grid region with the preset weight to obtain the total similarity; if the total similarity is greater than the similarity threshold, then confirming the user to be identified as the fingerprint user.
7. The fingerprint recognition method for the smart water cup as described in claim 6, characterized in that, The step of calculating the first ridge distribution feature vector of each grid region in the target grayscale image includes: calculating the first gradient in the horizontal direction and the second gradient in the vertical direction for each pixel in the grid region; calculating the sum of the first gradient components in the horizontal direction and the sum of the second gradient components in the vertical direction for all pixels in the grid region based on the first gradient and the second gradient; calculating the grid orientation angle based on the sum of the first gradient components and the sum of the second gradient components; wherein the grid orientation angle represents the average direction of the fingerprint ridges in the grid region; calculating the pixel orientation angle based on the first gradient and the second gradient for each pixel; dividing the grid orientation angle into K directional intervals; counting the number of pixels whose pixel orientation angles fall into the directional intervals; and constructing a vector from the number of pixels corresponding to each of the K directional regions to obtain the first ridge distribution feature vector.
8. A fingerprint recognition device for a smart water bottle, characterized in that, The fingerprint recognition device of the smart water bottle includes: a collection unit for collecting a fingerprint grayscale image through a fingerprint unit and identifying core feature points in the fingerprint grayscale image; an alignment unit for performing alignment processing based on the core feature points to obtain a target grayscale image; wherein the target grayscale image and a standard grayscale image are aligned, and the standard grayscale image refers to the image corresponding to the fingerprint information of the fingerprint user; and a matching unit for dividing the target grayscale image and the standard grayscale image into multiple grid regions, and matching the target grayscale image to determine whether the user to be identified is the fingerprint user based on the multiple grid regions.
9. A smart water cup, characterized in that, The smart water cup includes: a fingerprint unit, a water level sensor, a temperature sensor, a voice broadcast module, a memory, a processor, and a fingerprint recognition program for the smart water cup stored in the memory and executable on the processor. The fingerprint recognition program for the smart water cup is configured to implement the steps in the fingerprint recognition method for the smart water cup as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps in the fingerprint recognition method for the smart water cup as described in any one of claims 1 to 7.