Startup LOGO rapid replacement method and system based on machine learning
By applying machine learning technology in the boot LOGO replacement system, including histogram equalization, mean filtering, local binary mode background modeling, Bayesian estimation and K nearest neighbor cutout algorithm, the problem of rigidity and time-consuming traditional replacement methods is solved, and the rapid and intelligent replacement of boot LOGO is realized, improving the user experience.
Patent Information
- Application Number
- CN202411933917.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-26
AI Technical Summary
The traditional startup LOGO replacement method is rigid and cannot be replaced intelligently. It does not use machine learning technology, which leads to a long replacement speed and system processing, which brings inconvenience to the user experience.
Using a machine learning-based method, the startup LOGO images are extracted and processed through histogram equalization, improved mean filtering algorithm, local binary mode background modeling, Bayesian estimation method and K nearest neighbor cutout algorithm to achieve rapid replacement.
It improves image processing speed, reduces repeated calculations, improves algorithm efficiency, realizes fast and intelligent replacement of startup LOGOs, and improves user experience.
Smart Images

Figure CN119850790A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image replacement, and in particular to a method and system for quickly replacing a startup LOGO based on machine learning. Background Art
[0002] In order to meet customers' needs for replacing the boot LOGO, we use the development shortcut operation method and perform simple settings in the factory setting mode. You can quickly export the boot LOGO and create a file of the same size based on the size and format of the original LOGO to replace other LOGOs without re-updating the main program, which can improve user interest.
[0003] The traditional method of replacing the boot LOGO uses pre-stored pictures stored in the system to perform random picture replacement when the machine is turned on. The replacement process is rigid and cannot be replaced intelligently along with the boot animation, and is not suitable for the video-based LOGO replacement method. At the same time, the traditional method of replacing the boot LOGO does not use high-tech technologies such as machine learning, and urgently needs to be improved in replacement speed and system processing time, which brings inconvenience to the user experience. Summary of the invention
[0004] In response to the problems in the related art, the present invention provides a method and system for quickly replacing the power-on LOGO based on machine learning to overcome the above-mentioned technical problems existing in the existing related art.
[0005] In order to solve the above technical problems, the present invention is achieved through the following technical solutions:
[0006] The present invention is a method for quickly replacing a startup LOGO based on machine learning, comprising the following steps:
[0007] S1, obtaining an original boot interface LOGO image, performing image enhancement on the original boot interface LOGO image based on a histogram equalization method, and then performing noise reduction using an improved mean filter algorithm to obtain a processed boot interface LOGO image;
[0008] S2, using a local binary pattern background modeling method to extract texture features of the processed boot interface LOGO image, obtaining a texture feature map of the processed boot interface LOGO image, and then performing feature extraction to obtain an initial boot interface LOGO image, and after shadow determination and shadow removal, outputting a boot interface LOGO shadow image;
[0009] S3, performing image cutout based on Bayesian estimation method and K nearest neighbor image cutout algorithm, using Bayesian estimation method to determine the probability that the pixel points in the boot LOGO shadow image belong to the foreground and then classifying them to obtain the boot LOGO three-dimensional image, and then using K nearest neighbor image cutout algorithm to extract the boot LOGO image from the boot LOGO three-dimensional image;
[0010] S4. Setting a new boot LOGO image set, and replacing the boot LOGO image with a new boot LOGO image in the new boot LOGO image set, so as to realize fast replacement of the boot LOGO.
[0011] The invention obtains the original boot interface LOGO image, performs image enhancement on the original boot interface LOGO image based on the histogram equalization method, and then uses the improved mean filtering algorithm to reduce noise to obtain a processed boot interface LOGO image; this method enhances the image contrast by stretching the pixels and changing the intensity distribution, and then performs filtering by calculating the weights of the directions that deviate from the coordinate points, which can effectively improve the image processing speed, reduce repeated calculations, and improve the efficiency of the algorithm; secondly, the local binary pattern background modeling method is used to extract texture features, and the boot interface LOGO image is converted into a texture feature map by setting a threshold, and then the image is compared to obtain the initial boot interface LOGO image, and then the shadow is performed Judgment and shadow removal; this method is mainly aimed at complex and shadow images, and improves the integrity of target image extraction under complex backgrounds. The texture feature has rotation invariance and strong resistance to noise, which is helpful to achieve target image extraction; the Bayesian estimation method is used to determine the probability that the pixel belongs to the foreground, and after classification, the K nearest neighbor cutout algorithm is used to extract the power-on LOGO image in the power-on LOGO three-part image; the Bayesian estimation method converts the image into a three-part image, reduces time consumption, and improves the cutout effect. The K nearest neighbor cutout algorithm can improve the cutout accuracy by constructing a kernel function, which is convenient for subsequent processing; finally, the power-on LOGO image is replaced with a new power-on LOGO image to achieve fast replacement of the power-on LOGO.
[0012] Preferably, the S1 comprises the following steps:
[0013] S11, obtaining an original boot interface LOGO image, selecting sample points in the original boot interface LOGO image, the sample points being pixels, and quantizing the sample points; setting the number of pixels in the original boot interface LOGO image to a, the number of gray levels to b, and obtaining a gray level set A={c 1 ,c 2 ,c 3 ,...,c b}, where c b Represents the number of pixels of gray level b, and the gray level frequency calculation formula is as follows:
[0014]
[0015] Among them, β b′ Indicates the frequency of gray level b′, c b′Represents the number of pixels of gray level b′, b′=1,2,3,...,b;
[0016] Calculate the frequency of all gray levels in the original boot interface LOGO image, draw a gray histogram of the original boot interface LOGO image, and perform histogram equalization processing to obtain the enhanced boot interface LOGO image. The calculation formula is as follows:
[0017]
[0018] in, Represents the histogram equalization gray level;
[0019] S12, performing an improved mean filter algorithm processing on the enhanced boot interface LOGO image to obtain a processed boot interface LOGO image, the specific steps are as follows:
[0020] S121, converting the enhanced boot interface LOGO image into an enhanced boot interface LOGO image matrix, and establishing a two-dimensional coordinate system to obtain pixel point coordinates; setting the search box size to α 1 ×α 1 , the search box contains several sub-search boxes, and the size of the sub-search box is α 2 ×α 2 , select any sub-search box in the enhanced boot interface LOGO image matrix, record it as the first sub-search box and the second sub-search box, calculate the distance from the central pixel point of the first sub-search box to the central pixel point of the second sub-search box, and the calculation formula is as follows:
[0021]
[0022] Among them, d 1 represents the distance from the center pixel of the first sub-search box to the center pixel of the second sub-search box, b″(x 1 ,y 1 ) represents the center pixel coordinates of the first sub-search box, b″(x 2 ,y 2 ) represents the central pixel coordinates of the second sub-search box;
[0023] S122, setting δ 1 represents the filter coefficient, δ 2 Represents the normalization coefficient. The similarity coefficient is obtained based on 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:
[0024]
[0025] Among them, χ represents the similarity coefficient;
[0026] The similarity coefficient is used to perform weighted averaging processing on the pixels in the search box, and then the search box is moved until the weighted averaging processing of all pixels in the enhanced startup interface LOGO image matrix is completed. At this time, noise reduction is completed to obtain a processed startup interface LOGO image.
[0027] The invention uses a histogram equalization method to perform image enhancement on the original boot interface LOGO image, and enhances the image contrast by stretching the pixels and changing the intensity distribution; then uses an improved mean filtering algorithm to reduce noise, and obtains a processed boot interface LOGO image. By calculating the weights of the directions that deviate from the coordinate points and performing filtering processing, the image processing speed can be effectively improved, repeated calculations can be reduced, and the algorithm efficiency can be improved.
[0028] Preferably, S2 comprises the following steps:
[0029] S21, using a local binary pattern background modeling method to extract local binary pattern texture features from the processed boot interface LOGO image to obtain a texture feature map of the processed boot interface LOGO image, the specific steps are as follows:
[0030] S211, converting the processed boot interface LOGO image into a processed boot interface LOGO image matrix, wherein the elements in the processed boot interface LOGO image matrix are the pixels on the processed boot interface LOGO image; selecting any pixel on the processed boot interface LOGO image matrix as a feature pixel, and recording a range with the feature pixel as the center and a radius of b″′ as a ring neighborhood, obtaining the grayscale value of the feature pixel and the grayscale value of the equally divided points in the ring neighborhood, and the local binary value calculation formula of the feature pixel is as follows:
[0031]
[0032] Among them, B represents the local binary value of the feature pixel, represents the number of equally divided points in the annular neighborhood, e a′ represents the gray value of the a′th equally divided point in the annular neighborhood, e represents the gray value of the feature pixel point,
[0033] S212, taking the local binary value of the feature pixel as the feature threshold, comparing the grayscale value of the pixel in the annular neighborhood with the feature threshold, when the grayscale value of the pixel in the annular neighborhood is greater than or equal to the feature threshold, setting the corresponding pixel in the annular neighborhood to 1; when the grayscale value of the pixel in the annular neighborhood is less than the feature threshold, setting the corresponding pixel in the annular neighborhood to 0, and obtaining a processed annular neighborhood; generating a sequence of the processed annular neighborhood in a clockwise direction, and converting the sequence into a decimal number, and taking the decimal number as the texture feature value of the feature pixel; calculating the texture feature values of all pixels on the processed boot interface LOGO image matrix, and obtaining a texture feature map of the processed boot interface LOGO image;
[0034] S22, setting the grayscale threshold to ω, dividing the grayscale values of the pixels in the processed boot interface LOGO image matrix according to the grayscale threshold to obtain a first grayscale set and a second grayscale set, calculating the average values and inter-class variances of the first grayscale set and the second grayscale set, establishing an inter-class variance equation, and continuously adjusting the grayscale threshold so that the inter-class variance equation obtains a maximum value to obtain an optimal grayscale threshold;
[0035] The pixel points corresponding to the grayscale values of the pixels in the processed startup interface LOGO image matrix that are greater than or equal to the optimal grayscale threshold are recorded as foreground pixels to generate a startup interface LOGO foreground image; the pixel points corresponding to the grayscale values of the pixels in the processed startup interface LOGO image matrix that are less than the optimal grayscale threshold are recorded as background pixels to generate a startup interface LOGO background image; the local binary pattern texture features of the startup interface LOGO background image are extracted to obtain a texture feature map of the startup interface LOGO background image; the texture feature map of the processed startup interface LOGO image is compared with the texture feature map of the startup interface LOGO background image to update the final startup interface LOGO background image; image extraction is performed on the final startup interface LOGO background image and the processed startup interface LOGO image to obtain an initial startup LOGO image;
[0036] S23, performing shadow determination and shadow removal on the initial startup LOGO image to obtain a startup LOGO shadow image, the specific steps are as follows:
[0037] S231, converting the initial startup LOGO image into an initial startup LOGO image matrix, calculating the gradient values and gradient directions of all pixels in the initial startup LOGO image matrix, selecting the pixel corresponding to the maximum gradient value, performing threshold division on the initial startup LOGO image matrix, generating a preprocessed startup LOGO image matrix, finding the startup LOGO image contour in the preprocessed startup LOGO image matrix, and marking the rightmost pixel of the startup LOGO image contour as a shadow determination pixel;
[0038] S232, traverse all the pixels on the right side of the shadow detection pixel, when the gray value of the 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 power-on LOGO shadow image.
[0039] The invention extracts texture features by using a local binary pattern background modeling method, and converts the boot interface LOGO image into a texture feature map by setting a threshold. The texture features are rotationally invariant and have strong resistance to noise. Image comparison is performed to obtain the initial boot LOGO image, and then shadow judgment and shadow removal are performed to improve the integrity of target image extraction under complex backgrounds, which helps to achieve target image extraction.
[0040] Preferably, S3 comprises the following steps:
[0041] S31, converting the boot LOGO shadow image into a boot LOGO shadow image matrix, selecting any pixel point in the boot LOGO shadow image matrix, recording it as a Bayesian estimated pixel point, and setting the probability that the Bayesian estimated pixel point belongs to the foreground as e 1 , Bayesian estimates the probability that a pixel belongs to the background is e 2 , the probability that all pixels in the boot LOGO shadow image matrix belong to the foreground is e 3 , the probability that all pixels in the boot LOGO shadow image matrix belong to the background is e 4 , then the formula for calculating the prospect probability is as follows:
[0042]
[0043] Among them, φ represents the probability that the Bayesian estimate pixel belongs to the foreground;
[0044] S32, setting the foreground threshold to ξ, when the probability that the Bayesian estimated pixel belongs to the foreground is less than the foreground threshold, the Bayesian estimated pixel is the background pixel, and when the probability that the Bayesian estimated pixel belongs to the foreground is greater than 1-ξ, the Bayesian estimated pixel is the foreground pixel; otherwise, the Bayesian estimated pixel is an unknown pixel, and the grayscale value of the unknown pixel is set to 0.5, until all the pixels in the power-on LOGO shadow image matrix are classified, and a three-dimensional image of the power-on LOGO is generated;
[0045] S33, using a K-nearest neighbor cutout algorithm to extract the boot LOGO image from the boot LOGO three-part image, the specific steps are as follows:
[0046] S331, converting the boot LOGO three-dimensional image into a boot LOGO three-dimensional image matrix, selecting a pixel point g in the boot LOGO three-dimensional image matrix, and setting the two-dimensional coordinates of the pixel point g in the boot LOGO three-dimensional image matrix to (x g ,y g ), the brightness of pixel g is h′, the saturation of pixel g is h″, the lightness of pixel g is h″′, and the feature vector of pixel g is constructed as C(g)=(cos(h′),sin(h′),h″,h″′,x g ,y g ); Select pixel point l in the three-dimensional image matrix of the power-on LOGO, and record the feature vector of pixel point l as C(l). Use the feature vector of pixel point g and the feature vector of pixel point l to establish the kernel function as follows:
[0047]
[0048] Among them, f(g,l) represents the kernel function, represents the weight coefficient;
[0049] By controlling the weight coefficient, the kernel function is made greater than or equal to 0 and less than or equal to 1, and a Laplacian matrix is constructed based on the kernel function;
[0050] S332, set the diagonal matrix D 1 , semi-positive definite matrix D 2 , the constraint coefficient is γ, and the opacity of the i-th layer of the three-dimensional image of the boot LOGO is h i , 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 cutout algorithm has a closed-form solution, combining the closed-form solution with the Laplace matrix to solve the optimization function of the K-nearest neighbor cutout algorithm, and obtaining the optimal solution of the K-nearest neighbor cutout algorithm;
[0054] S333. Use the optimal solution of the K nearest neighbor cutout algorithm as the transparency threshold, perform layer screening on the three-part image of the power-on LOGO, retain the pixels whose grayscale values are less than or equal to the transparency threshold, remove the pixels whose grayscale values are greater than the transparency threshold, and output the power-on LOGO image.
[0055] The invention uses the Bayesian estimation method to determine the probability that a pixel point belongs to the foreground, converts the image into a three-dimensional image, reduces time consumption, and improves the cutout effect; then uses the K nearest neighbor cutout algorithm to extract the power-on LOGO image from the three-dimensional image of the power-on LOGO. By constructing a kernel function and a closed-form solution, the cutout accuracy can be improved, which is convenient for subsequent processing.
[0056] Preferably, S4 comprises the following steps:
[0057] S41, obtaining a new startup LOGO image set, importing the new startup LOGO image set into the machine settings before the machine leaves the factory, and when the machine is turned on, setting a detection point on the startup LOGO image, quickly detecting the startup LOGO image, deleting the startup LOGO image, and feeding back the detection point coordinates;
[0058] S42, select the detection point at the same position on the new boot LOGO image in the new boot LOGO image set to obtain a new detection point, compare the coordinates of the detection point and the new detection point, enlarge or reduce the new boot LOGO image in proportion, and replace it with the boot LOGO image to achieve fast replacement of the boot LOGO.
[0059] The present invention also discloses a system for a method for quickly replacing a startup LOGO based on machine learning, which specifically comprises: an original startup interface LOGO image preprocessing module, an image texture feature extraction module, an image cutout module and a startup LOGO quick replacement module;
[0060] The original startup interface LOGO image preprocessing module is used to perform image enhancement and improved mean filtering on the original startup interface LOGO image;
[0061] The image texture feature extraction module is used to extract the texture features of the boot interface LOGO image using a local binary pattern background modeling method;
[0062] The image cutout module is used to cut out images based on the Bayesian estimation method and the K nearest neighbor cutout algorithm;
[0063] The startup LOGO quick replacement module is used to replace the startup LOGO image with a new startup LOGO image.
[0064] The present invention has the following beneficial effects:
[0065] 1. The invention uses a histogram equalization method to enhance the original boot interface LOGO image, stretches the pixels, and changes the intensity distribution to enhance the image contrast, thereby effectively improving the image processing speed.
[0066] 2. The invention obtains a processed boot interface LOGO image by using an improved mean filtering algorithm for noise reduction, and performs filtering processing by calculating the weight of the direction of deviation from the coordinate point, thereby reducing repeated calculations and improving algorithm efficiency.
[0067] 3. The invention extracts texture features by using a local binary pattern background modeling method. The texture features are rotationally invariant and have strong resistance to noise. Image comparison is then performed to obtain an initial startup LOGO image, thereby realizing shadow determination and shadow removal, improving the integrity of target image extraction under complex backgrounds, and facilitating target image extraction.
[0068] 4. The invention uses the Bayesian estimation method to determine the probability that a pixel point belongs to the foreground, converts the image into a three-dimensional image, reduces time consumption, and improves the cutout effect; then uses the K nearest neighbor cutout algorithm to extract the power-on LOGO image from the three-dimensional image of the power-on LOGO. By constructing a kernel function and a closed-form solution, the cutout accuracy can be improved, which is convenient for subsequent processing.
[0069] Of course, any product implementing the present invention does not necessarily need to achieve all of the above-mentioned advantages at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the technical solutions of the embodiments of the invention, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, they can also obtain drawings based on these drawings without paying creative work.
[0071] Figure 1 A schematic diagram of the process of quickly replacing a power-on LOGO by a power-on LOGO quick replacement system based on machine learning provided by the present invention. DETAILED DESCRIPTION
[0072] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0073] In the description of the present invention, it is necessary to understand that the terms "opening", "upper", "lower", "top", "middle", "inside" and the like indicating 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, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the invention.
[0074] Example 1
[0075] Please refer to Figure 1 The present invention is a method for quickly replacing a startup LOGO based on machine learning, comprising the following steps:
[0076] S1, obtaining an original boot interface LOGO image, performing image enhancement on the original boot interface LOGO image based on a histogram equalization method, and then performing noise reduction using an improved mean filter algorithm to obtain a processed boot interface LOGO image;
[0077] The S1 comprises the following steps:
[0078] S11, obtaining an original boot interface LOGO image, selecting sample points in the original boot interface LOGO image, the sample points being pixels, and quantizing the sample points; setting the number of pixels in the original boot interface LOGO image to a, the number of gray levels to b, and obtaining a gray level set A={c 1 ,c 2 ,c 3 ,...,c b}, where c b Represents the number of pixels of gray level b, and the gray level frequency calculation formula is as follows:
[0079]
[0080] Among them, β b′ Indicates the frequency of gray level b′, c b′ Represents the number of pixels of gray level b′, b′=1,2,3,...,b;
[0081] Calculate the frequency of all gray levels in the original boot interface LOGO image, draw a gray histogram of the original boot interface LOGO image, and perform histogram equalization processing to obtain the enhanced boot interface LOGO image. The calculation formula is as follows:
[0082]
[0083] in, Represents the histogram equalization gray level;
[0084] S12, performing an improved mean filter algorithm processing on the enhanced boot interface LOGO image to obtain a processed boot interface LOGO image, the specific steps are as follows:
[0085] S121, converting the enhanced boot interface LOGO image into an enhanced boot interface LOGO image matrix, and establishing a two-dimensional coordinate system to obtain pixel point coordinates; setting the search box size to α 1 ×α 1 , the search box contains several sub-search boxes, and the size of the sub-search box is α 2 ×α 2 , select any sub-search box in the enhanced boot interface LOGO image matrix, record it as the first sub-search box and the second sub-search box, calculate the distance from the central pixel point of the first sub-search box to the central pixel point of the second sub-search box, and the calculation formula is as follows:
[0086]
[0087] Among them, d 1 represents the distance from the center pixel of the first sub-search box to the center pixel of the second sub-search box, b″(x 1 ,y 1 ) represents the center pixel coordinates of the first sub-search box, b″(x 2 ,y 2 ) represents the central pixel coordinates of the second sub-search box;
[0088] S122, setting δ 1 represents the filter coefficient, δ 2 Represents the normalization coefficient. The similarity coefficient is obtained based on 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:
[0089]
[0090] Among them, χ represents the similarity coefficient;
[0091] Using the similarity coefficient, weighted averaging is performed on the pixels in the search box, and then the search box is moved until the weighted averaging of all pixels in the enhanced startup interface LOGO image matrix is completed, at which point noise reduction is completed to obtain a processed startup interface LOGO image;
[0092] S2, using a local binary pattern background modeling method to extract texture features of the processed boot interface LOGO image, obtaining a texture feature map of the processed boot interface LOGO image, and then performing feature extraction to obtain an initial boot interface LOGO image, and after shadow determination and shadow removal, outputting a boot interface LOGO shadow image;
[0093] The S2 comprises the following steps:
[0094] S21, using a local binary pattern background modeling method to extract local binary pattern texture features from the processed boot interface LOGO image to obtain a texture feature map of the processed boot interface LOGO image, the specific steps are as follows:
[0095] S211, converting the processed boot interface LOGO image into a processed boot interface LOGO image matrix, wherein the elements in the processed boot interface LOGO image matrix are the pixels on the processed boot interface LOGO image; selecting any pixel on the processed boot interface LOGO image matrix as a feature pixel, and recording a range with the feature pixel as the center and a radius of b″′ as a ring neighborhood, obtaining the grayscale value of the feature pixel and the grayscale value of the equally divided points in the ring neighborhood, and the local binary value calculation formula of the feature pixel is as follows:
[0096]
[0097] Among them, B represents the local binary value of the feature pixel, represents the number of equally divided points in the annular neighborhood, e a′ represents the gray value of the a′th equally divided point in the annular neighborhood, e represents the gray value of the feature pixel point,
[0098] S212, taking the local binary value of the feature pixel as the feature threshold, comparing the grayscale value of the pixel in the annular neighborhood with the feature threshold, when the grayscale value of the pixel in the annular neighborhood is greater than or equal to the feature threshold, setting the corresponding pixel in the annular neighborhood to 1; when the grayscale value of the pixel in the annular neighborhood is less than the feature threshold, setting the corresponding pixel in the annular neighborhood to 0, and obtaining a processed annular neighborhood; generating a sequence of the processed annular neighborhood in a clockwise direction, and converting the sequence into a decimal number, and taking the decimal number as the texture feature value of the feature pixel; calculating the texture feature values of all pixels on the processed boot interface LOGO image matrix, and obtaining a texture feature map of the processed boot interface LOGO image;
[0099] S22, setting the grayscale threshold to ω, dividing the grayscale values of the pixels in the processed boot interface LOGO image matrix according to the grayscale threshold to obtain a first grayscale set and a second grayscale set, calculating the average values and inter-class variances of the first grayscale set and the second grayscale set, establishing an inter-class variance equation, and continuously adjusting the grayscale threshold so that the inter-class variance equation obtains a maximum value to obtain an optimal grayscale threshold;
[0100] The pixel points corresponding to the grayscale values of the pixels in the processed startup interface LOGO image matrix that are greater than or equal to the optimal grayscale threshold are recorded as foreground pixels to generate a startup interface LOGO foreground image; the pixel points corresponding to the grayscale values of the pixels in the processed startup interface LOGO image matrix that are less than the optimal grayscale threshold are recorded as background pixels to generate a startup interface LOGO background image; the local binary pattern texture features of the startup interface LOGO background image are extracted to obtain a texture feature map of the startup interface LOGO background image; the texture feature map of the processed startup interface LOGO image is compared with the texture feature map of the startup interface LOGO background image to update the final startup interface LOGO background image; image extraction is performed on the final startup interface LOGO background image and the processed startup interface LOGO image to obtain an initial startup LOGO image;
[0101] S23, performing shadow determination and shadow removal on the initial startup LOGO image to obtain a startup LOGO shadow image, the specific steps are as follows:
[0102] S231, converting the initial startup LOGO image into an initial startup LOGO image matrix, calculating the gradient values and gradient directions of all pixels in the initial startup LOGO image matrix, selecting the pixel corresponding to the maximum gradient value, performing threshold division on the initial startup LOGO image matrix, generating a preprocessed startup LOGO image matrix, finding the startup LOGO image contour in the preprocessed startup LOGO image matrix, and marking the rightmost pixel of the startup LOGO image contour as a shadow determination pixel;
[0103] S232, traverse all the pixels on the right side of the shadow detection pixel, when the gray value of the 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, performing image cutout based on Bayesian estimation method and K nearest neighbor image cutout algorithm, using Bayesian estimation method to determine the probability that the pixel points in the boot LOGO shadow image belong to the foreground and then classifying them to obtain the boot LOGO three-dimensional image, and then using K nearest neighbor image cutout algorithm to extract the boot LOGO image from the boot LOGO three-dimensional image;
[0105] The S3 comprises the following steps:
[0106] S31, converting the boot LOGO shadow image into a boot LOGO shadow image matrix, selecting any pixel point in the boot LOGO shadow image matrix, recording it as a Bayesian estimated pixel point, and setting the probability that the Bayesian estimated pixel point belongs to the foreground as e 1 , Bayesian estimates the probability that a pixel belongs to the background is e 2 , the probability that all pixels in the boot LOGO shadow image matrix belong to the foreground is e 3 , the probability that all pixels in the boot LOGO shadow image matrix belong to the background is e 4 , then the formula for calculating the prospect probability is as follows:
[0107]
[0108] Among them, φ represents the probability that the Bayesian estimate pixel belongs to the foreground;
[0109] S32, setting the foreground threshold to ξ, when the probability that the Bayesian estimated pixel belongs to the foreground is less than the foreground threshold, the Bayesian estimated pixel is the background pixel, and when the probability that the Bayesian estimated pixel belongs to the foreground is greater than 1-ξ, the Bayesian estimated pixel is the foreground pixel; otherwise, the Bayesian estimated pixel is an unknown pixel, and the grayscale value of the unknown pixel is set to 0.5, until all the pixels in the power-on LOGO shadow image matrix are classified, and a three-dimensional image of the power-on LOGO is generated;
[0110] S33, using a K-nearest neighbor cutout algorithm to extract the boot LOGO image from the boot LOGO three-part image, the specific steps are as follows:
[0111] S331, converting the boot LOGO three-dimensional image into a boot LOGO three-dimensional image matrix, selecting a pixel point g in the boot LOGO three-dimensional image matrix, and setting the two-dimensional coordinates of the pixel point g in the boot LOGO three-dimensional image matrix to (x g ,y g ), the brightness of pixel g is h′, the saturation of pixel g is h″, the lightness of pixel g is h″′, and the feature vector of pixel g is constructed as C(g)=(cos(h′),sin(h′),h″,h″′,x g ,y g ); Select pixel point l in the three-dimensional image matrix of the power-on LOGO, and record the feature vector of pixel point l as C(l). Use the feature vector of pixel point g and the feature vector of pixel point l to establish the kernel function as follows:
[0112]
[0113] Among them, f(g,l) represents the kernel function, represents the weight coefficient;
[0114] By controlling the weight coefficient, the kernel function is made greater than or equal to 0 and less than or equal to 1, and a Laplacian matrix is constructed based on the kernel function;
[0115] S332, set the diagonal matrix D 1 , semi-positive definite matrix D 2 , the constraint coefficient is γ, and the opacity of the i-th layer of the three-dimensional image of the boot LOGO is h i , 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 cutout algorithm has a closed-form solution, combining the closed-form solution with the Laplace matrix to solve the optimization function of the K-nearest neighbor cutout algorithm, and obtaining the optimal solution of the K-nearest neighbor cutout algorithm;
[0119] S333, using the optimal solution of the K nearest neighbor cutout algorithm as a transparency threshold, performing layer screening on the three-part image of the power-on LOGO, retaining pixels whose grayscale values are less than or equal to the transparency threshold, removing pixels whose grayscale values are greater than the transparency threshold, and outputting the power-on LOGO image;
[0120] S4, setting a new boot LOGO image set, and replacing the boot LOGO image with a new boot LOGO image in the new boot LOGO image set, so as to realize fast replacement of the boot LOGO;
[0121] The S4 comprises the following steps:
[0122] S41, obtaining a new startup LOGO image set, importing the new startup LOGO image set into the machine settings before the machine leaves the factory, and when the machine is turned on, setting a detection point on the startup LOGO image, quickly detecting the startup LOGO image, deleting the startup LOGO image, and feeding back the detection point coordinates;
[0123] S42, select the detection point at the same position on the new boot LOGO image in the new boot LOGO image set to obtain a new detection point, compare the coordinates of the detection point and the new detection point, enlarge or reduce the new boot LOGO image in proportion, and replace it with the boot LOGO image to achieve fast replacement of the boot LOGO.
[0124] Example 2
[0125] The present invention also discloses a system for a method for quickly replacing a startup LOGO based on machine learning, which specifically comprises: an original startup interface LOGO image preprocessing module, an image texture feature extraction module, an image cutout module and a startup LOGO quick replacement module;
[0126] The original startup interface LOGO image preprocessing module is used to perform image enhancement and improved mean filtering on the original startup interface LOGO image;
[0127] The image texture feature extraction module is used to extract the texture features of the boot interface LOGO image using a local binary pattern background modeling method;
[0128] The image cutout module is used to cut out images based on the Bayesian estimation method and the K nearest neighbor cutout algorithm;
[0129] The startup LOGO quick replacement module is used to replace the startup LOGO image with a new startup LOGO image.
[0130] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0131] The preferred embodiments of the invention disclosed above are only used to help explain the invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the invention, so that those skilled in the art can understand and use the invention well.
Claims
1. A method for quickly replacing a startup LOGO based on machine learning, characterized in that: The steps include: S1, obtaining an original boot interface LOGO image, performing image enhancement on the original boot interface LOGO image based on a histogram equalization method, and then performing noise reduction using an improved mean filter algorithm to obtain a processed boot interface LOGO image; S2, using a local binary pattern background modeling method to extract texture features of the processed boot interface LOGO image, obtaining a texture feature map of the processed boot interface LOGO image, and then performing feature extraction to obtain an initial boot interface LOGO image, and after shadow determination and shadow removal, outputting a boot interface LOGO shadow image; S3, performing image cutout based on Bayesian estimation method and K nearest neighbor image cutout algorithm, using Bayesian estimation method to determine the probability that the pixel points in the boot LOGO shadow image belong to the foreground and then classifying them to obtain the boot LOGO three-dimensional image, and then using K nearest neighbor image cutout algorithm to extract the boot LOGO image from the boot LOGO three-dimensional image; S4. Setting a new boot LOGO image set, and replacing the boot LOGO image with a new boot LOGO image in the new boot LOGO image set, so as to realize fast replacement of the boot LOGO.
2. The method for quickly replacing a startup LOGO based on machine learning according to claim 1, characterized in that: The S1 comprises the following steps: S11, obtaining an original boot interface LOGO image, calculating the grayscale frequency in the original boot interface LOGO image; drawing a grayscale histogram according to the grayscale frequency, performing histogram equalization processing on the original boot interface LOGO image, and obtaining an enhanced boot interface LOGO image; S12, performing an improved mean filtering algorithm processing on the enhanced startup interface LOGO image to obtain a processed startup interface LOGO image.
3. The method for quickly replacing a startup LOGO based on machine learning according to claim 2, characterized in that: The S12 comprises the following steps: S121, converting the enhanced boot interface LOGO image into an enhanced boot interface LOGO image matrix, and establishing a two-dimensional coordinate system to obtain pixel coordinates; setting a search box, the search box includes a plurality of sub-search boxes, and calculating the distance between the central pixel points of any two sub-search boxes; S122. Obtain a similarity coefficient based on the distance of the central pixel point, use the similarity coefficient to perform weighted averaging processing on the pixels in the search box, and then move the search box until the weighted averaging processing of all pixels in the enhanced startup interface LOGO image matrix is completed. At this time, noise reduction is completed to obtain a processed startup interface LOGO image.
4. The method for quickly replacing a startup LOGO based on machine learning according to claim 3 is characterized in that: The S2 comprises the following steps: S21, using a local binary pattern background modeling method to extract local binary pattern texture features from the processed boot interface LOGO image to obtain a texture feature map of the processed boot interface LOGO image; S22, setting the grayscale threshold to ω, dividing the grayscale values of the pixels in the processed boot interface LOGO image matrix according to the grayscale threshold to obtain an optimal grayscale threshold; comparing the grayscale values of the pixels in the processed boot interface LOGO image matrix with the optimal grayscale threshold, extracting the local binary pattern texture features of the boot interface LOGO background image, and obtaining a texture feature map of the boot interface LOGO background image; Comparing the processed texture feature map of the boot interface LOGO image with the texture feature map of the boot interface LOGO background image, and updating them to obtain a final boot interface LOGO background image; Performing image extraction on the final startup interface LOGO background image and the processed startup interface LOGO image to obtain an initial startup LOGO image; S23, performing shadow determination and shadow removal on the initial startup LOGO image to obtain a startup LOGO shadow image.
5. The method for quickly replacing a startup LOGO based on machine learning according to claim 4 is characterized in that: The S21 comprises the following steps: S211, converting the processed boot interface LOGO image into a processed boot interface LOGO image matrix, selecting feature pixels on the processed boot interface LOGO image matrix, recording a range with the feature pixel as the center and a radius of b″′ as a circular neighborhood, and calculating the local binary value of the feature pixel; S212, taking the local binary value of the feature pixel as a feature threshold, comparing the grayscale value of the pixel in the annular neighborhood with the feature threshold, extracting the local binary pattern texture feature, and obtaining a texture feature map of the processed boot interface LOGO image.
6. The method for quickly replacing a startup LOGO based on machine learning according to claim 5, characterized in that: The S23 comprises the following steps: S231, extracting the edge of the initial startup LOGO image to obtain the startup LOGO image contour, and marking the rightmost pixel point of the startup LOGO image contour as a shadow determination pixel point; S232, traverse all the pixels on the right side of the shadow detection pixel to perform shadow determination, obtain shadow pixels, remove the shadow pixels, complete shadow removal, and output the power-on LOGO shadow image.
7. The method for quickly replacing a startup LOGO based on machine learning according to claim 6, characterized in that: The S3 comprises the following steps: S31, using the Bayesian estimation method to determine the probability that a pixel in the power-on LOGO shadow image belongs to the foreground; S32, setting the foreground threshold to ξ, and classifying the pixels in the power-on LOGO shadow image by comparing the probability that the pixels belong to the foreground with the foreground threshold to obtain a three-dimensional image of the power-on LOGO; S33: extracting the power-on LOGO image from the power-on LOGO three-part image using a K-nearest neighbor cutout algorithm.
8. The method for quickly replacing a startup LOGO based on machine learning according to claim 7, characterized in that: The S4 comprises the following steps: S41, obtaining a new startup LOGO image set, importing the new startup LOGO image set into the machine settings before the machine leaves the factory, and when the machine is turned on, setting a detection point on the startup LOGO image, quickly detecting the startup LOGO image, deleting the startup LOGO image, and feeding back the detection point coordinates; S42, select the detection point at the same position on the new boot LOGO image in the new boot LOGO image set to obtain a new detection point, compare the coordinates of the detection point and the new detection point, enlarge or reduce the new boot LOGO image in proportion, and replace it with the boot LOGO image to achieve fast replacement of the boot LOGO.
9. A system for implementing the method for quickly replacing a startup LOGO based on machine learning as described in any one of claims 1 to 8, characterized in that: Specifically include: Original boot interface LOGO image preprocessing module, image texture feature extraction module, image cutout module and boot LOGO quick replacement module; The original startup interface LOGO image preprocessing module is used to perform image enhancement and improved mean filtering on the original startup interface LOGO image; The image texture feature extraction module is used to extract the texture features of the boot interface LOGO image using a local binary pattern background modeling method; The image cutout module is used to cut out images based on the Bayesian estimation method and the K nearest neighbor cutout algorithm; The startup LOGO quick replacement module is used to replace the startup LOGO image with a new startup LOGO image.
Citation Information
Patent Citations
Video matting based on foreground-background constraint propagation
CN102388391A
Automatic matting algorithm and device
CN107452010A
High-precision simple interactive image matting method, storage device and terminal
CN107516319A
Method for quickly replacing screen parameters and PQ
CN112114854A
Image processing method and device and storage medium
CN115700784A