A method and device for locating feature points of an unlocking pattern for mobile phone automated forensics

By combining screen area positioning, perspective correction, top cap transformation enhancement, Blob detection, and mesh fitting with a Hough circle detection backoff mechanism, the stability and accuracy issues of mobile phone unlock pattern feature point positioning under complex shooting conditions are solved, realizing the automatic unlocking function of the fully automated mobile phone evidence collection system.

CN123181557APending Publication Date: 2026-11-27XIAMEN MEIYABAIKE INFORMATION SECURITY RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611006077.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-07
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing methods for locating feature points of mobile phone unlock patterns suffer from poor stability and accuracy under complex shooting conditions, making it difficult to accurately locate the nine-square grid feature points of mobile phone unlock patterns under conditions such as tilted angles, uneven lighting, screen reflections, and complex backgrounds.

Method used

Through a multi-layered technical architecture that incorporates screen area positioning, perspective correction, top-hat transformation enhancement, blob detection, 3×3 mesh fitting, and Hough circle detection backoff mechanism, stable and accurate positioning is achieved under complex shooting conditions.

Benefits of technology

The system can stably and accurately locate the nine-square grid feature points of the unlock pattern under complex shooting conditions, improving the automatic unlocking efficiency and robustness of the fully automated mobile phone evidence collection system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123181557A_ABST
    Figure CN123181557A_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for locating unlock pattern feature points in automated mobile phone forensics, relating to the fields of computer vision and electronic data forensics. The method includes: locating a quadrilateral region of the mobile phone screen in an image; performing perspective correction after successful location; enhancing small bright spots in the corrected image using top-hat transformation, and extracting candidate feature points using Blob detection; mapping the candidate points back to the original image coordinates and performing 3×3 grid fitting, obtaining nine feature point coordinates through one-dimensional clustering and equidistant grid fitting; switching to a Hough circle detection backoff scheme when screen location fails or the number of candidate points is insufficient. This invention achieves stable and accurate location of nine-grid feature points under complex shooting conditions through a multi-layered protection mechanism of screen location, perspective correction, top-hat enhancement, grid fitting, and Hough backoff, providing technical support for the automatic unlocking stage in fully automated mobile phone forensics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of computer vision and electronic data forensics, specifically relating to a method and apparatus for locating unlock pattern feature points for automated mobile phone forensics. It is suitable for automatically and stably locating the coordinates of nine-square grid feature points of unlock patterns from mobile phone screen images under complex shooting conditions. Background Technology

[0002] In the fully automated mobile phone forensics process, the phone screen needs to be automatically unlocked to obtain internal data. Android phones typically use a 3x3 grid of feature points for their pattern unlock interfaces. The automated forensics system needs to accurately locate the coordinates of these nine feature points to simulate the user's swipe input of the unlock pattern. However, in real-world forensics scenarios, mobile phone images often suffer from issues such as tilted angles, uneven lighting, screen reflections, and complex backgrounds, posing a significant challenge to the stable detection of these feature points.

[0003] Existing feature point localization methods mainly include the following categories: The first category consists of methods based on global binarization and contour filtering. This method performs thresholding on the entire image and then filters candidate circles based on geometric features such as area and roundness. However, this method is limited by the sensitivity of a fixed threshold to changes in lighting. It is prone to generating a large number of false positive candidate points when the screen is reflective or the background is complex, and it cannot distinguish between unlock pattern feature points and other circular elements on the screen (such as app icons, buttons, etc.).

[0004] The second category is based on Hough circle detection methods. This method directly searches for circular targets in the image without relying on a binarization threshold. However, the parameters of Hough circle detection are quite sensitive to image quality, requiring manual adjustment under different exposure conditions. Furthermore, it is prone to misdetecting text, icons, etc., on the screen as dots, resulting in insufficient detection stability.

[0005] The third category is feature point regression prediction methods based on deep learning models. These methods can achieve certain detection results under ideal shooting conditions, but they require a large amount of labeled data to train the model, and the model's generalization ability is limited by the coverage of the training data. In actual evidence collection scenarios, the performance may drop significantly when facing unfamiliar mobile phone models or shooting conditions.

[0006] Furthermore, existing methods typically perform detection directly on the entire image, failing to fully utilize prior information about the phone screen area, resulting in an excessively large detection range and severe noise interference. When the screen background content is complex (such as containing a large number of icons, text, wallpaper patterns, etc.), existing methods struggle to effectively distinguish unlock pattern feature points from background elements.

[0007] Therefore, there is an urgent need for a method that can stably and accurately locate the nine-square grid feature points of the mobile phone unlock pattern under complex shooting conditions, so as to support the automatic unlocking function of the fully automated mobile phone evidence collection system. Summary of the Invention

[0008] To address the shortcomings of existing technologies, this invention proposes a method and device for locating unlock pattern feature points for automated mobile phone evidence collection. Through a multi-layered technical architecture that integrates screen area positioning, perspective correction, top cap transformation enhancement, Blob detection, 3×3 grid fitting, and Hough circle detection backoff mechanism, stable and accurate positioning of nine-grid feature points is achieved under complex shooting conditions.

[0009] To achieve the above objectives, the present invention provides the following technical solution: In a first aspect, the present invention proposes a method for locating unlock pattern feature points for automated mobile phone forensics, the method comprising the following steps: S1: Obtain the image to be processed, and locate the quadrilateral area of ​​the mobile phone screen in the image to be processed; S2: Determine whether the quadrilateral area of ​​the mobile phone screen is successfully positioned. If the positioning is successful, perform perspective correction on the quadrilateral area of ​​the mobile phone screen to obtain the corrected image. S3: Detect bright-colored blob feature points in the corrected image and extract candidate feature points; S4: Map the candidate feature points back to the original image coordinates, perform 3×3 grid fitting, and obtain the coordinates of nine feature points; S5: If the location of the quadrilateral area of ​​the mobile phone screen fails or the number of candidate feature points is insufficient, switch to the Hough circle detection fallback scheme, perform Hough circle detection on the specified ROI area of ​​the image to be processed, obtain candidate feature points, and perform 3×3 grid fitting on the candidate feature points to obtain the coordinates of nine feature points.

[0010] By limiting the detection range to within the screen area through screen region localization, background noise interference is effectively eliminated. Perspective correction eliminates geometric distortions caused by the shooting angle, providing a standardized detection space for subsequent feature point detection. A combination of blob detection and mesh fitting achieves accurate extraction and structural constraints of candidate feature points. A Hough circle detection backoff mechanism provides a reliable backup plan in case of screen localization failure, ensuring the overall robustness of the system. The overall solution achieves stable localization and unlocking of the nine-square grid feature points without manual intervention.

[0011] Preferably, the location of the quadrilateral region of the mobile phone screen in step S1 specifically includes: performing grayscale conversion, Gaussian blurring, Canny edge detection, and morphological closure operations on the image to be processed to enhance the outline of the screen frame; extracting the outer contour and filtering quadrilateral candidates with an area greater than 5% of the total image area; and selecting the quadrilateral with the largest area as the screen quadrilateral region after aspect ratio filtering. The combination of Canny edge detection and morphological closure operations effectively enhances the continuity of the screen frame edges; and the dual filtering based on area threshold (greater than 5% of the total area) and aspect ratio eliminates quadrilateral interference from non-screen areas in the image (such as papers or picture frames on a desktop), improving the accuracy of screen region location.

[0012] Preferably, the perspective correction in step S2 specifically includes: calculating the perspective transformation matrix to transform the quadrilateral area of ​​the mobile phone screen into a standard rectangular image. The width of the transformed image is taken as the maximum value of the top and bottom sides of the quadrilateral area of ​​the mobile phone screen and limited to between 600 and 1600 pixels, and the height is taken as the maximum value of the left and right sides and limited to between 900 and 2200 pixels. Perspective correction eliminates the trapezoidal distortion caused by the shooting angle, restoring the nine-grid feature points to a regular 3×3 equally spaced arrangement, which facilitates subsequent grid fitting. The reasonable constraint on the image size (width 600-1600 pixels, height 900-2200 pixels) ensures a balance between efficiency and accuracy in subsequent processing—too small a size will lose feature point details, while too large a size will increase computational overhead.

[0013] Preferably, the detection of bright blob feature points in the corrected image in step S3 specifically includes: after converting the corrected image to grayscale and Gaussian blurring, performing a top-hat transformation using an adaptively sized elliptical structuring element to enhance small bright spots, performing binarization using an Otsu threshold after normalization, cleaning up noise through opening operations, and extracting candidate feature points using a blob detector. The blob detector is set with a roundness threshold of not less than 0.55, an inertia ratio of not less than 0.2, and a minimum blob spacing of not less than 6% of the short side of the image. Top-hat transformation effectively suppresses interference from uneven lighting and gradient backgrounds, highlighting small, bright targets such as the nine-grid feature points; elliptical structural elements are better suited to minor deformations that may occur after perspective correction than circular structural elements; Otsu adaptive thresholding avoids the sensitivity of fixed thresholds to lighting changes; constraints on roundness threshold (≥0.55) and inertia ratio (≥0.2) ensure that detected candidate points have near-circular geometric features, excluding non-circular elements such as text and icons; minimum blob spacing constraint (≥6% of the short side) prevents the same feature point from being detected repeatedly.

[0014] Preferably, the 3×3 grid fitting in steps S4 and S5 specifically includes the following sub-steps: A1: Determine if the number of candidate points is not less than 6; if less than 6, return an empty list; A2: Estimate the dominant step size of the grid, calculate the distance between all candidate point pairs, filter distance values ​​greater than 5% of the short side of the image, perform histogram statistics on the distance values, and take the center value of the highest frequency interval as the dominant step size; A3: Perform one-dimensional clustering on the Y coordinates of the candidate points to obtain row center candidates, discard the top 40% of candidate points to exclude status bar and text noise interference, and cluster the remaining points according to the merging tolerance, where the merging tolerance is the larger of 18.0 and the dominant step size of 28%; A4: Select the three optimal row centers from the row center candidates, traverse all possible three-center combinations, calculate the degree of equality of adjacent spacing and consistency with the dominant step size, and at the same time favor the lower three-row combinations, selecting the three row centers with the best comprehensive score; A5: Complete the selected three row centers to the complete range according to the dominant step size. If there are three centers, return directly; if there are fewer than three, extrapolate to fill in the gaps at equal intervals. A6: Strictly limit the use of only candidate points close to the three row centers to estimate column centers. Calculate the distance from each candidate point to the nearest row center, and retain only candidate points with a distance not exceeding 22.0 and the larger value of the dominant step size 35%. A7: Perform one-dimensional clustering on the X coordinates of the filtered candidate points to obtain column centers, and fill in the gaps to the three column centers according to the dominant step size. A8: Combine the three row centers and three column centers to generate nine theoretical positions in a 3×3 grid. A9: Assign candidate points to the nearest grid positions. Calculate the distance from each candidate point to the nearest column center and the nearest row center, determine its grid index, and select the nearest candidate point for each grid position. A10: Perform local fine localization on each grid position. Perform top-hat transformation enhancement within an 18-pixel window around the grid point, and take the pixel region with enhancement values ​​not less than 70% of the maximum value. Calculate the weighted centroid as the coordinates of the feature points after fine localization. A11: Output the coordinates of the nine feature points.

[0015] By estimating the dominant step size, the feature spacing of the nine-grid is adaptively determined, enabling the algorithm to adapt to screens of different resolutions and phone models. By discarding the top 40% of candidate points, noise interference from the status bar (icons such as time and battery) at the top of the screen is effectively eliminated. Through independent clustering and cross-combination of row and column centers, the algorithm fully utilizes the prior rules of the nine-grid arrangement to anchor scattered candidate points to a stable 3×3 grid structure. Through local fine localization (top-hat transformation + weighted centroid), the accuracy of feature point coordinates is improved to the sub-pixel level, providing accurate coordinate references for subsequent automatic unlocking and swiping.

[0016] Preferably, the Hough circle detection backoff scheme in step S5 specifically includes: B1: Determining the ROI region as the area from 42% to 88% of the image's vertical coordinate and from 28% to 72% of its horizontal coordinate; B2: Performing grayscale and median blurring processing on the ROI region; B3: Performing Hough circle detection scanning sequentially on multiple param2 parameter values, with parameters set to dp=1.2, param1=120, minRadius=3, maxRadius=12, and minDist being 6% of the short side of the ROI; B4: Performing 3×3 grid fitting on the candidate points obtained from each scan. If the fitting is successful and nine feature points are obtained, the fitting cost is calculated, and the solution with the minimum cost is recorded. The fitting cost is the sum of the squared distances from the candidate points to the fitted points plus a penalty term for exceeding 12 candidate points; B5: If no fitting solution with nine feature points is obtained after all parameter scans, the candidate points with the most lenient parameters are used to try fitting again. If the fitting is successful, the fitting result is returned; otherwise, the candidate point list is returned.

[0017] The ROI region settings (42%-88% ordinate, 28%-72% abscissa) cover common locations of the unlock pattern grid on the screen, while eliminating interference from screen edges; adaptive scanning with multiple param2 parameter values ​​(36, 32, 28, 24, 20, 16, 12) solves the problem of Hough circle detection parameters being sensitive to image quality, and improves the recall rate by scanning different parameter values; the design of the fitting cost function (sum of squared distances + penalty term for exceeding 12 candidate points) enables the algorithm to automatically select the optimal solution from multiple candidate solutions; the retry mechanism with the most lenient parameters further enhances the fault tolerance of the fallback scheme.

[0018] Further preferably, the scan sequence of the param2 parameter values ​​is 36, 32, 28, 24, 20, 16, 12. This parameter sequence gradually decreases from strict to relaxed, prioritizing the use of stricter parameters to detect high-quality dots, and gradually relaxing the conditions when the strict parameters fail to detect them, thus balancing detection accuracy and recall.

[0019] Preferably, after obtaining the coordinates of the nine feature points in steps S4 and S5, the method further includes: arranging the nine feature points in row priority order; first, performing KMeans clustering on the Y-axis to obtain three rows of centers; arranging the rows in ascending order of Y coordinates; and within each row, arranging them in ascending order of X coordinates; and outputting the final coordinates of the nine feature points. This row priority arrangement ensures that the output order of the nine feature points is consistent with the point order when the user draws the unlock pattern (first row: left → middle → right; second row: left → middle → right; third row: left → middle → right), facilitating the automated evidence collection system to directly use these coordinates to simulate sliding input.

[0020] Secondly, embodiments of the present invention provide an unlock pattern feature point positioning device for automated mobile phone forensics, comprising: The image acquisition module is used to acquire the image to be processed. The screen positioning module is used to locate the quadrilateral area of ​​the mobile phone screen in the image to be processed; The perspective correction module is used to perform perspective correction on the quadrilateral area of ​​the mobile phone screen when the quadrilateral area is successfully located, and obtain a corrected image. The Blob detection module is used to detect bright Blob feature points in the corrected image and extract candidate feature points. The grid fitting module is used to map the candidate feature points back to the original image coordinates, perform 3×3 grid fitting, and obtain the coordinates of nine feature points; The rollback module is used to switch to the Hough circle detection rollback scheme when the positioning of the quadrilateral area of ​​the mobile phone screen fails or the number of candidate feature points is insufficient. The module performs Hough circle detection on the specified ROI area of ​​the image to be processed to obtain candidate feature points, and performs 3×3 grid fitting on the candidate feature points to obtain the coordinates of nine feature points. The output module is used to output the coordinates of the nine feature points.

[0021] The modular design decouples the functional units, facilitating device maintenance and upgrades; the data flow between modules is clear, enabling end-to-end automated processing from image input to feature point coordinate output.

[0022] Preferably, the mesh fitting module performs the 3×3 mesh fitting step as described above.

[0023] Preferably, the rollback module executes the Hough circle detection rollback scheme steps as described above.

[0024] Thirdly, embodiments of the present invention provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first aspect.

[0025] Fourthly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the implementations of the first aspect.

[0026] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the first aspect of embodiments of this application. The computer program product may be a software installation package.

[0027] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention addresses the issues of poor stability and low accuracy in locating unlock pattern feature points during fully automated mobile phone forensics under complex shooting conditions. It proposes a method and apparatus for locating unlock pattern feature points in automated mobile phone forensics. This scheme effectively combines screen area localization with perspective correction technology, top-hat transformation enhancement with Blob detection technology, and one-dimensional axis clustering with equidistant grid fitting technology. This solves the problems of traditional global binarization and fixed threshold methods being sensitive to changes in illumination and having difficulty adapting Hough circle detection parameters. Through multiple safeguard mechanisms—screen localization limiting the detection range, perspective correction unifying the detection scale, top-hat transformation suppressing background interference, and grid fitting anchoring the feature point position—this method can stably and accurately locate the nine-square grid feature points of the unlock pattern even under complex shooting conditions such as angle tilt, uneven illumination, screen reflection, and complex backgrounds. Furthermore, the scheme incorporates a Hough circle detection fallback mechanism, automatically switching to a backup scheme when screen localization fails, further enhancing the system's robustness. This method provides key technical support for the automatic unlocking process in fully automated mobile phone forensics, enabling the forensics system to automatically unlock the phone without human intervention, significantly improving forensics efficiency and automation. This technology can also be applied to various image analysis scenarios that require regular feature point localization, and has a wide range of applications. Attached Figure Description

[0028] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and, together with the description, serve to explain the principles of the invention. Other embodiments and many anticipated advantages of the embodiments will be readily recognized as they become better understood through reference to the following detailed description. Elements in the drawings are not necessarily to scale. The same reference numerals refer to corresponding similar parts.

[0029] Figure 1 This is a flowchart illustrating an embodiment of the present invention for a method of locating unlock pattern feature points for automated mobile phone forensics. Figure 2 This is an overall flowchart of the nine-grid feature point positioning method of the present invention; Figure 3 This is an image of the perspective correction module of the present invention before perspective correction (15°); Figure 4 This is a rendering of the perspective correction module of the present invention after perspective correction (15°). Figure 5 This is a schematic diagram of the 3×3 grid fitting process of the present invention; Figure 6 This is a flowchart illustrating the Hough circle detection backoff scheme of the present invention; Figures 7 to 11 This is image information output during the execution process of a specific embodiment of the present invention. Figures 7 to 11 These are the original image, the screen positioning result image, the perspective correction result image, the top hat transformation and Blob detection result image, and the mesh fitting result image, respectively. Figure 12 This is a schematic diagram of the architecture of the unlock pattern feature point localization method for automated mobile phone forensics according to an embodiment of the present invention; Figure 13 This is a schematic diagram of the structure of a computer device suitable for implementing electronic devices according to embodiments of the present invention. Detailed Implementation

[0030] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0031] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0032] This invention proposes a method and apparatus for locating unlock pattern feature points for automated mobile phone forensics. By combining screen area localization with perspective correction, the detection range is limited to the inside of the screen. Top-hat transformation is used to enhance small bright spots to suppress interference from gradient backgrounds. An adaptive Blob detector is used to extract candidate feature points, and then one-dimensional axis value clustering and equal-spacing grid fitting are used to anchor the candidate points to a stable 3×3 grid structure. At the same time, a Hough circle detection backoff mechanism is designed to deal with extreme cases of screen localization failure. Thus, stable and accurate localization of the nine-square grid feature points of the unlock pattern is achieved under complex shooting conditions, providing reliable technical support for the automatic unlocking process of fully automated mobile phone forensics.

[0033] The basic concepts of the design of the embodiments of the present invention will be briefly introduced below: The unlock pattern 3x3 grid features nine circular markers arranged in a 3x3 pattern on the phone's unlock screen. Users connect these markers by sliding to form the unlock pattern. These nine points are arranged in row-priority order on the screen, with three points in each row, for a total of three rows. The horizontal and vertical spacing between adjacent points is roughly equal. This grid serves as a key coordinate reference for automated forensics systems to simulate user-inputted unlock patterns.

[0034] The quadrilateral area of ​​the screen refers to the quadrilateral outline that appears on the mobile phone screen in the captured image. Due to the shooting angle, this quadrilateral is usually not a standard rectangle but a trapezoid or an irregular quadrilateral. Accurately locating the quadrilateral area of ​​the screen is a prerequisite for perspective correction and limiting the detection range.

[0035] Perspective correction: By using perspective transformation, the tilted mobile phone screen area is corrected into a standard rectangular image of the front view, eliminating the geometric distortion caused by the shooting angle, which facilitates subsequent feature point detection and coordinate mapping at a uniform scale.

[0036] In a first aspect, embodiments of the present invention disclose a method for locating unlock pattern feature points for automated mobile phone forensics, such as... Figure 1 As shown, the method includes the following steps: S1: Obtain the image to be processed, and locate the quadrilateral area of ​​the mobile phone screen in the image to be processed; S2: Determine whether the quadrilateral area of ​​the mobile phone screen has been successfully located. If the location is successful, perform perspective correction on the quadrilateral area of ​​the mobile phone screen to obtain the corrected image. S3: Detect bright blob feature points in the corrected image and extract candidate feature points; S4: Map the candidate feature points back to the original image coordinates, perform 3×3 grid fitting, and obtain the coordinates of nine feature points; S5: If the quadrilateral area of ​​the mobile phone screen fails to be located or the number of candidate feature points is insufficient, switch to the Hough circle detection fallback scheme, perform Hough circle detection on the specified ROI area of ​​the image to be processed, obtain candidate feature points, and perform 3×3 grid fitting on the candidate feature points to obtain the coordinates of nine feature points.

[0037] Specifically, such as Figure 2 As shown, the unlock pattern feature point localization method proposed in this invention first attempts to locate the quadrilateral area of ​​the mobile phone screen and performs perspective correction. In the corrected screen image, bright-colored blob candidate points are detected, and then the candidate points are mapped back to the original image coordinates and fitted to a 3×3 grid. When the screen localization fails or the number of candidate points is insufficient, it automatically reverts to the backup scheme of Hough circle detection combined with grid fitting.

[0038] The following detailed explanation of each step is based on a specific embodiment.

[0039] Step S1: Locating the quadrilateral area of ​​the screen In one specific embodiment, the input image is a photo of a mobile phone screen taken by the camera of the forensic workstation, with an image resolution of 1920×1080 pixels.

[0040] First, convert the color image to a grayscale image. Grayscale conversion can be performed using a weighted average method: Gray = 0.299×R + 0.587×G + 0.114×B. Then, apply a Gaussian blur to the grayscale image, with a Gaussian kernel size of 5×5 and a standard deviation σ=1.0, to suppress fine-grained noise in the image.

[0041] Next, the Canny edge detection algorithm is used to extract edge information from the image. The low and high thresholds of the Canny algorithm can be set to 50 and 150 respectively, and the specific values ​​can be adaptively adjusted according to the overall contrast of the image. Canny edge detection can effectively extract the straight edges of the four bezels of the mobile phone screen.

[0042] Then, a morphological closure operation is performed on the edge image. The kernel size of the closure operation can be set to a 5×5 rectangular structuring element. Through a dilation-erosion operation, the broken parts in the edge of the screen border are filled, so that the screen border forms a continuous closed contour.

[0043] Next, all external contours in the image are extracted. Each contour is approximated using polygons, and contours that approximate quadrilaterals are selected. The criteria for quadrilateral selection include: the contour has 4 vertices and its area is greater than 5% of the total image area (in this embodiment, greater than 1920 × 1080 × 5% = 103680 pixels). Furthermore, quadrilateral candidates are filtered based on the typical aspect ratio of mobile phone screens (usually between 16:9 and 21:9), eliminating quadrilaterals with obviously unreasonable aspect ratios.

[0044] Finally, among the quadrilateral candidates that passed the above screening, the one with the largest area was selected as the quadrilateral area of ​​the phone screen. The reason for selecting the quadrilateral with the largest area is that, in a captured image, the phone screen is usually the largest quadrilateral object in the frame.

[0045] In one specific embodiment, to further quantify the performance of the screen quadrilateral positioning module under different working conditions, 240 mobile phone forensic images covering multiple models, lighting conditions, and shooting tilt angles were used for specialized testing. The test samples were divided into four types of mobile phone models, and three lighting conditions: normal soft light, strong light with reflection, and weak light with low light. They were also categorized into three shooting angles: 0°~10° frontal view, 10°~30° moderate tilt, and 30°~50° large tilt. The successful positioning was determined by extracting a complete, untruncated, proportionally matched closed quadrilateral outline of the screen, and the success rate of screen quadrilateral positioning in each scenario was statistically analyzed. Specific results are shown in Tables 1 and 2 below: Table 1. Success Rate of Screen Quadrilateral Positioning – Cross-Test of Illumination and Shooting Angle ; Table 2. Success Rate of Quadrilateral Positioning on Screen – Different Mobile Phone Models ; Cross-test results under different lighting conditions and shooting tilt angles showed that the average success rate of screen positioning was 95.56% under normal soft light conditions, 85.56% under strong light and reflective scenes, and 88.89% under weak light and dark scenes. As the shooting tilt angle increased, the positioning stability gradually decreased, with an average success rate of 96.67% under small tilt conditions, 91.11% under moderate tilt conditions, and 82.22% under large tilt conditions.

[0046] Comprehensive test results for different models show that the overall success rate of positioning is 95.00% for small-sized straight-screen phones of 6.0 inches and below, 93.33% for regular straight-screen phones of 6.1 to 6.7 inches, and 88.33% for large-screen straight-screen phones of 6.8 inches and above. Curved screens are more susceptible to light and shadow interference due to their curved edges, resulting in an overall positioning success rate of 81.67%.

[0047] In summary, under normal soft light conditions, the positioning success rate was the highest (95.56%). Among shooting angles, the success rate was highest when viewed directly with a slight tilt (96.67%), decreasing to 82.22% at large tilt angles. The positioning success rate remained stable above 93% for small-sized and standard flat-screen phones; it slightly decreased for large-screen flat-screen phones due to their larger screen area and the tendency for edge distortion during shooting; and it had the lowest positioning success rate (81.67%) for curved screens because their curved edges easily produce reflections and shadows under lighting.

[0048] Step S2: Perspective Correction After locating the quadrilateral area of ​​the phone screen, perspective correction is needed to eliminate geometric distortion caused by the shooting angle.

[0049] The four vertices of the screen quadrilateral are set to (in clockwise order) P1(x1,y1), P2(x2,y2), P3(x3,y3), and P4(x4,y4). The goal of perspective correction is to map this quadrilateral to a standard rectangle.

[0050] First, determine the dimensions of the target rectangle. The width W of the target rectangle is the larger of the lengths of the top side |P1P2| and the bottom side |P4P3| of the quadrilateral, i.e., W = max(|P1P2|, |P4P3|); the height H of the target rectangle is the larger of the lengths of the left side |P1P4| and the right side |P2P3| of the quadrilateral, i.e., H = max(|P1P4|, |P2P3|). Simultaneously, to ensure a balance between processing efficiency and accuracy, W is limited to between 600 and 1600 pixels, and H is limited to between 900 and 2200 pixels. If the calculated W or H exceeds these ranges, it is scaled proportionally to fit within the range.

[0051] Then, calculate the perspective transformation matrix. The mathematical expression for perspective transformation is: ; Where (x, y) are the pixel coordinates in the original image, and (x' / w', y' / w') are the pixel coordinates in the transformed image. Using the four sets of coordinates corresponding to the four vertices, the eight degrees of freedom in the transformation matrix can be solved (a33 is usually normalized to 1).

[0052] Finally, a perspective transformation matrix is ​​applied to transform the quadrilateral area of ​​the screen into a standard rectangular image. In the transformed image, the phone screen is corrected to a front view, and the nine-grid feature points are restored to a regular 3×3 equally spaced arrangement.

[0053] To quantitatively evaluate the perspective correction module's effect on distortion correction at different shooting angles, 40 sets of mobile phone evidence images were collected at 0° frontal, 15° tilt, 30° tilt, and 45° tilt for testing. Three indicators were used for quantitative evaluation: rectangularity, relative error of four sides, and orthogonal error of the nine-square grid. Figure 3 This is an image of the perspective correction module before perspective correction (15°) according to an embodiment of the present invention; Figure 4 This is an image showing the effect of perspective correction (15°) after perspective correction using the perspective correction module of this embodiment. The test results are shown in Table 3 below: Table 3 Quantitative Evaluation of Perspective Correction Effect ; Evaluation Indicators Explanation: Rectangularity: A measure of the rectangularity of the corrected image, with 1.0 being a perfect rectangle; Relative error of the four sides: The degree of variation in the side lengths of the corrected quadrilateral, with lower values ​​being better; Orthogonal error of the 3×3 grid: The angle of vertical deviation between the row and column lines of the 3×3 grid, with lower values ​​being better.

[0054] The test results are shown in Table 3 above: After correction, the average rectangularity of the 0° frontal shot is 0.987, the average relative error of the four sides is 1.21%, and the average orthogonal error of the nine-grid is 1.13°; After correction, the average rectangularity of the 15° tilted scene is 0.972, the average relative error of the four sides is 2.48%, and the average orthogonal error of the nine-grid is 2.06°; After correction, the average rectangularity of the 30° tilted scene is 0.945, the average relative error of the four sides is 4.73%, and the average orthogonal error of the nine-grid is 3.69°; After correction, the average rectangularity of the 45° large tilted scene is 0.918, the average relative error of the four sides is 6.95%, and the average orthogonal error of the nine-grid is 5.24°.

[0055] As the shooting tilt angle increases from 0° to 45°, the rectangularity decreases from 0.987 to 0.918, the side length error increases from 1.21% to 6.95%, and the orthogonality error increases from 1.13° to 5.24°. Even at a large tilt angle of 45°, this invention can still control the orthogonality error of the nine-grid layout within approximately 5.24°, and the correction effect is acceptable.

[0056] As the shooting tilt angle increases, the problems of trapezoidal distortion and inconsistent grid size in the original image continue to worsen. After the perspective correction processing of this invention, the perspective distortion caused by different angles can be effectively eliminated, the screen image size can be unified, the interference of lighting and tilt changes on subsequent feature point detection can be reduced, and the stable positioning of grid feature points can be ensured in complex evidence collection environments.

[0057] Step S3: Blob Feature Point Detection In the perspective-corrected screen image, it is necessary to detect candidate locations for the 3x3 grid feature points. The 3x3 grid feature points appear as small, bright, circular blobs in the image, but the screen background may contain interference from gradient lighting, wallpaper patterns, application icons, etc.

[0058] First, the corrected color image is converted to a grayscale image. Then, a Gaussian blur is applied, with the Gaussian kernel size set to 3×3 and the standard deviation σ=0.8, to suppress noise while preserving the edge information of feature points.

[0059] Next, a top-hat transform is used to enhance small bright spots. The top-hat transform is defined as the original image minus its morphological opening operation result: Tophat(I) = I - Opening(I). The opening operation uses an elliptical structuring element, the size of which should be adaptively determined based on the size of the feature points in the image. In one specific embodiment, the size of the elliptical structuring element can be set to approximately 1.5 times the diameter of the feature points (for example, if the diameter of the feature points is approximately 8 pixels, then the major and minor axes of the structuring element can be set to 12 pixels). Elliptical structuring elements are better suited than circular structuring elements to accommodate minor distortions that may occur after perspective correction.

[0060] Top-hat transform effectively extracts small, bright targets from an image while suppressing large-scale gradient backgrounds (such as uneven lighting or gradient colors in wallpapers). After top-hat transform, the pixel values ​​of the 3x3 grid feature point region are significantly enhanced, while the pixel values ​​of the background region are suppressed.

[0061] Then, the image after top-hat transformation is normalized, mapping pixel values ​​to the range of 0 to 255. The Otsu adaptive thresholding algorithm is then used to calculate the binarization threshold, converting the image into a binary image. The Otsu algorithm automatically determines the optimal threshold by maximizing the inter-class variance, avoiding the sensitivity of a fixed threshold to different lighting conditions.

[0062] In binary images, isolated noise points can be cleaned up using an opening operation (erosion followed by dilation). The kernel size for the opening operation can be set to 3×3. The opening operation can remove small noise regions while preserving the basic shape of the feature point regions.

[0063] Finally, candidate feature points are extracted using the Blob detector. The parameters for the Blob detector are set as follows: Circularity threshold: not less than 0.55. The formula for calculating circularity is 4π × area / perimeter². The circularity of a perfect circle is 1.0. A threshold of 0.55 ensures that the detected candidate points have obvious circular features. Inertia Ratio: Not less than 0.2. The inertia ratio reflects the degree of eccentricity of the shape, and a threshold of 0.2 ensures that the candidate points are not overly elongated shapes; Minimum Distance Between Blobs: Not less than 6% of the shorter side of the image. In this embodiment, if the corrected image size is 1200×1800 pixels, the minimum distance is not less than 108 pixels. This constraint ensures that the same feature point will not be detected repeatedly.

[0064] After the above Blob detection, a set of candidate feature points is obtained, each of which contains its coordinates and radius information in the rectified image.

[0065] Step S4: 3×3 Grid Fitting 3×3 grid fitting is one of the core technologies of the present invention, and its objective is to anchor scattered candidate feature points to a stable 3×3 grid structure. As shown in Figure 5 , the process includes the following sub-steps: Step A1: Candidate Point Quantity Check Determine whether the number of candidate points is no less than 6. The 3×3 grid has a total of 9 feature points, but in actual detection, some points may be missed due to occlusion, lighting, and other reasons, so a threshold of 6 is set. If there are fewer than 6 candidate points, it indicates that the Blob detection result is unreliable, an empty list is returned, and a fallback solution is triggered. If the number is no less than 6, subsequent steps are continued.

[0066] Step A2: Dominant Step Size Estimation The dominant step size refers to the typical distance between adjacent feature points in the 3×3 grid (including horizontal and vertical directions). Since the 3×3 grid is arranged at equal intervals, the dominant step sizes in the horizontal and vertical directions are basically consistent.

[0067] The specific estimation method is as follows: calculate the Euclidean distance between every two candidate points to obtain a distance set D = {d(i,j) | i<j, i,j∈candidate points}. Filter out distance values from D that are greater than 5% of the image's short side—this filtering condition excludes small distances caused by repeated detection near the same feature point. Perform histogram statistics on the filtered distance values, and the bin width of the histogram can be set to 5% of the estimated dominant step size. Take the center value of the highest frequency interval (i.e., the distance interval with the most occurrences) as the estimated dominant step size S.

[0068] The dominant step size S is the basic parameter for all subsequent grid fitting operations, and its accuracy directly affects the quality of grid fitting.

[0069] Step A3: Y-axis Clustering of Row Center Candidates The three row centers of the 3×3 grid correspond to the Y-coordinates of the three rows of feature points respectively. To estimate the row centers, one-dimensional clustering is performed on the Y-coordinates of the candidate points.

[0070] First, discard the 40% of candidate points with the smallest Y-coordinate values. The purpose of this operation is to eliminate noise interference from the status bar area at the top of the screen (which usually contains icons such as time, battery level, and signal). Although these icons may be falsely detected as candidate points by the Blob detector, they are located at the very top of the screen and do not overlap with the positions of the 3×3 grid feature points.

[0071] Then, one-dimensional clustering is performed on the Y coordinates of the remaining candidate points. The clustering is carried out by means of merge tolerance: after sorting the Y coordinates, points with a distance not exceeding the merge tolerance T are sequentially merged into the same cluster. The merge tolerance T takes the larger value between 18.0 and 28% of the dominant step size S, i.e., T = max(18.0, S×0.28). This design ensures that a smaller tolerance is used on small screens (where the dominant step size is small) and a larger tolerance is used on large screens (where the dominant step size is large), providing good adaptability.

[0072] After clustering is completed, the median of the Y coordinates of all points in each cluster is taken as the center of that cluster, which serves as a row center candidate.

[0073] Step A4: Optimal Three Row Centers Selection The optimal three row centers are selected from the row center candidates. An exhaustive search method is adopted: all possible three-center combinations (C(n,3) combinations, where n is the number of row center candidates) are enumerated, and a comprehensive score is calculated for each combination.

[0074] The comprehensive score takes the following factors into consideration: Equality degree of adjacent spacings: after sorting the three row centers by Y coordinate as y1<y2<y3, calculate d1=y2-y1 and d2=y3-y2. The score is inversely proportional to |d1-d2|; the more equal the spacings, the higher the score; Consistency with the dominant step size: the score is inversely proportional to |d1-S|+|d2-S|; the closer the spacings are to the dominant step size, the higher the score; Position preference: preference is given to combinations of three rows that are lower (i.e., with larger values of y1, y2, and y3), since the 3x3 grid is usually located in the middle-lower part of the screen, excluding the top status bar area.

[0075] The comprehensive score is the weighted sum of the above three factors, and the three-center combination with the highest score is selected as the optimal row centers.

[0076] Step A5: Row Centers Completion If the number of selected row centers is exactly three, they are used directly. If the number is less than three (for example, due to missed feature point detection resulting in only two row centers being clustered), the row centers are extrapolated at equal intervals to complete to three.

[0077] For example, if there are only two row centers y1<y2 with a spacing d=y2-y1, then the third row center y3=y2+d (extrapolated downward); if there is only one row center y1, then the three row centers are y1-S, y1, y1+S (extrapolated upward and downward).

[0078] Step A6: Candidate Points Filtering for Column Center Estimation To estimate column centers, candidate points for column-oriented clustering need to be rigorously screened, excluding outliers in the row-oriented clustering.

[0079] Calculate the distance from each candidate point to the nearest row center (i.e., the absolute value of the difference between the Y coordinate of the candidate point and the Y coordinate of the nearest row center), and retain only candidate points whose distance does not exceed Dmax. Dmax is the larger of 22.0 and the dominant step size S×35%, i.e., Dmax = max(22.0, S×0.35).

[0080] This filtering operation ensures that the candidate points used for column center estimation are all located near the three row centers, eliminating noisy points in the row direction.

[0081] Step A7: Column-centered clustering and completion One-dimensional clustering is performed on the X coordinates of the selected candidate points. The clustering method is similar to that in step A3, and the merging tolerance is also set to max(18.0, S×0.28). After obtaining the candidate column centers through clustering, they are completed to three column centers in the same way as in step A5.

[0082] Step A8: Generate the theoretical location of the mesh By intersecting and combining the three row centers (Y coordinates) and the three column centers (X coordinates), nine theoretical positions are generated for a 3×3 grid. That is, the coordinates of the grid point in the i-th row and j-th column are (Xj, Yi), where i=1,2,3 and j=1,2,3.

[0083] Step A9: Candidate point allocation Each candidate point is assigned to the nearest grid position. The assignment method is as follows: for each candidate point, calculate its X-direction distance to the center of each column and its Y-direction distance to the center of each row, and determine its grid index (row index, column index) based on the nearest column center and row center.

[0084] Each grid location may be assigned 0, 1, or more candidate points. For each grid location, the nearest candidate point is selected as the representative point for that location.

[0085] Step A10: Local fine positioning To obtain feature point coordinates with subpixel precision, local fine-tuning is performed within an 18-pixel window around each grid point.

[0086] The specific method is as follows: On the grayscale image of the corrected image, a top-hat transform enhancement (using a small-sized elliptical structuring element) is performed on the window region to obtain the enhanced image. In the enhanced image, a pixel region with pixel values ​​no less than 70% of the maximum value within the window is selected, and the weighted centroid of this region is calculated as the coordinates of the feature points after fine localization. The formula for calculating the weighted centroid is: ; Where (x_i, y_i) are pixel coordinates, and I_i is the enhanced grayscale value of that pixel. The weighted centroid method can improve the feature point localization accuracy to the sub-pixel level.

[0087] If a candidate point is not assigned to a certain grid location (i.e., the feature point at that location is missed), the theoretical location generated in step A8 is used as the coordinates of that point.

[0088] Step A11: Output the coordinates of the nine feature points Output the coordinates of nine precisely located feature points for use in subsequent steps.

[0089] Step S5: Hough Circle Detection Backoff Solution When the quadrilateral region on the screen fails to be located (step S1 failed to locate a valid quadrilateral) or the number of candidate points for Blob detection is insufficient (less than 6), the Hough circle detection backoff scheme is executed. Figure 6 As shown, the scheme includes the following sub-steps: Step B1: Determine the ROI region Identify regions of interest (ROIs) in the original image. The vertical range of the ROI is 42% to 88% of the total image height, and the horizontal range is 28% to 72% of the total image width.

[0090] This range setting is based on statistical analysis of a large number of mobile phone unlock interface samples: the nine-grid feature points are usually located in the lower middle area of ​​the screen, the top 42% area is mainly the status bar, application titles, etc., and the bottom 12% area is mainly the navigation bar, virtual buttons, etc. Limiting the detection range to the ROI area effectively eliminates interference from non-nine-grid areas.

[0091] Step B2: Image Preprocessing The Region of Interest (ROI) is converted to grayscale, transforming the color image into a grayscale image. Then, median blurring is performed, with a kernel size of 5×5. Median filtering effectively removes salt-and-pepper noise while preserving edge information, making it suitable as a preprocessing step for Hough circle detection.

[0092] Step B3: Multi-parameter Hough circle detection scan Hough circle detection is highly sensitive to the param2 parameter, and the optimal param2 value varies depending on the image quality. To address this issue, this invention employs a multi-parameter scanning strategy.

[0093] Hough circle detection was performed sequentially on the parameter value sequence [36, 32, 28, 24, 20, 16, 12] of param2. Other parameters were set as follows: dp = 1.2 (the inverse ratio of accumulator resolution to image resolution); param1 = 120 (high threshold for Canny edge detection); minRadius = 3 (minimum circle radius, pixels); maxRadius = 12 (maximum circle radius, pixels); minDist = ROI short side × 6% (minimum distance between the centers of the circles).

[0094] The param2 value gradually decreases from 36 to 12: the larger the value, the stricter the detection conditions, the lower the false positive rate but the higher the false negative rate; the smaller the value, the more lenient the detection conditions, the higher the recall rate but the higher the false positive rate. The scanning order from strict to lenient ensures that high-quality detection results are used first.

[0095] Step B4: Fitting Cost Calculation and Optimal Solution Selection For each candidate point obtained from the Hough circle detection, the 3×3 grid fitting process is invoked (steps A1 to A11). If the fitting is successful (nine feature points are obtained), the fitting cost for that detection is calculated.

[0096] The formula for calculating the fitting cost is: ; Where Σ(d_i²) is the sum of squared distances from the nine fitted points to their corresponding nearest candidate points, and Penalty is a penalty term for exceeding 12 candidate points (a fixed penalty value is added for each candidate point exceeded, for example, 100).

[0097] The solution with the minimum fitting cost is selected as the optimal solution. The design of the cost function enables the algorithm to automatically select the solution from multiple candidate solutions that best matches the mesh fitting position and has an appropriate number of candidate points.

[0098] Step B5: Try the most lenient parameters again If none of the scans with all param2 parameter values ​​(36 to 12) yield a fit for nine feature points, then the candidate points detected with the most lenient parameter (param2=12) are used to attempt fitting again. If the fitting is successful this time, the fitting result is returned; if it still fails, a list of candidate points (not guaranteed to be nine points) is returned, and the upper-layer application decides on the subsequent processing.

[0099] This mechanism further enhances the fault tolerance of the rollback scheme, ensuring that detection results are provided as much as possible even under extremely difficult image conditions.

[0100] Step S6: Feature Point Sorting and Output After obtaining the coordinates of nine feature points (whether through the main scheme or the backoff scheme), the nine points need to be arranged in row priority order to output a standardized result.

[0101] First, KMeans clustering is performed on the Y-coordinates of the nine points, with K=3, to obtain three row centers. Then, the three row centers are arranged in ascending order of Y-coordinate to determine the order of the first, second, and third rows.

[0102] For each row of three points, sort them in ascending order of their X-coordinates to determine the left, center, and right order. The final output consists of nine feature point coordinates arranged in the following order: First row left, first row middle, first row right; Second row left, second row middle, second row right; Third row left, third row middle, third row right.

[0103] This order is consistent with the point sequence when the user draws the unlock pattern on the pattern unlock interface (arranged row by row from top left to bottom right), which makes it easy for automated evidence collection systems to directly use these coordinates to simulate the user's sliding input.

[0104] In one specific embodiment of the present invention, the image information output during the execution process is as follows: Figures 7 to 11 As shown. Including the original image ( Figure 7 Screen positioning result diagram ( Figure 8 ), Perspective correction result diagram ( Figure 9 ), Top cap transformation and Blob detection results ( Figure 10 ) and grid fitting results ( Figure 11 ).

[0105] To verify the effectiveness of the present invention, 120 mobile phone-based photographic images were collected for testing. The samples covered various working conditions, including images taken under different lighting conditions, angles, mobile phones, and backgrounds. The success rate was determined by accurately detecting all nine feature points in the nine-grid layout. The overall detection success rate was calculated and compared with traditional methods. The test comparison results are shown in Tables 4 and 5 below: Table 4 Comparison of overall detection success rates of different methods ; Table 5. Details of Triggering and Success Rate of the Main Scheme and Rollback Scheme of this Invention ; As shown in Tables 4 and 5 above, the test comparison results are as follows: 1) Traditional global binarization and contour screening: The overall detection success rate is 42.5%. In strong light, large tilt, and screen reflection scenarios, a large number of dots are missed and icons are falsely detected. Most samples cannot output complete nine-point coordinates. 2) Fixed parameter Hough circle method: The overall detection success rate is 50.2%. The parameter adaptability is poor after the shooting angle changes, and it is easy to identify screen text and watermarks as dots. 3) The complete solution presented in this paper (main process + fallback): out of 120 samples, 104 can run normally in the main process, and 16 extreme images automatically trigger the fallback solution; the detection success rate of the main process is 95.19%, the detection success rate of the fallback solution is 93.75%, and the overall detection success rate of the whole solution is 94.17%.

[0106] In summary, the proposed solution achieves a performance improvement of approximately 121.6% compared to traditional global binarization methods and approximately 87.5% compared to the fixed-parameter Hough circle method. Of the 120 samples, 104 (86.7%) ran the main process normally with a detection rate of 95.19%; 16 (13.3%) automatically triggered a fallback mechanism due to screen positioning failure or insufficient candidate points, with a fallback detection rate of 93.75%. The overall success rate was 94.17%, indicating that the fallback mechanism effectively improved the overall robustness of the system.

[0107] The embodiments of this invention comprehensively verify the technical effects of this invention from three aspects: screen positioning (lighting adaptability, device model adaptability), perspective correction (geometric correction accuracy), and overall solution (comparison with existing methods, comparison with main / backoff solutions). Screen positioning: Success rate ≥95% under normal lighting conditions, and maintains a positioning success rate of over 80% even under difficult conditions such as large-angle tilt and curved screens; Perspective correction: Within the shooting angle range of 0°~45°, the rectangularity is maintained above 0.918, and the orthogonality error is controlled within 5.24°; Overall solution: Achieves a comprehensive detection success rate of 94.17% on 120 diverse real evidence images, which is significantly better than traditional methods.

[0108] Further reference Figure 12 As an implementation of the methods shown in the above figures, this application provides an embodiment of an unlock pattern feature point positioning device for automated mobile phone forensics. This device embodiment is similar to... Figure 1 and Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0109] Secondly, embodiments of the present invention also disclose an unlocking pattern feature point positioning device for automated mobile phone forensics, such as... Figure 12 As shown, it includes the following modules: The image acquisition module 121 is used to acquire the image to be processed. This module can acquire images in real time from the camera of the evidence collection workstation, or it can read a saved image file from a storage medium.

[0110] The screen positioning module 122 is used to locate a quadrilateral area of ​​the mobile phone screen in the image to be processed. This module performs all the operations of the aforementioned step S1.

[0111] The perspective correction module 123 is used to perform perspective correction on the quadrilateral area of ​​the mobile phone screen when the quadrilateral area is successfully located, and obtain a corrected image. This module performs all the operations of the aforementioned step S2.

[0112] Blob detection module 124 is used to detect bright blob feature points in the corrected image and extract candidate feature points. This module performs all the operations of the aforementioned step S3.

[0113] The grid fitting module 125 is used to map the candidate feature points back to the original image coordinates, perform 3×3 grid fitting, and obtain the coordinates of nine feature points. This module performs all the operations of the aforementioned steps A1 to A11.

[0114] The rollback module 126 is used to switch to the Hough circle detection rollback scheme when the positioning of the quadrilateral area of ​​the mobile phone screen fails or the number of candidate feature points is insufficient. It performs Hough circle detection on the specified ROI region of the image to be processed to obtain candidate feature points, and then performs 3×3 grid fitting on these candidate feature points to obtain the coordinates of nine feature points. This module performs all the operations described in steps B1 to B5 above.

[0115] Output module 127 is used to output the coordinates of the nine feature points. This module performs all the operations of the aforementioned step S6.

[0116] The data flow between modules is as follows: Image acquisition module 121 → Screen positioning module 122 → Perspective correction module 123 → Blob detection module 124 → Mesh fitting module 125 → Output module 127; When screen positioning fails or the number of Blob detection points is insufficient, the flow is as follows: Image acquisition module 121 → Backtracking module 126 → Output module 127.

[0117] The functions and methods of the above modules correspond to each other, and will not be repeated here.

[0118] The unlock pattern feature point localization method and apparatus proposed in this invention for automated mobile phone forensics can be widely applied in the following scenarios: Mobile phone electronic data forensics: In a fully automated mobile phone forensics system, the phone screen is automatically unlocked to obtain internal data, greatly improving the efficiency and automation of forensics.

[0119] Mobile Automated Testing: During the automated testing of mobile applications, pattern unlocking is automatically performed, improving testing efficiency.

[0120] Mobile screen content analysis: In scenarios where automated analysis of mobile screen content is required, accurately identify and locate regularly arranged feature points on the screen.

[0121] This invention does not require dedicated hardware equipment and can be implemented in software on a general-purpose computer, thus possessing good industrial practicality and application value.

[0122] The following is for reference. Figure 13 It shows a schematic diagram of the structure of a computer device 1300 suitable for implementing an electronic device according to embodiments of the present invention. Figure 13 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.

[0123] like Figure 13 As shown, the computer device 1300 includes a central processing unit (CPU) 1301 and a graphics processing unit (GPU) 1302, which can perform various appropriate actions and processes according to programs stored in read-only memory (ROM) 1303 or programs loaded from storage portion 1309 into random access memory (RAM) 1304. The RAM 1304 also stores various programs and data required for the operation of the device 1300. The CPU 1301, GPU 1302, ROM 1303, and RAM 1304 are interconnected via a bus 1305. An input / output (I / O) interface 1306 is also connected to the bus 1305.

[0124] The following components are connected to I / O interface 1306: an input section 1307 including a keyboard, mouse, etc.; an output section 1308 including a liquid crystal display (LCD), speakers, etc.; a storage section 1309 including a hard disk, etc.; and a communication section 1310 including a network interface card such as a LAN card, modem, etc. The communication section 1310 performs communication processing via a network such as the Internet. A drive 1311 may also be connected to I / O interface 1306 as needed. Removable media 1312, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1311 as needed so that computer programs read from them can be installed into storage section 1309 as needed.

[0125] In particular, according to embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1310, and / or installed from removable medium 1312. When the computer program is executed by central processing unit (CPU) 1301 and graphics processing unit (GPU) 1302, the functions defined in the methods of this invention are performed.

[0126] It should be noted that the computer-readable medium described in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0127] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0128] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using dedicated hardware-based devices that perform the specified functions or operations, or using a combination of dedicated hardware and computer instructions.

[0129] The modules described in the embodiments of the present invention can be implemented in software or in hardware. The described modules can also be located in a processor.

[0130] In another aspect, the present invention also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the following: acquire an image to be processed; locate a quadrilateral region of a mobile phone screen in the image to be processed; determine whether the quadrilateral region of the mobile phone screen is successfully located; if the location is successful, perform perspective correction on the quadrilateral region of the mobile phone screen to obtain a corrected image; detect bright-colored blob feature points in the corrected image and extract candidate feature points; map the candidate feature points back to the original image coordinates and perform 3×3 grid fitting to obtain the coordinates of nine feature points; if the location of the quadrilateral region of the mobile phone screen fails or the number of candidate feature points is insufficient, switch to the Hough circle detection fallback scheme, perform Hough circle detection on a specified ROI region of the image to be processed to obtain candidate feature points, and perform 3×3 grid fitting on the candidate feature points to obtain the coordinates of nine feature points.

[0131] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention is not limited to the specific combination of the above-described technical features, but also includes other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in this invention.

Claims

1. A method for locating unlock pattern feature points for automated mobile phone forensics, characterized in that, The method includes the following steps: S1: Obtain the image to be processed, and locate the quadrilateral area of ​​the mobile phone screen in the image to be processed; S2: Determine whether the quadrilateral area of ​​the mobile phone screen is successfully positioned. If the positioning is successful, perform perspective correction on the quadrilateral area of ​​the mobile phone screen to obtain the corrected image. S3: Detect bright Blob feature points in the corrected image and extract candidate feature points; S4: Map the candidate feature points back to the original image coordinates, perform 3×3 grid fitting, and obtain the coordinates of nine feature points; S5: If the location of the quadrilateral area of ​​the mobile phone screen fails or the number of candidate feature points is insufficient, switch to the Hough circle detection fallback scheme, perform Hough circle detection on the specified ROI area of ​​the image to be processed, obtain candidate feature points, and perform 3×3 grid fitting on the candidate feature points to obtain the coordinates of nine feature points.

2. The unlocking pattern feature point positioning method according to claim 1, characterized in that, The specific steps in step S1 for locating the quadrilateral region of the mobile phone screen include: performing grayscale conversion, Gaussian blurring, Canny edge detection, and morphological closure operations on the image to be processed to enhance the outline of the screen frame; extracting the outer contour and filtering quadrilateral candidates with an area greater than 5% of the total image area; and selecting the quadrilateral with the largest area as the quadrilateral region of the screen after filtering based on aspect ratio.

3. The unlocking pattern feature point positioning method according to claim 1, characterized in that, The perspective correction in step S2 specifically includes: calculating the perspective transformation matrix, transforming the quadrilateral area of ​​the mobile phone screen into a standard rectangular image, wherein the width of the transformed image is taken as the maximum value of the top and bottom side lengths of the quadrilateral area of ​​the mobile phone screen and limited to between 600 and 1600 pixels, and the height is taken as the maximum value of the left and right side lengths and limited to between 900 and 2200 pixels.

4. The unlocking pattern feature point positioning method according to claim 1, characterized in that, The detection of bright blob feature points in the corrected image in step S3 specifically includes: after converting the corrected image to grayscale and Gaussian blurring, performing a top-hat transformation using an adaptively sized elliptical structuring element to enhance small bright spots, performing binarization using an Otsu threshold after normalization, cleaning up noise through opening operations, and then using a blob detector to extract candidate feature points. The blob detector is set with a roundness threshold of not less than 0.55, an inertia ratio of not less than 0.2, and a minimum blob spacing of not less than 6% of the short side of the image.

5. The unlocking pattern feature point positioning method according to claim 1, characterized in that, The 3×3 grid fitting described in steps S4 and S5 specifically includes the following sub-steps: A1: Determine if the number of candidate points is not less than 6; if it is less than 6, return an empty list. A2: Estimate the dominant step size of the grid, calculate the distance between all candidate point pairs, filter the distance values ​​that are greater than 5% of the short side of the image, perform histogram statistics on the distance values, and take the center value of the highest frequency interval as the dominant step size; A3: Perform one-dimensional clustering on the Y coordinates of the candidate points to obtain row center candidates, discard the top 40% of candidate points to eliminate interference from status bar and text noise, and cluster the remaining points according to the merging tolerance, where the merging tolerance is the larger of 18.0 and the dominant step size of 28%. A4: Select the three best row centers from the row center candidates, traverse all possible three-center combinations, calculate the degree of equality of adjacent spacing and consistency with the dominant step size, and at the same time favor the three-row combinations that are lower, and select the three row centers with the best comprehensive score. A5: Fill the selected three row centers to the full range according to the dominant step size. If there are already three centers, return directly. If there are fewer than three, fill them out by pushing out at equal intervals. A6: Strictly limit the use of only candidate points close to the center of the three rows to estimate the column center. Calculate the distance of each candidate point to the nearest row center and retain only candidate points with a distance not exceeding 22.0 and the larger value of the dominant step size 35%. A7: Perform one-dimensional clustering on the X coordinates of the selected candidate points to obtain column centers, and complete the three column centers according to the dominant step size; A8: Combine the three row centers and three column centers to generate nine theoretical positions for a 3×3 grid; A9: Assign candidate points to the nearest grid positions, calculate the distances to the nearest column center and the nearest row center for each candidate point, determine its grid index, and select the candidate point closest to each grid position; A10: Perform local fine localization for each grid location, perform top-hat transformation enhancement within an 18-pixel window around the grid point, select the pixel area with enhancement value not less than 70% of the maximum value, and calculate the weighted centroid as the coordinates of the feature point after fine localization; A11: Output the coordinates of nine feature points.

6. The unlocking pattern feature point positioning method according to claim 1, characterized in that, The Hough circle detection rollback scheme described in step S5 specifically includes: B1: Define the ROI region as the area from 42% to 88% of the image's vertical coordinate and from 28% to 72% of its horizontal coordinate; B2: Perform grayscale and median blurring processing on the ROI region; B3: Perform Hough circle detection scans sequentially for multiple param2 parameter values, with parameters set as dp=1.2, param1=120, minRadius=3, maxRadius=12, and minDist=6% of the shorter side of the ROI; B4: Perform 3×3 grid fitting on the candidate points obtained from each scan. If the fitting is successful and nine feature points are obtained, calculate the fitting cost and record the solution with the minimum cost. The fitting cost is the sum of the squared distances from the candidate points to the fitted points plus a penalty term for exceeding 12 candidate points. B5: If no fitting solution for all nine feature points is obtained after scanning all parameters, try fitting again using the candidate points with the most relaxed parameters. If the fitting is successful, return the fitting result; otherwise, return the candidate point list.

7. The unlocking pattern feature point positioning method according to claim 6, characterized in that, The scan sequence of the param2 parameter values ​​is 36, 32, 28, 24, 20, 16, 12.

8. The unlocking pattern feature point positioning method according to claim 1, characterized in that, After obtaining the coordinates of the nine feature points as described in steps S4 and S5, the method further includes: arranging the nine feature points in row priority order, first performing KMeans clustering on the Y-axis to obtain three rows of centers, arranging the row order in ascending order of Y coordinates, and arranging them in ascending order of X coordinates within each row, and outputting the final coordinates of the nine feature points.

9. A device for locating unlocking pattern feature points for automated mobile phone forensics, characterized in that, include: The image acquisition module is used to acquire the image to be processed. The screen positioning module is used to locate the quadrilateral area of ​​the mobile phone screen in the image to be processed; The perspective correction module is used to perform perspective correction on the quadrilateral area of ​​the mobile phone screen when the quadrilateral area is successfully located, and obtain a corrected image. The Blob detection module is used to detect bright Blob feature points in the corrected image and extract candidate feature points. The grid fitting module is used to map the candidate feature points back to the original image coordinates, perform 3×3 grid fitting, and obtain the coordinates of nine feature points; The rollback module is used to switch to the Hough circle detection rollback scheme when the positioning of the quadrilateral area of ​​the mobile phone screen fails or the number of candidate feature points is insufficient. The module performs Hough circle detection on the specified ROI area of ​​the image to be processed to obtain candidate feature points, and performs 3×3 grid fitting on the candidate feature points to obtain the coordinates of nine feature points. The output module is used to output the coordinates of the nine feature points.

10. The unlocking pattern feature point positioning device according to claim 9, characterized in that, The mesh fitting module performs the 3×3 mesh fitting step as described in claim 5.

11. The unlocking pattern feature point positioning device according to claim 9, characterized in that, The rollback module executes the steps of the Hough circle detection rollback scheme as described in claim 6.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 8.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 8.