Watermark detection method and system for Android system
Through edge detection and multi-feature fusion technology, the problem of watermark detection in the Android system is solved, and watermark detection with high reliability and high accuracy is achieved.
Patent Information
- Application Number
- CN202510761666.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-19
AI Technical Summary
Existing watermark detection solutions cannot be directly applied to the Android system, resulting in the inability to achieve effective watermark detection.
Edge detection and multi-feature fusion technology is adopted, including grayscale image processing, edge information extraction, contour information conversion and multi-feature matching. Gaussian filter is used to suppress noise, gradient calculation, edge threshold judgment and edge tracking, combined with polygon fitting and frequency domain correlation calculation to realize watermark detection in Android system.
Improved the reliability and accuracy of watermark detection in Android system, realized watermark detection in Android system, and improved the accuracy and reliability of detection.
Smart Images

Figure CN120673095A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a watermark detection method and system for an Android system. Background Art
[0002] With the development of economy and technology and the improvement of people's living standards, electricity has become an indispensable secondary energy source in people's production and life, bringing endless convenience to people's production and life. Therefore, ensuring a stable and reliable supply of electricity has become one of the most important tasks of the power system.
[0003] Currently, watermark detection technology is widely used in digital images, videos, and other fields. The Android operating system is also widely used in power systems. Therefore, a watermark detection solution that can be applied to the Android system is particularly important.
[0004] Currently, there are two main types of watermark detection schemes: one is based on feature extraction and pattern matching: this method extracts image features, including edges, textures, colors, etc., and uses a pattern matching algorithm to compare them with a preset watermark template; common feature extraction algorithms in this type of scheme include scale-invariant feature transform (SIFT) and speeded-up robust features (SURF); this type of scheme calculates the similarity between features to achieve watermark detection and verification. The other is based on machine learning: this method uses machine learning technology to detect watermarks on images; commonly used algorithms in this type of scheme include supervised learning algorithms (such as support vector machines (SVM)) and deep learning algorithms (such as convolutional neural networks (CNN)); this type of scheme trains and classifies on labeled watermarked and non-watermarked image data, and then classifies new images to determine whether they are watermarked.
[0005] However, existing commonly used solutions are all watermark detection methods based on Windows and Linux platforms. Such solutions cannot be directly applied to Android systems and implement corresponding watermark detection. Summary of the Invention
[0006] One of the purposes of the present invention is to provide a watermark detection method for Android system with high reliability and good accuracy.
[0007] A second object of the present invention is to provide a system for implementing the watermark detection method for Android system.
[0008] The watermark detection method for the Android system provided by the present invention comprises the following steps:
[0009] S1. Obtain the image to be detected in the Android system;
[0010] S2. Process the image to be detected obtained in step S1 to obtain a corresponding grayscale image;
[0011] S3. Perform edge detection on the grayscale image obtained in step S2 to obtain the corresponding edge information;
[0012] S4. Based on the edge detection scheme, the edge information obtained in step S3 is converted into the corresponding contour information;
[0013] S5. Based on the multi-feature fusion solution, watermark detection is performed on the contour information obtained in step S4 to complete watermark detection for the Android system.
[0014] Step S2 of processing the image to be detected obtained in step S1 to obtain a corresponding grayscale image specifically includes the following steps:
[0015] The image to be detected obtained in step S1 is subjected to smoothing, contrast enhancement and edge enhancement operations, and finally the processed image to be detected is converted into a corresponding grayscale image.
[0016] Step S3 performs edge detection on the grayscale image obtained in step S2 to obtain corresponding edge information, specifically including the following steps:
[0017] The grayscale image obtained in step S2 is subjected to noise suppression, gradient calculation, non-maximum suppression, edge threshold determination, and edge tracking to obtain corresponding edge information.
[0018] The noise suppression is specifically to suppress the noise of the image using a Gaussian filter, and the non-maximum suppression is specifically to perform non-maximum suppression on each pixel in the image in the gradient direction.
[0019] The gradient calculation specifically includes the following steps:
[0020] The enhanced gradient amplitude at the pixel point (x, y) in the image is calculated using the following formula:
[0021]
[0022] Where G(x,y) is the enhanced gradient amplitude at the pixel point (x,y); G x is the gradient in the x direction at the pixel point (x, y); G y is the gradient in the y direction at the pixel point (x, y); σ local (x,y) is the standard deviation of the grayscale of the neighborhood with the pixel point (x,y) as the center and the set range; σ local is the grayscale standard deviation of the entire image; ε is a set minimum number used to prevent the denominator from being 0.
[0023] The edge threshold determination specifically includes the following steps:
[0024] Set a high threshold and a low threshold, and the high threshold is greater than the low threshold;
[0025] For each pixel in the image, the following rules are used for judgment:
[0026] If the enhanced gradient amplitude of a pixel is not lower than the high threshold, the pixel is determined to be a strong edge pixel;
[0027] If the enhanced gradient amplitude of a pixel is not higher than the low threshold, the pixel is determined to be a non-edge pixel;
[0028] If the enhanced gradient amplitude of a pixel point is higher than the low threshold and lower than the high threshold, the pixel point is determined to be a weak edge pixel;
[0029] For weak edge pixels, the following rules are used again for judgment:
[0030] If a weak edge pixel is connected to a strong edge pixel, the weak edge pixel is determined to be an edge pixel;
[0031] If a weak edge pixel is not connected to a strong edge pixel, the weak edge pixel is determined to be a non-edge pixel;
[0032] The high and low thresholds are set using the following formula:
[0033]
[0034] T l =max(μ G -k2·σ G ,k3·T h )
[0035] Where T h is the high threshold; μ G is the mean value of the enhanced gradient amplitude of each pixel in the image; σ G is the standard deviation of the enhanced gradient amplitude of each pixel in the image; k1 is the first empirical coefficient set; H(I) is the image information entropy, and H(I) = -∑p k log2p k , p k represents the probability that the gray value of any pixel in the image is k; L is the gray level; k2 is the set second empirical coefficient; k3 is the set third empirical coefficient; T l is the low threshold.
[0036] The edge tracking specifically includes the following steps:
[0037] Connect the pixels determined to be strong edge pixels and edge pixels;
[0038] The edge tracking algorithm is used to obtain the closed edge curve in the image, thereby obtaining the edge information in the image.
[0039] The edge detection scheme described in step S4 converts the edge information obtained in step S3 into corresponding contour information, which specifically includes the following steps:
[0040] The edge information obtained in step S3 is processed using an edge detection algorithm to obtain corresponding contour information;
[0041] According to the obtained contour information, the relationship between contours is described using the contour hierarchy:
[0042] Containment relationship: If one contour is located inside another contour, the two contours are judged to be in a containment relationship: the contained contour is the child contour, and the contour containing the child contour is the parent contour;
[0043] Hierarchical relationship: The hierarchical relationship of the contour is represented by a tree structure. Each contour has a set of attributes, including pointers to the parent contour and pointers to the child contour. The root node of the tree structure represents the outermost image contour, and the leaf node represents each innermost contour.
[0044] The multi-feature fusion solution described in step S5 is used to perform watermark detection on the contour information obtained in step S4, which specifically includes the following steps:
[0045] The contour information obtained in step S4 is fitted using a polygon fitting algorithm to obtain a contour polygon;
[0046] According to the obtained polygon, it is matched with the preset watermark template based on the multi-feature fusion scheme, and the area similarity, spatial overlap and frequency domain correlation are calculated respectively, which are expressed as
[0047]
[0048] Where M is the matching result; α is the first weight coefficient; λ1 is the attenuation coefficient; ΔA is the normalized area difference; β is the second weight coefficient; IoU(P,Q) is the spatial overlap between the contour polygon P and the contour polygon Q, and Area() is the area calculation function, P∩Q represents the overlapping part of the contour polygon P and the contour polygon Q, P∪Q represents the entire part of the contour polygon P and the contour polygon Q; γ is the third weight coefficient, and α+β+γ=1; NCC(F T ,F D ) is the calculation template image area F T and the detected image region F D The frequency domain similarity function of F T (i, j) is the grayscale value of pixel (i, j) in the template image area, is the template image area F T Grayscale mean, F D (i, j) is the grayscale value of pixel (i, j) in the detection image area, To detect the image region F D Grayscale mean;
[0049] Based on the matching results, the following rules are used for judgment:
[0050] If M is greater than or equal to the set threshold, it is determined that a watermark exists;
[0051] If M is less than the set threshold, it is determined that there is no watermark.
[0052] The present invention also provides a system for implementing the watermark detection method for the Android system, comprising an image acquisition module, an image processing module, an edge detection module, an edge conversion module and a watermark detection module; the image acquisition module, the image processing module, the edge detection module, the edge conversion module and the watermark detection module are connected in series in sequence; the image acquisition module is used to acquire the image to be detected in the Android system, and upload the data information to the image processing module; the image processing module is used to process the acquired image to be detected according to the received data information to obtain a corresponding grayscale image, and upload the data information to the edge detection module; the edge detection module is used to perform edge detection on the obtained grayscale image according to the received data information to obtain corresponding edge information, and upload the data information to the edge conversion module; the edge conversion module is used to convert the obtained edge information into corresponding contour information based on the edge detection scheme according to the received data information, and upload the data information to the watermark detection module; the watermark detection module is used to perform watermark detection on the obtained contour information based on the received data information and a multi-feature fusion scheme to complete the watermark detection for the Android system.
[0053] The watermark detection method and system for the Android system provided by the present invention not only realize watermark detection for the Android system through image processing, edge detection and feature fusion, but also have higher reliability and better accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 Schematic diagram of the process of the present invention.
[0055] Figure 2 Schematic diagram of the functional modules of the system of the present invention. DETAILED DESCRIPTION
[0056] like Figure 1The figure shows a flow chart of the method of the present invention: The watermark detection method for Android system disclosed in the present invention comprises the following steps:
[0057] S1. Obtain the image to be detected in the Android system;
[0058] S2. Process the image to be detected obtained in step S1 to obtain a corresponding grayscale image; specifically, the steps include:
[0059] Perform smoothing, contrast enhancement, and edge enhancement on the image to be detected obtained in step S1, and finally convert the processed image to be detected into a corresponding grayscale image;
[0060] S3. Perform edge detection on the grayscale image obtained in step S2 to obtain corresponding edge information; specifically comprising the following steps:
[0061] The grayscale image obtained in step S2 is subjected to noise suppression, gradient calculation, non-maximum suppression, edge threshold determination, and edge tracking to obtain corresponding edge information;
[0062] In a specific implementation, noise suppression is specifically performed on the image using a Gaussian filter;
[0063] Gradient calculation specifically includes the following steps:
[0064] The enhanced gradient amplitude at the pixel point (x, y) in the image is calculated using the following formula:
[0065]
[0066] Where G(x,y) is the enhanced gradient amplitude at the pixel point (x,y); G x is the gradient in the x direction at the pixel point (x, y); G y is the gradient in the y direction at the pixel point (x, y); σ local (x,y) is the standard deviation of the grayscale of the neighborhood with the pixel point (x,y) as the center and the set range; σ local is the grayscale standard deviation of the entire image; ε is a set minimum number used to prevent the denominator from being 0, and the preferred value is 0.01;
[0067] Non-maximum suppression, specifically, performing non-maximum suppression on each pixel in the image in the gradient direction;
[0068] Edge threshold determination specifically includes the following steps:
[0069] Set a high threshold and a low threshold, and the high threshold is greater than the low threshold;
[0070] For each pixel in the image, the following rules are used for judgment:
[0071] If the enhanced gradient amplitude of a pixel is not lower than the high threshold, the pixel is determined to be a strong edge pixel;
[0072] If the enhanced gradient amplitude of a pixel is not higher than the low threshold, the pixel is determined to be a non-edge pixel;
[0073] If the enhanced gradient amplitude of a pixel point is higher than the low threshold and lower than the high threshold, the pixel point is determined to be a weak edge pixel;
[0074] For weak edge pixels, the following rules are used again for judgment:
[0075] If a weak edge pixel is connected to a strong edge pixel, the weak edge pixel is determined to be an edge pixel;
[0076] If a weak edge pixel is not connected to a strong edge pixel, the weak edge pixel is determined to be a non-edge pixel;
[0077] The high and low thresholds are set using the following formula:
[0078]
[0079] T l =max(μ G -k2·σ G ,k3·T h )
[0080] Where T h is the high threshold; μ G is the mean value of the enhanced gradient amplitude of each pixel in the image; σ G is the standard deviation of the enhanced gradient amplitude of each pixel in the image; k1 is the first empirical coefficient set, preferably 1.6; H(I) is the image information entropy, and H(I) = -∑p k log2p k , p k represents the probability that the gray value of any pixel in the image is k; L is the gray level, preferably 256; k2 is the second empirical coefficient, preferably 0.6; k3 is the third empirical coefficient, preferably 0.1; T l is a low threshold;
[0081] Edge tracking includes the following steps:
[0082] Connect the pixels determined to be strong edge pixels and edge pixels;
[0083] Using edge tracking algorithm, we can get the closed edge curve in the image, thus getting the edge information in the image;
[0084] S4. Based on the edge detection scheme, the edge information obtained in step S3 is converted into corresponding contour information; specifically comprising the following steps:
[0085] The edge information obtained in step S3 is processed using an edge detection algorithm to obtain corresponding contour information;
[0086] According to the obtained contour information, the relationship between contours is described using the contour hierarchy:
[0087] Containment relationship: If one contour is located inside another contour, the two contours are judged to be in a containment relationship: the contained contour is the child contour, and the contour containing the child contour is the parent contour;
[0088] Hierarchical relationship: The hierarchical relationship of contours is represented by a tree structure. Each contour has a set of attributes, including pointers to parent contours and pointers to child contours. The root node of the tree structure represents the outermost image contour, and the leaf nodes represent each innermost contour.
[0089] S5. Based on the multi-feature fusion solution, perform watermark detection on the contour information obtained in step S4 to complete the watermark detection for the Android system
[0090] The specific steps include the following:
[0091] The contour information obtained in step S4 is fitted using a polygon fitting algorithm to obtain a contour polygon;
[0092] According to the obtained polygon, it is matched with the preset watermark template based on the multi-feature fusion scheme, and the area similarity, spatial overlap and frequency domain correlation are calculated respectively, which are expressed as
[0093]
[0094] Where M is the matching result; α is the first weight coefficient; λ1 is the attenuation coefficient, preferably 5; ΔA is the normalized area difference; β is the second weight coefficient; IoU(P,Q) is the spatial overlap between the contour polygon P and the contour polygon Q, and Area() is the area calculation function, P∩Q represents the overlapping part of the contour polygon P and the contour polygon Q, P∪Q represents the entire part of the contour polygon P and the contour polygon Q; γ is the third weight coefficient, and α+β+γ=1; NCC(F T ,F D ) is the calculation template image area F T and the detected image region F D The frequency domain similarity function of F T (i, j) is the grayscale value of pixel (i, j) in the template image area, is the template image area F T Grayscale mean, F D (i, j) is the grayscale value of pixel (i, j) in the detection image area, To detect the image region F D Grayscale mean;
[0095] Based on the matching results, the following rules are used for judgment:
[0096] If M is greater than or equal to the set threshold, it is determined that a watermark exists;
[0097] If M is less than the set threshold, it is determined that there is no watermark.
[0098] like Figure 2 The figure shows a schematic diagram of the functional modules of the system of the present invention: the system disclosed in the present invention for implementing the watermark detection method for the Android system includes an image acquisition module, an image processing module, an edge detection module, an edge conversion module and a watermark detection module; the image acquisition module, the image processing module, the edge detection module, the edge conversion module and the watermark detection module are connected in series in sequence; the image acquisition module is used to acquire the image to be detected in the Android system and upload the data information to the image processing module; the image processing module is used to process the acquired image to be detected according to the received data information to obtain the corresponding grayscale image, and upload the data information to the edge detection module; the edge detection module is used to perform edge detection on the obtained grayscale image according to the received data information to obtain the corresponding edge information, and upload the data information to the edge conversion module; the edge conversion module is used to convert the obtained edge information into corresponding contour information based on the edge detection scheme according to the received data information, and upload the data information to the watermark detection module; the watermark detection module is used to perform watermark detection on the obtained contour information based on the received data information and a multi-feature fusion scheme to complete the watermark detection for the Android system.
Claims
1. A watermark detection method for an Android system, comprising the following steps: S1. Obtain the image to be detected in the Android system; S2. Process the image to be detected obtained in step S1 to obtain a corresponding grayscale image; S3. Perform edge detection on the grayscale image obtained in step S2 to obtain the corresponding edge information; S4. Based on the edge detection scheme, the edge information obtained in step S3 is converted into the corresponding contour information; S5. Based on the multi-feature fusion solution, watermark detection is performed on the contour information obtained in step S4 to complete watermark detection for the Android system.
2. The watermark detection method for Android system according to claim 1, characterized in that Step S2 of processing the image to be detected obtained in step S1 to obtain a corresponding grayscale image specifically includes the following steps: The image to be detected obtained in step S1 is subjected to smoothing, contrast enhancement and edge enhancement operations, and finally the processed image to be detected is converted into a corresponding grayscale image.
3. The watermark detection method for Android system according to claim 2, characterized in that Step S3 performs edge detection on the grayscale image obtained in step S2 to obtain corresponding edge information, specifically including the following steps: The grayscale image obtained in step S2 is subjected to noise suppression, gradient calculation, non-maximum suppression, edge threshold determination, and edge tracking to obtain corresponding edge information.
4. The watermark detection method for Android system according to claim 3, characterized in that The noise suppression is specifically to suppress the noise of the image using a Gaussian filter, and the non-maximum suppression is specifically to perform non-maximum suppression on each pixel in the image in the gradient direction.
5. The watermark detection method for Android system according to claim 4, characterized in that The gradient calculation specifically includes the following steps: The enhanced gradient amplitude at the pixel point (x, y) in the image is calculated using the following formula: Where G(x,y) is the enhanced gradient amplitude at the pixel point (x,y); G x is the gradient in the x direction at the pixel point (x, y); G y is the gradient in the y direction at the pixel point (x, y); σ local (x,y) is the standard deviation of the grayscale of the neighborhood with the pixel point (x,y) as the center and the set range; σ local is the grayscale standard deviation of the entire image; ε is a set minimum number used to prevent the denominator from being 0.
6. The watermark detection method for Android system according to claim 5, characterized in that The edge threshold determination specifically includes the following steps: Set a high threshold and a low threshold, and the high threshold is greater than the low threshold; For each pixel in the image, the following rules are used for judgment: If the enhanced gradient amplitude of a pixel is not lower than the high threshold, the pixel is determined to be a strong edge pixel; If the enhanced gradient amplitude of a pixel is not higher than the low threshold, the pixel is determined to be a non-edge pixel; If the enhanced gradient amplitude of a pixel point is higher than the low threshold and lower than the high threshold, the pixel point is determined to be a weak edge pixel; For weak edge pixels, the following rules are used again for judgment: If a weak edge pixel is connected to a strong edge pixel, the weak edge pixel is determined to be an edge pixel; If a weak edge pixel is not connected to a strong edge pixel, the weak edge pixel is determined to be a non-edge pixel; The high and low thresholds are set using the following formula: T l =max(μ G -k2·s G ,k3·T h ) Where T h is the high threshold; μ G is the mean value of the enhanced gradient amplitude of each pixel in the image; σ G is the standard deviation of the enhanced gradient amplitude of each pixel in the image; k1 is the first empirical coefficient set; H(I) is the image information entropy, and H(I) = -∑p k log2p k , p k represents the probability that the gray value of any pixel in the image is k; L is the gray level; k2 is the set second empirical coefficient; k3 is the set third empirical coefficient; T l is the low threshold.
7. The watermark detection method for Android system according to claim 6, characterized in that The edge tracking specifically includes the following steps: Connect the pixels determined to be strong edge pixels and edge pixels; The edge tracking algorithm is used to obtain the closed edge curve in the image, thereby obtaining the edge information in the image.
8. The watermark detection method for Android system according to claim 7, characterized in that The edge detection scheme described in step S4 converts the edge information obtained in step S3 into corresponding contour information, which specifically includes the following steps: The edge information obtained in step S3 is processed using an edge detection algorithm to obtain corresponding contour information; According to the obtained contour information, the relationship between contours is described using the contour hierarchy: Containment relationship: If one contour is located inside another contour, the two contours are judged to be in a containment relationship: the contained contour is the child contour, and the contour containing the child contour is the parent contour; Hierarchical relationship: The hierarchical relationship of the contour is represented by a tree structure. Each contour has a set of attributes, including pointers to the parent contour and pointers to the child contour. The root node of the tree structure represents the outermost image contour, and the leaf node represents each innermost contour.
9. The watermark detection method for Android system according to claim 8, characterized in that The multi-feature fusion solution described in step S5 is used to perform watermark detection on the contour information obtained in step S4, which specifically includes the following steps: The contour information obtained in step S4 is fitted using a polygon fitting algorithm to obtain a contour polygon; According to the obtained polygon, it is matched with the preset watermark template based on the multi-feature fusion scheme, and the area similarity, spatial overlap and frequency domain correlation are calculated respectively, which are expressed as Where M is the matching result; α is the first weight coefficient; λ1 is the attenuation coefficient; ΔA is the normalized area difference; β is the second weight coefficient; IoU(P,Q) is the spatial overlap between the contour polygon P and the contour polygon Q, and Area() is the area calculation function, P∩Q represents the overlapping part of the contour polygon P and the contour polygon Q, P∪Q represents the entire part of the contour polygon P and the contour polygon Q; γ is the third weight coefficient, and α+β+γ=1; NCC(F T ,F D ) is the calculation template image area F T and the detected image region F D The frequency domain similarity function of F T (i, j) is the grayscale value of pixel (i, j) in the template image area, is the template image area F T Grayscale mean, F D (i, j) is the grayscale value of pixel (i, j) in the detection image area, To detect the image region F D Grayscale mean; Based on the matching results, the following rules are used for judgment: If M is greater than or equal to the set threshold, it is determined that a watermark exists; If M is less than the set threshold, it is determined that there is no watermark.
10. A system for implementing the watermark detection method for Android system according to any one of claims 1 to 9, characterized in that It includes an image acquisition module, an image processing module, an edge detection module, an edge conversion module and a watermark detection module; the image acquisition module, the image processing module, the edge detection module, the edge conversion module and the watermark detection module are connected in series in sequence; the image acquisition module is used to obtain the image to be detected in the Android system and upload the data information to the image processing module; The image processing module is used to process the acquired image to be detected according to the received data information to obtain the corresponding grayscale image, and upload the data information to the edge detection module; The edge detection module is used to perform edge detection on the grayscale image according to the received data information to obtain the corresponding edge information, and upload the data information to the edge conversion module; The edge conversion module is used to convert the edge information received into corresponding contour information based on the edge detection scheme according to the received data information, and upload the data information to the watermark detection module; The watermark detection module is used to perform watermark detection on the obtained contour information based on the received data information and a multi-feature fusion solution to complete watermark detection for the Android system.