A method and system for rapid replacement of startup logos based on machine learning

By using machine learning techniques, combined with histogram equalization, improved mean filtering, local binary pattern background modeling, Bayesian estimation, and K-nearest neighbor matting algorithm, the slow speed and lack of intelligence of traditional boot logo replacement methods are solved, and fast and intelligent boot logo replacement is achieved.

CN119850790BActive Publication Date: 2025-12-02JINPIN ELECTRICAL CO LTD ZHUHAI S E Z
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411933917.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-12-02
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

Traditional methods for replacing the startup logo are rigid, unable to replace it intelligently, and do not utilize machine learning technology, resulting in slow replacement speeds and long system processing times, which negatively impacts user experience.

Method used

A machine learning-based approach is used to achieve rapid replacement of the startup logo through histogram equalization, improved mean filtering, local binary pattern background modeling, Bayesian estimation, and K-nearest neighbor matting algorithm.

Benefits of technology

It improves image processing speed and matting accuracy, reduces redundant calculations, enhances the completeness of target image extraction and matting effect under complex backgrounds, and realizes fast and intelligent replacement of startup logo.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850790B_ABST
    Figure CN119850790B_ABST
Patent Text Reader

Abstract

This invention relates to the technical field of image replacement, and discloses a method and system for rapid replacement of a startup logo based on machine learning. First, the original startup logo image is enhanced using histogram equalization, and then denoised using an improved mean filtering algorithm to obtain a processed startup logo image. Second, the texture features of the processed startup logo image are extracted using a local binary pattern background modeling method, and after shadow detection and removal, a startup logo shadow image is obtained. Then, the startup logo image is extracted using Bayesian estimation and a K-nearest neighbor matting algorithm. Finally, the new startup logo image is used to replace the original startup logo image, achieving rapid startup logo replacement. This invention achieves rapid startup logo replacement by processing and extracting human startup logo images; the method is fast and accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of image replacement, specifically to a method and system for quickly replacing a startup logo based on machine learning. Background Technology

[0002] To meet customers' needs for changing the startup logo, a quick operation method is used. In the factory settings mode, a simple setup can be performed to quickly export the startup logo and create a file of the same size and format as the original logo for use when changing other logos, without having to update the main program again, which can enhance the user experience.

[0003] Traditional boot logo replacement methods use pre-stored images in the system to randomly replace the logo when the machine starts up. The replacement process is rigid and cannot be intelligently replaced in sync with the boot animation, making it unsuitable for video-based logo replacement methods. At the same time, traditional boot logo replacement methods do not utilize advanced technologies such as machine learning, and urgently need improvement in replacement speed and system processing time, causing inconvenience to the user experience. Summary of the Invention

[0004] To address the problems in related technologies, this invention provides a method and system for quickly replacing the startup logo based on machine learning, thereby overcoming the aforementioned technical problems existing in the prior art.

[0005] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution:

[0006] This invention provides a method for quickly replacing the startup logo based on machine learning, comprising the following steps:

[0007] S1. Obtain the original boot screen LOGO image, perform image enhancement on the original boot screen LOGO image based on the histogram equalization method, and then use the improved mean filtering algorithm for noise reduction to obtain the processed boot screen LOGO image.

[0008] S2. Use the local binary pattern background modeling method to extract the texture features of the processed boot screen LOGO image to obtain the texture feature map of the processed boot screen LOGO image. Then perform feature extraction to obtain the initial boot screen LOGO image. After shadow determination and shadow removal, output the boot screen LOGO shadow image.

[0009] S3. Based on Bayesian estimation and K-nearest neighbor matting algorithm, the image is matted. After determining the probability that the pixels in the boot logo shadow image belong to the foreground using Bayesian estimation, the images are classified to obtain three-dimensional images of the boot logo. Then, the boot logo image is extracted from the three-dimensional images of the boot logo using the K-nearest neighbor matting algorithm.

[0010] S4. Set a new set of boot logo images, and replace the boot logo image with the new boot logo image from the new set of boot logo images to achieve quick boot logo replacement.

[0011] This invention acquires the original boot screen logo image, enhances it using histogram equalization, and then reduces noise using an improved mean filtering algorithm to obtain a processed boot screen logo image. The method enhances image contrast by stretching pixels and changing their intensity distribution. It also improves image processing speed and reduces redundant calculations by calculating the weights of deviations from coordinate points for filtering. Furthermore, it extracts texture features using a local binary pattern background modeling method, converts the boot screen logo image into a texture feature map by setting a threshold, and then compares the images to obtain the initial boot screen logo image before applying shadows. The method involves several steps: 1) Judgment and shadow removal; 2) Targeting complex and shadowed images, this method improves the completeness of target image extraction against complex backgrounds. Texture features exhibit rotation invariance and strong resistance to noise, aiding in target image extraction. 3) Bayesian estimation is used to determine the probability of pixels belonging to the foreground. After classification, the K-nearest neighbor matting algorithm is used to extract the boot logo image from the three-part boot logo image. Bayesian estimation transforms the image into a three-part image, reducing processing time and improving matting results. The K-nearest neighbor matting algorithm, by constructing a kernel function, improves matting accuracy and facilitates subsequent processing. Finally, a new boot logo image replaces the original boot logo image, achieving rapid boot logo replacement.

[0012] Preferably, step S1 includes the following steps:

[0013] S11. Obtain the original boot screen logo image, select sample points (pixels) from the original boot screen logo image, and quantize the sample points; set the number of pixels in the original boot screen logo image as a and the number of gray levels as b, to obtain the gray level set A = {c1, c2, c3, ..., c b}, where c b Let b represent the number of pixels at gray level b. The formula for calculating the gray level frequency is as follows:

[0014]

[0015] Where, β b′ Represents the frequency of gray level b′, c b′ This represents the number of pixels at gray level b′, where b′ = 1, 2, 3, ..., b;

[0016] Calculate the frequency of all gray levels in the original boot screen logo image, plot a gray level histogram of the original boot screen logo image, and perform histogram equalization to obtain the enhanced boot screen logo image. The calculation formula is as follows:

[0017]

[0018] in, This indicates histogram equalization of gray levels;

[0019] S12. The enhanced boot screen logo image is processed using an improved mean filtering algorithm to obtain the processed boot screen logo image. The specific steps are as follows:

[0020] S121. Convert the enhanced boot screen logo image into an enhanced boot screen logo image matrix, and establish a two-dimensional coordinate system to obtain pixel coordinates; set the search box size to α1×α1, the search box contains several sub-search boxes, the sub-search boxes are α2×α2, select any sub-search box in the enhanced boot screen logo image matrix, denoted as the first sub-search box and the second sub-search box, calculate the distance from the center pixel of the first sub-search box to the center pixel of the second sub-search box, the calculation formula is as follows:

[0021]

[0022] Where d1 represents the distance from the center pixel of the first sub-search box to the center pixel of the second sub-search box, b″(x1,y1) represents the coordinates of the center pixel of the first sub-search box, and b″(x2,y2) represents the coordinates of the center pixel of the second sub-search box.

[0023] S122. Let δ1 represent the filtering coefficient and δ2 represent the normalization coefficient. The similarity coefficient is obtained based on the distance between the center pixel of the first sub-search box and the center pixel of the second sub-search box. The calculation formula is as follows:

[0024]

[0025] Where χ represents the similarity coefficient;

[0026] The similarity coefficient is used to perform a weighted average of the pixels in the search box. The search box is then moved until all pixels in the enhanced boot screen logo image matrix have been weighted averaged. At this point, noise reduction is completed, and the processed boot screen logo image is obtained.

[0027] This invention enhances the original boot screen logo image by using histogram equalization, which stretches the pixels to change the intensity distribution and enhances the image contrast. After noise reduction using an improved mean filtering algorithm, a processed boot screen logo image is obtained. By calculating the weights of the deviation from the coordinate points and performing filtering, the image processing speed can be effectively improved, redundant calculations can be reduced, and the algorithm efficiency can be improved.

[0028] Preferably, step S2 includes the following steps:

[0029] S21. Apply the local binary pattern background modeling method to the processed boot screen logo image to extract local binary pattern texture features, thereby obtaining the texture feature map of the processed boot screen logo image. The specific steps are as follows:

[0030] S211. The processed boot screen logo image is converted into a processed boot screen logo image matrix, where the elements of the processed boot screen logo image matrix are pixels on the processed boot screen logo image. Any pixel is selected from the processed boot screen logo image matrix and designated as a feature pixel. The area centered on the feature pixel and with a radius of b″′ is designated as the annular neighborhood. The grayscale value of the feature pixel and the grayscale values ​​of the equally divided points of the annular neighborhood are obtained. The formula for calculating the local binary value of the feature pixel is as follows:

[0031]

[0032] Where B represents the local binary value of the feature pixel. e represents the number of equally divided points in the circular neighborhood. a′ Let e ​​represent the grayscale value of the a′-th annular neighborhood dividing point, and e represent the grayscale value of the feature pixel.

[0033] S212. Using the local binary values ​​of the feature pixels as feature thresholds, compare the gray values ​​of pixels in the annular neighborhood with the feature thresholds. When the gray value of a pixel in the annular neighborhood is greater than or equal to the feature threshold, set the corresponding pixel in the annular neighborhood to 1; when the gray value of a pixel in the annular neighborhood is less than the feature threshold, set the corresponding pixel in the annular neighborhood to 0, thus obtaining the processed annular neighborhood. Generate a sequence of the processed annular neighborhood in a clockwise direction, convert the sequence into a decimal number, and use the decimal number as the texture feature value of the feature pixels. Calculate the texture feature values ​​of all pixels in the processed boot screen LOGO image matrix to obtain the texture feature map of the processed boot screen LOGO image.

[0034] S22. Set the grayscale threshold to ω, divide the grayscale values ​​of the pixels in the processed boot screen LOGO image matrix according to the grayscale threshold to obtain the first grayscale set and the second grayscale set, calculate the average value and inter-class variance of the first grayscale set and the second grayscale set, establish the inter-class variance equation, and continuously adjust the grayscale threshold to make the inter-class variance equation reach the maximum value to obtain the optimal grayscale threshold.

[0035] Pixels with grayscale values ​​greater than or equal to the optimal grayscale threshold in the processed boot screen logo image matrix are designated as foreground pixels, generating a boot screen logo foreground image. Pixels with grayscale values ​​less than the optimal grayscale threshold in the processed boot screen logo image matrix are designated as background pixels, generating a boot screen logo background image. Local binary pattern texture features of the boot screen logo background image are extracted to obtain a texture feature map of the boot screen logo background image. The texture feature map of the processed boot screen logo image and the texture feature map of the boot screen logo background image are compared and updated to obtain the final boot screen logo background image. Image extraction is performed on the final boot screen logo background image and the processed boot screen logo image to obtain an initial boot screen logo image.

[0036] S23. Perform shadow detection and shadow removal on the initial boot logo image to obtain a boot logo shadow image. The specific steps are as follows:

[0037] S231. Convert the initial boot logo image into an initial boot logo image matrix, calculate the gradient value and gradient direction of all pixels in the initial boot logo image matrix, select the pixel corresponding to the maximum gradient value, perform threshold division on the initial boot logo image matrix, generate a preprocessed boot logo image matrix, find the boot logo image outline in the preprocessed boot logo image matrix, and mark the rightmost pixel of the boot logo image outline as the shadow determination pixel.

[0038] S232. Traverse all pixels to the right of the shadow detection pixel. When the gray value of a pixel is 0, record the corresponding pixel as a shadow pixel and set the gray value of the shadow pixel to 255. Otherwise, the corresponding pixel is not a shadow pixel. Complete the shadow removal and output the boot logo shadow image.

[0039] This invention extracts texture features by using a local binary pattern background modeling method. By setting a threshold, the boot screen logo image is transformed into a texture feature map. The texture features are rotationally invariant and have strong resistance to noise. The initial boot logo image is obtained by image comparison, and then shadow determination and shadow removal are performed to improve the completeness of target image extraction in complex backgrounds, which helps to achieve target image extraction.

[0040] Preferably, step S3 includes the following steps:

[0041] S31. Convert the boot logo shadow image into a boot logo shadow image matrix. Select any pixel in the boot logo shadow image matrix and denote it as a Bayesian estimated pixel. Set the probability that the Bayesian estimated pixel belongs to the foreground as e1, the probability that the Bayesian estimated pixel belongs to the background as e2, the probability that all pixels in the boot logo shadow image matrix belong to the foreground as e3, and the probability that all pixels in the boot logo shadow image matrix belong to the background as e4. The formula for calculating the foreground probability is as follows:

[0042]

[0043] Where φ represents the probability that a pixel belongs to the foreground as estimated by Bayes;

[0044] S32. Set the foreground threshold to ξ. When the probability of a Bayesian estimated pixel belonging to the foreground is less than the foreground threshold, the Bayesian estimated pixel is a background pixel. When the probability of a Bayesian estimated pixel belonging to the foreground is greater than 1-ξ, the Bayesian estimated pixel is a foreground pixel. Otherwise, the Bayesian estimated pixel is an unknown pixel, and the gray value of the unknown pixel is set to 0.5. This process continues until all pixels in the boot logo shadow image matrix are classified, generating a three-part image of the boot logo.

[0045] S33. Use the K-nearest neighbor matting algorithm to extract the boot logo image from the three-part boot logo image. The specific steps are as follows:

[0046] S331. Convert the boot logo three-dimensional image into a boot logo three-dimensional image matrix. Select pixel g in the boot logo three-dimensional image matrix and set the two-dimensional coordinates of pixel g in the boot logo three-dimensional image matrix as (x...). g ,y g Let the brightness of pixel g be h′, the saturation of pixel g be h″, and the lightness of pixel g be h″′. Construct the feature vector C(g) = (cos(h′), sin(h′), h″, h″′, x g ,y g); Pixel l is selected from the three-part image matrix of the boot logo, and the feature vector of pixel l is denoted as C(l). The kernel function is established using the feature vectors of pixel g and pixel l as follows:

[0047]

[0048] Where f(g,l) represents the kernel function. Indicates the weighting coefficients;

[0049] By controlling the weight coefficients, the kernel function is made to be greater than or equal to 0 and less than or equal to 1, and a Laplace matrix is ​​constructed based on the kernel function;

[0050] S332. Set the diagonal matrix D1, the positive semi-definite matrix D2, the constraint coefficient γ, and the opacity of the i-th layer of the boot logo tri-image as h. i If the binary vector is h, then the closed-form solution satisfies the following formula:

[0051]

[0052] Where n represents the number of layers, i = 1, 2, 3, ... n;

[0053] Assuming that the optimization function of the K-nearest neighbor matting algorithm has a closed-form solution, the optimal solution of the K-nearest neighbor matting algorithm is obtained by combining the closed-form solution and the Laplace matrix;

[0054] S333. Using the optimal solution of the K-nearest neighbor matting algorithm as the transparency threshold, perform layer filtering on the three-part boot logo image, retain the pixels whose gray values ​​are less than or equal to the transparency threshold, remove the pixels whose gray values ​​are greater than the transparency threshold, and output the boot logo image.

[0055] This invention uses Bayesian estimation to determine the probability that a pixel belongs to the foreground, transforming the image into a triangulation image, reducing processing time and improving the matting effect; then, the K-nearest neighbor matting algorithm is used to extract the boot logo image from the triangulation image of the boot logo. By constructing kernel functions and closed-form solutions, the matting accuracy can be improved, facilitating subsequent processing.

[0056] Preferably, step S4 includes the following steps:

[0057] S41. Obtain a new set of boot logo images. Import the new set of boot logo images into the machine settings before the machine leaves the factory. When the machine is powered on, set a detection point on the boot logo image to quickly detect the boot logo image, delete the boot logo image, and return the coordinates of the detection point.

[0058] S42. Select the same detection point on the new boot logo image in the new boot logo image set to obtain a new detection point. By comparing the coordinates of the detection point and the new detection point, enlarge and reduce the new boot logo image according to the ratio, and replace it with the boot logo image to achieve fast boot logo replacement.

[0059] This invention also discloses a system for a quick boot logo replacement method based on machine learning, specifically including: a preprocessing module for the original boot interface logo image, an image texture feature extraction module, an image matting module, and a quick boot logo replacement module;

[0060] The original boot screen LOGO image preprocessing module is used to perform image enhancement and improved mean filtering on the original boot screen LOGO image.

[0061] The image texture feature extraction module is used to extract the texture features of the boot screen LOGO image using the local binary pattern background modeling method;

[0062] The image matting module is used to perform image matting based on Bayesian estimation and the K-nearest neighbor matting algorithm.

[0063] The boot logo quick replacement module is used to replace the boot logo image with a new boot logo image.

[0064] The present invention has the following beneficial effects:

[0065] 1. This invention enhances the original boot screen logo image by using histogram equalization. By stretching the pixels and changing the intensity distribution, it enhances the image contrast and effectively improves the image processing speed.

[0066] 2. This invention obtains a processed boot screen LOGO image by using an improved mean filtering algorithm for noise reduction. By calculating the weights of the deviation from the coordinate points, filtering is performed, reducing redundant calculations and improving algorithm efficiency.

[0067] 3. This invention extracts texture features by using a local binary pattern background modeling method. Texture features are rotationally invariant and have strong resistance to noise. Then, image comparison is performed to obtain an initial boot logo image, realizing shadow determination and shadow removal, improving the completeness of target image extraction in complex backgrounds, and helping to achieve target image extraction.

[0068] 4. This invention uses Bayesian estimation to determine the probability that a pixel belongs to the foreground, transforms the image into a triangulation, reduces time consumption, and improves the image matting effect; then, it uses the K-nearest neighbor matting algorithm to extract the boot logo image from the triangulation image of the boot logo, and by constructing kernel functions and closed-form solutions, it can improve the matting accuracy and facilitate subsequent processing.

[0069] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0070] To more clearly illustrate the technical solutions of the embodiments of the invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For those skilled in the art, the drawings can be obtained from these drawings without creative effort.

[0071] Figure 1 This invention provides a schematic diagram of the process for quickly replacing the startup logo using a machine learning-based startup logo replacement system. Detailed Implementation

[0072] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0073] In the description of this invention, it should be understood that the terms "opening", "upper", "lower", "top", "middle", "inner", etc., which indicate orientation or positional relationship, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on the invention.

[0074] Example 1

[0075] Please refer to Figure 1 This invention provides a method for quickly replacing the startup logo based on machine learning, comprising the following steps:

[0076] S1. Obtain the original boot screen LOGO image, perform image enhancement on the original boot screen LOGO image based on the histogram equalization method, and then use the improved mean filtering algorithm for noise reduction to obtain the processed boot screen LOGO image.

[0077] S1 includes the following steps:

[0078] S11. Obtain the original boot screen logo image, select sample points (pixels) from the original boot screen logo image, and quantize the sample points; set the number of pixels in the original boot screen logo image as a and the number of gray levels as b, to obtain the gray level set A = {c1, c2, c3, ..., c b}, where c b Let b represent the number of pixels at gray level b. The formula for calculating the gray level frequency is as follows:

[0079]

[0080] Where, β b′ Represents the frequency of gray level b′, c b′ This represents the number of pixels at gray level b′, where b′ = 1, 2, 3, ..., b;

[0081] Calculate the frequency of all gray levels in the original boot screen logo image, plot a gray level histogram of the original boot screen logo image, and perform histogram equalization to obtain the enhanced boot screen logo image. The calculation formula is as follows:

[0082]

[0083] in, This indicates histogram equalization of gray levels;

[0084] S12. The enhanced boot screen logo image is processed using an improved mean filtering algorithm to obtain the processed boot screen logo image. The specific steps are as follows:

[0085] S121. Convert the enhanced boot screen logo image into an enhanced boot screen logo image matrix, and establish a two-dimensional coordinate system to obtain pixel coordinates; set the search box size to α1×α1, the search box contains several sub-search boxes, the sub-search boxes are α2×α2, select any sub-search box in the enhanced boot screen logo image matrix, denoted as the first sub-search box and the second sub-search box, calculate the distance from the center pixel of the first sub-search box to the center pixel of the second sub-search box, the calculation formula is as follows:

[0086]

[0087] Where d1 represents the distance from the center pixel of the first sub-search box to the center pixel of the second sub-search box, b″(x1,y1) represents the coordinates of the center pixel of the first sub-search box, and b″(x2,y2) represents the coordinates of the center pixel of the second sub-search box.

[0088] S122. Let δ1 represent the filtering coefficient and δ2 represent the normalization coefficient. The similarity coefficient is obtained based on the distance between the center pixel of the first sub-search box and the center pixel of the second sub-search box. The calculation formula is as follows:

[0089]

[0090] Where χ represents the similarity coefficient;

[0091] The similarity coefficient is used to perform a weighted average of the pixels in the search box. The search box is then moved until all pixels in the enhanced boot screen logo image matrix have been weighted averaged. At this point, noise reduction is completed, and the processed boot screen logo image is obtained.

[0092] S2. Use the local binary pattern background modeling method to extract the texture features of the processed boot screen LOGO image to obtain the texture feature map of the processed boot screen LOGO image. Then perform feature extraction to obtain the initial boot screen LOGO image. After shadow determination and shadow removal, output the boot screen LOGO shadow image.

[0093] S2 includes the following steps:

[0094] S21. Apply the local binary pattern background modeling method to the processed boot screen logo image to extract local binary pattern texture features, thereby obtaining the texture feature map of the processed boot screen logo image. The specific steps are as follows:

[0095] S211. The processed boot screen logo image is converted into a processed boot screen logo image matrix, where the elements of the processed boot screen logo image matrix are pixels on the processed boot screen logo image. Any pixel is selected from the processed boot screen logo image matrix and designated as a feature pixel. The area centered on the feature pixel and with a radius of b″′ is designated as the annular neighborhood. The grayscale value of the feature pixel and the grayscale values ​​of the equally divided points of the annular neighborhood are obtained. The formula for calculating the local binary value of the feature pixel is as follows:

[0096]

[0097] Where B represents the local binary value of the feature pixel. e represents the number of equally divided points in the circular neighborhood. a′ Let e ​​represent the grayscale value of the a′-th annular neighborhood dividing point, and e represent the grayscale value of the feature pixel.

[0098] S212. Using the local binary values ​​of the feature pixels as feature thresholds, compare the gray values ​​of pixels in the annular neighborhood with the feature thresholds. When the gray value of a pixel in the annular neighborhood is greater than or equal to the feature threshold, set the corresponding pixel in the annular neighborhood to 1; when the gray value of a pixel in the annular neighborhood is less than the feature threshold, set the corresponding pixel in the annular neighborhood to 0, thus obtaining the processed annular neighborhood. Generate a sequence of the processed annular neighborhood in a clockwise direction, convert the sequence into a decimal number, and use the decimal number as the texture feature value of the feature pixels. Calculate the texture feature values ​​of all pixels in the processed boot screen LOGO image matrix to obtain the texture feature map of the processed boot screen LOGO image.

[0099] S22. Set the grayscale threshold to ω, divide the grayscale values ​​of the pixels in the processed boot screen LOGO image matrix according to the grayscale threshold to obtain the first grayscale set and the second grayscale set, calculate the average value and inter-class variance of the first grayscale set and the second grayscale set, establish the inter-class variance equation, and continuously adjust the grayscale threshold to make the inter-class variance equation reach the maximum value to obtain the optimal grayscale threshold.

[0100] Pixels with grayscale values ​​greater than or equal to the optimal grayscale threshold in the processed boot screen logo image matrix are designated as foreground pixels, generating a boot screen logo foreground image. Pixels with grayscale values ​​less than the optimal grayscale threshold in the processed boot screen logo image matrix are designated as background pixels, generating a boot screen logo background image. Local binary pattern texture features of the boot screen logo background image are extracted to obtain a texture feature map of the boot screen logo background image. The texture feature map of the processed boot screen logo image and the texture feature map of the boot screen logo background image are compared and updated to obtain the final boot screen logo background image. Image extraction is performed on the final boot screen logo background image and the processed boot screen logo image to obtain an initial boot screen logo image.

[0101] S23. Perform shadow detection and shadow removal on the initial boot logo image to obtain a boot logo shadow image. The specific steps are as follows:

[0102] S231. Convert the initial boot logo image into an initial boot logo image matrix, calculate the gradient value and gradient direction of all pixels in the initial boot logo image matrix, select the pixel corresponding to the maximum gradient value, perform threshold division on the initial boot logo image matrix, generate a preprocessed boot logo image matrix, find the boot logo image outline in the preprocessed boot logo image matrix, and mark the rightmost pixel of the boot logo image outline as the shadow determination pixel.

[0103] S232. Traverse all pixels to the right of the shadow detection pixel. When the gray value of a pixel is 0, record the corresponding pixel as a shadow pixel and set the gray value of the shadow pixel to 255. Otherwise, the corresponding pixel is not a shadow pixel. Complete the shadow removal and output the boot logo shadow image.

[0104] S3. Based on Bayesian estimation and K-nearest neighbor matting algorithm, the image is matted. After determining the probability that the pixels in the boot logo shadow image belong to the foreground using Bayesian estimation, the images are classified to obtain three-dimensional images of the boot logo. Then, the boot logo image is extracted from the three-dimensional images of the boot logo using the K-nearest neighbor matting algorithm.

[0105] S3 includes the following steps:

[0106] S31. Convert the boot logo shadow image into a boot logo shadow image matrix. Select any pixel in the boot logo shadow image matrix and denote it as a Bayesian estimated pixel. Set the probability that the Bayesian estimated pixel belongs to the foreground as e1, the probability that the Bayesian estimated pixel belongs to the background as e2, the probability that all pixels in the boot logo shadow image matrix belong to the foreground as e3, and the probability that all pixels in the boot logo shadow image matrix belong to the background as e4. The formula for calculating the foreground probability is as follows:

[0107]

[0108] Where φ represents the probability that a pixel belongs to the foreground as estimated by Bayes;

[0109] S32. Set the foreground threshold to ξ. When the probability of a Bayesian estimated pixel belonging to the foreground is less than the foreground threshold, the Bayesian estimated pixel is a background pixel. When the probability of a Bayesian estimated pixel belonging to the foreground is greater than 1-ξ, the Bayesian estimated pixel is a foreground pixel. Otherwise, the Bayesian estimated pixel is an unknown pixel, and the gray value of the unknown pixel is set to 0.5. This process continues until all pixels in the boot logo shadow image matrix are classified, generating a three-part image of the boot logo.

[0110] S33. Use the K-nearest neighbor matting algorithm to extract the boot logo image from the three-part boot logo image. The specific steps are as follows:

[0111] S331. Convert the boot logo three-dimensional image into a boot logo three-dimensional image matrix. Select pixel g in the boot logo three-dimensional image matrix and set the two-dimensional coordinates of pixel g in the boot logo three-dimensional image matrix as (x...). g ,y g Let the brightness of pixel g be h′, the saturation of pixel g be h″, and the lightness of pixel g be h″′. Construct the feature vector C(g) = (cos(h′), sin(h′), h″, h″′, x g ,y g ); Pixel l is selected from the three-part image matrix of the boot logo, and the feature vector of pixel l is denoted as C(l). The kernel function is established using the feature vectors of pixel g and pixel l as follows:

[0112]

[0113] Where f(g,l) represents the kernel function. Indicates the weighting coefficients;

[0114] By controlling the weight coefficients, the kernel function is made to be greater than or equal to 0 and less than or equal to 1, and a Laplace matrix is ​​constructed based on the kernel function;

[0115] S332. Set the diagonal matrix D1, the positive semi-definite matrix D2, the constraint coefficient γ, and the opacity of the i-th layer of the boot logo tri-image as h. i If the binary vector is h, then the closed-form solution satisfies the following formula:

[0116]

[0117] Where n represents the number of layers, i = 1, 2, 3, ... n;

[0118] Assuming that the optimization function of the K-nearest neighbor matting algorithm has a closed-form solution, the optimal solution of the K-nearest neighbor matting algorithm is obtained by combining the closed-form solution and the Laplace matrix;

[0119] S333. Using the optimal solution of the K-nearest neighbor matting algorithm as the transparency threshold, perform layer filtering on the boot logo three-part image, retain the pixels whose gray values ​​are less than or equal to the transparency threshold, remove the pixels whose gray values ​​are greater than the transparency threshold, and output the boot logo image.

[0120] S4. Set a new boot logo image set, and replace the boot logo image with the new boot logo image in the new boot logo image set to achieve quick boot logo replacement;

[0121] S4 includes the following steps:

[0122] S41. Obtain a new set of boot logo images. Import the new set of boot logo images into the machine settings before the machine leaves the factory. When the machine is powered on, set a detection point on the boot logo image to quickly detect the boot logo image, delete the boot logo image, and return the coordinates of the detection point.

[0123] S42. Select the same detection point on the new boot logo image in the new boot logo image set to obtain a new detection point. By comparing the coordinates of the detection point and the new detection point, enlarge and reduce the new boot logo image according to the ratio, and replace it with the boot logo image to achieve fast boot logo replacement.

[0124] Example 2

[0125] This invention also discloses a system for a quick boot logo replacement method based on machine learning, specifically including: a preprocessing module for the original boot interface logo image, an image texture feature extraction module, an image matting module, and a quick boot logo replacement module;

[0126] The original boot screen LOGO image preprocessing module is used to perform image enhancement and improved mean filtering on the original boot screen LOGO image.

[0127] The image texture feature extraction module is used to extract the texture features of the boot screen LOGO image using the local binary pattern background modeling method;

[0128] The image matting module is used to perform image matting based on Bayesian estimation and the K-nearest neighbor matting algorithm.

[0129] The boot logo quick replacement module is used to replace the boot logo image with a new boot logo image.

[0130] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0131] The preferred embodiments of the invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention.

Claims

1. A method for quickly replacing the boot logo based on machine learning, characterized in that, Includes the following steps: S1. Obtain the original boot screen logo image, enhance the original boot screen logo image based on the histogram equalization method, and then perform noise reduction using an improved mean filtering algorithm to obtain the processed boot screen logo image. This includes the following steps: S11. Obtain the original boot screen LOGO image and calculate the gray level frequency in the original boot screen LOGO image; draw a gray level histogram based on the gray level frequency and perform histogram equalization processing on the original boot screen LOGO image to obtain the enhanced boot screen LOGO image. S12. The enhanced boot screen logo image is processed using an improved mean filtering algorithm to obtain the processed boot screen logo image, including the following steps: S121. Convert the enhanced boot screen logo image into an enhanced boot screen logo image matrix, and establish a two-dimensional coordinate system to obtain the pixel coordinates; set a search box, which contains several sub-search boxes, and calculate the distance between the center pixels of any two sub-search boxes. S122. Obtain the similarity coefficient based on the distance of the center pixel. Use the similarity coefficient to perform weighted average processing on the pixels in the search box. Then move the search box until all pixels in the enhanced boot screen LOGO image matrix have been weighted averaged. At this point, noise reduction is completed, and the processed boot screen LOGO image is obtained. S2. Extract the texture features of the processed boot screen logo image using the local binary pattern background modeling method to obtain the texture feature map of the processed boot screen logo image. Then, perform feature extraction to obtain the initial boot screen logo image. After shadow detection and shadow removal, output the boot screen logo shadow image. This includes the following steps: S21. Use the local binary pattern background modeling method on the processed boot screen LOGO image to extract the local binary pattern texture features and obtain the texture feature map of the processed boot screen LOGO image. S22, Set the grayscale threshold to The gray values ​​of the pixels in the processed boot screen logo image matrix are divided according to the gray value threshold to obtain the optimal gray value threshold. The gray values ​​of the pixels in the processed boot screen logo image matrix are compared with the optimal gray value threshold to extract the local binary pattern texture features of the boot screen logo background image and obtain the texture feature map of the boot screen logo background image. The texture feature map of the processed boot screen logo image is compared with the texture feature map of the boot screen logo background image, and the final boot screen logo background image is obtained after updating. The final boot screen logo background image and the processed boot screen logo image are extracted to obtain the initial boot screen logo image. S23. Perform shadow detection and shadow removal on the initial boot logo image to obtain the boot logo shadow image; S3. Based on Bayesian estimation and K-nearest neighbor matting algorithm, the image is matted. After classifying the probability that the pixels in the boot logo shadow image belong to the foreground using Bayesian estimation, the boot logo three-part image is obtained. Then, the boot logo image is extracted from the boot logo three-part image using K-nearest neighbor matting algorithm. S4. Set a new set of boot logo images, and replace the boot logo image with the new boot logo image from the new set to achieve quick boot logo replacement.

2. The method for rapid replacement of startup logo based on machine learning according to claim 1, characterized in that, S21 includes the following steps: S211. Convert the processed boot screen logo image into a processed boot screen logo image matrix. Select feature pixels on the processed boot screen logo image matrix, with the feature pixels as the center and a radius of... The range of the feature pixel is denoted as the annular neighborhood, and the local binary value of the feature pixel is calculated. S212. Using the local binary values ​​of the feature pixels as the feature threshold, compare the gray values ​​of the pixels in the annular neighborhood with the feature threshold, extract the local binary pattern texture features, and obtain the texture feature map of the processed boot screen LOGO image.

3. The method for rapid replacement of the boot logo based on machine learning according to claim 2, characterized in that, S23 includes the following steps: S231. Extract the edges of the initial boot logo image to obtain the outline of the boot logo image, and mark the rightmost pixel of the boot logo image outline as the shadow determination pixel. S232. Traverse all pixels to the right of the shadow detection pixel to determine the shadow, obtain the shadow pixel, remove the shadow pixel to complete the shadow removal, and output the boot logo shadow image.

4. The method for rapid replacement of the boot logo based on machine learning according to claim 3, characterized in that, S3 includes the following steps: S31. Bayesian estimation will be used to determine the probability that a pixel in the boot logo shadow image belongs to the foreground. S32, Set the foreground threshold as follows By comparing the probability of pixels belonging to the foreground in the boot logo shadow image with the foreground threshold, pixel classification is performed to obtain a three-part image of the boot logo. S33. Use the K-nearest neighbor matting algorithm to extract the boot logo image from the three-part boot logo image.

5. A method for rapid replacement of a boot logo based on machine learning according to claim 4, characterized in that, S4 includes the following steps: S41. Obtain a new set of boot logo images. Import the new set of boot logo images into the machine settings before the machine leaves the factory. When the machine is powered on, set a detection point on the boot logo image, quickly detect the boot logo image, delete the boot logo image, and return the coordinates of the detection point. S42. Select the same detection point on the new boot logo image in the new boot logo image set to obtain the new detection point. By comparing the coordinates of the detection point and the new detection point, enlarge and reduce the new boot logo image according to the ratio, and then replace it with the boot logo image to achieve fast boot logo replacement.

6. A system for implementing the machine learning-based rapid logo replacement method as described in any one of claims 1-5, characterized in that, Specifically, it includes: Original boot screen logo image preprocessing module, image texture feature extraction module, image cutout module, and boot logo quick replacement module; The original boot screen logo image preprocessing module is used to perform image enhancement and improved mean filtering on the original boot screen logo image. The image texture feature extraction module is used to extract the texture features of the boot screen logo image using the local binary pattern background modeling method; The image matting module is used for image matting based on Bayesian estimation and the K-nearest neighbor matting algorithm; The boot logo quick replacement module is used to replace the boot logo image with a new boot logo image.

Citation Information

Patent Citations

  • Image processing method and device and storage medium

    CN115700784A