A method for detecting bottom-layer spots, electronic device and readable storage medium
By combining multiple image processing algorithms for the front face brown spot map and mapping it into the front face polarized light map, the problem of difficulty in distinguishing and handling similar facial defects in the prior art is solved, and the accurate detection of underlying spots and the accuracy of image processing is improved.
Patent Information
- Application Number
- CN202110903658.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-06
- Publication Date
- 2025-03-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to distinguish and deal with similar facial defects, such as spots, acne marks, scars, etc. during image processing, resulting in poor image presentation effect.
By obtaining the user's front face brown spot map and performing image processing, including a combination of Gaussian filtering algorithm, median fuzzy algorithm or adaptive binarization algorithm, the detection area is mapped into the front face polarized light map, and the underlying spot area is determined based on the target similarity.
Accurate detection of underlying spots is achieved, avoiding omissions, and improving the accuracy of image processing and image presentation effect.
Smart Images

Figure CN113609998B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method for detecting bottom-layer spots, an electronic device and a readable storage medium. Background Art
[0002] Image processing is a technique that uses computers to analyze images to achieve the desired results. It is also called image processing. Image processing generally refers to digital image processing. A digital image is a large two-dimensional array obtained by shooting with industrial cameras, video cameras, scanners and other equipment. The elements of the array are called pixels, and their values are called grayscale values.
[0003] In the prior art, when identifying some defects on the front of the face, such as spots, acne marks, scars, etc., it is impossible to distinguish similar defects, resulting in the inability to properly handle the defects during the image processing process, affecting the final image presentation effect. Summary of the invention
[0004] In order to solve the problems of the prior art, the frontal brown spot image is compared with the preset image to distinguish it from other facial features, avoid missing the detection of underlying spots, and improve the accuracy of underlying spot detection; the embodiment of the present invention provides a method for determining an APP label, an electronic device, and a readable storage medium. The technical solution is as follows:
[0005] In one aspect, a method for detecting bottom layer spots comprises the following steps:
[0006] S101, obtaining a frontal brown spot image of the user;
[0007] S103, performing image processing on the frontal brown spot image to obtain a target image and a detection area list A=(A1, A2, A3, ...Am) of the target image, where Ai refers to the i-th detection area, i=1...m, and m is the number of detection areas, wherein the image processing uses at least one or a combination of Gaussian filtering algorithm, median fuzzy algorithm or adaptive binarization algorithm;
[0008] S105, mapping Ai to the front face polarized light map, obtaining a mapping area list B=(B1, B2, B3, ..., Bm) of the front face polarized light map, where Bi refers to the mapping area corresponding to Ai;
[0009] S107 , traverse Ai and when the target similarity is less than a preset similarity threshold, determine Ai as a bottom spot area, wherein the target similarity refers to the similarity between Ai and Bi.
[0010] On the other hand, an electronic device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the bottom layer spot detection method as described in any of the above items.
[0011] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored in the computer-readable storage medium, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the bottom layer spot detection method as described in any one of the above items.
[0012] The present invention provides a method for detecting bottom-layer spots, an electronic device, and a readable storage medium, which have the following technical effects:
[0013] The present invention can obtain a frontal face brown spot image of a user, perform image processing on the frontal face brown spot image, and obtain a target image and a detection area list of the target image, wherein a plurality of preprocessing algorithms are used to map any detection area to a frontal face polarized light image, and obtain a mapping area list of the frontal face polarized light image; when traversing any detection area and the target similarity corresponding to the detection area is less than a preset similarity threshold, it is determined whether the detection area is an underlying spot area, and it can be distinguished from other facial features, thereby avoiding missing the detection of underlying spots and improving the accuracy of underlying spot detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0015] Figure 1 It is a flow chart of a method for detecting bottom-layer spots provided in the first embodiment of the present invention;
[0016] Figure 2 It is a schematic diagram of a process for determining Ai as a bottom spot area provided by the first embodiment of the present invention. DETAILED DESCRIPTION
[0017] 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 making creative work are within the scope of protection of the present invention.
[0018] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0019] Embodiment 1
[0020] like Figure 1 As shown, this embodiment 1 provides a method for detecting bottom layer spots, and the method includes the following steps:
[0021] S101, obtaining a frontal brown spot image of the user;
[0022] Specifically, the frontal brown spot image is generated by an underlying spot detector, and the underlying spot detector refers to a detection device used to generate an image corresponding to the underlying spots on the user's face.
[0023] S103. Perform image processing on the frontal brown spot image to obtain a target image and a detection area list A=(A1, A2, A3, ...Am) of the target image, where Ai refers to the i-th detection area, i=1...m, and m is the number of detection areas, wherein the image processing adopts one or more algorithm combinations.
[0024] In a specific embodiment, the image processing uses an adaptive binarization algorithm to obtain a determined target image:
[0025] Performing image grayscale processing on the original image to obtain a target grayscale image;
[0026] Traverse each pixel of the target grayscale image and compare the pixel of the target grayscale image with the corresponding threshold to obtain the target image, wherein,
[0027] When the pixel point of the target grayscale image is greater than the corresponding threshold value, the pixel point of the target grayscale image takes the value of 1;
[0028] When a pixel point of the target grayscale image is ≤ its corresponding threshold, the pixel point of the target grayscale image takes a value of 0.
[0029] Specifically, the threshold corresponding to the pixel point of the target grayscale image can be determined by using any adaptive threshold, which will not be described in detail here.
[0030] The above method can perform preprocessing through an adaptive binarization algorithm to remove noise in the image, facilitate comparison and distinction between the bottom-layer spot image and the preset image, and improve the accuracy of bottom-layer spot detection.
[0031] S105, mapping Ai to the front face polarized light map, obtaining a mapping area list B=(B1, B2, B3, ..., Bm) of the front face polarized light map, where Bi refers to the mapping area corresponding to Ai;
[0032] Specifically, the front face polarized light image is generated by a main detector, and the main detector includes a detection device for generating an image corresponding to facial features corresponding to the user's face, and the facial features include acne marks, eyebrows, scars and other features, that is, the front face polarized light image can reflect acne marks, spots, eyebrows, scars and other features.
[0033] S107 , traverse Ai and when the target similarity is less than a preset similarity threshold, determine Ai as a bottom spot area, wherein the target similarity refers to the similarity between Ai and Bi.
[0034] Specifically, the method further includes determining the target similarity by the following method:
[0035] Obtain an image feature vector (Ai1, Ai2, Ai3, ..., Ain) corresponding to Ai, wherein Aij refers to the feature value corresponding to the jth image feature, j = 1 ... n, n is the number of image features, and the image features corresponding to Aij include: one or more combinations of color features, shape features and texture features. Preferably, the image features corresponding to Aij include: color features, shape features and texture features;
[0036] Traverse the image feature vector corresponding to Ai to obtain the similarity vector F = (F1, F2, F3, ..., Fn), where Fj refers to the similarity value corresponding to Aij;
[0037] When Aij meets the preset characteristic conditions, Fj is set to 0;
[0038] When Aij does not meet the preset characteristic conditions, Fj is set to 1;
[0039] According to the weight vector W = (W1, W2, W3, ..., Wn) corresponding to F and F, the target similarity H is calculated, and H meets the following conditions:
[0040]
[0041] The preset feature condition refers to the image feature threshold corresponding to Aij.
[0042] Specifically, W1≥W2≥W3≥...≥Wn, and preferentially, W1=W2=W3=...=Wn.
[0043] In a specific embodiment, the image features are: color features, shape features and texture features;
[0044] like Figure 2 As shown, the method also includes the following method to determine Ai as the bottom spot area:
[0045] S201, when the image feature is a color feature, obtain the first pixel list Q=(Q1, Q2, Q3, ..., Qp) corresponding to Ai, and obtain the target variance T corresponding to Ai, where Qx refers to the RGB value corresponding to the x-th pixel, x=1...p, p is the number of pixels, and T meets the following conditions:
[0046] Among them, R refers to the RGB mean value corresponding to Bi, and Qx meets the following conditions:
[0047] Qx=Rx×Wr+Gx×Wg+Bx×Wb, where Rx refers to the intensity value of the red channel corresponding to the x-th pixel, Gx refers to the intensity value of the green channel corresponding to the x-th pixel, Bx refers to the intensity value of the blue channel corresponding to the x-th pixel, Wr refers to the weight corresponding to Rx, Wg refers to the weight corresponding to Gx, and Wb refers to the weight corresponding to Bx;
[0048] S203, traverse Q and set T and Qx to the first threshold value corresponding to each and the corresponding second threshold
[0049] S205, when or When , Ai is determined to be the non-bottom-layer spot area;
[0050] S207, when and When Ai is detected, other image features corresponding to Ai are judged to determine that Ai is the underlying spot area.
[0051] Specifically, Meet the following conditions:
[0052] Where D is the parameter of color feature.
[0053] Furthermore, S207 also includes the following steps:
[0054] When the image feature is a shape feature, the coordinates of the four vertices of Ai are (Xi1, Yi1), (Xi2, Yi1), (Xi1, Yi2) and (Xi2, Yi2) and the coordinates of the four vertices of Bi are and
[0055] According to the coordinates of the four vertices of Ai and the coordinates of the four vertices of Bi, the target area ratio S is obtained;
[0056] When S≤the preset area ratio threshold, Ai is determined to be a non-bottom-layer spot area;
[0057] When S>the preset area ratio threshold, other image features corresponding to Ai are judged to determine that Ai is the bottom spot area;
[0058] Specifically, S meets the following conditions:
[0059]
[0060] When the image feature is a texture feature, Ai corresponds to the second pixel point list C = (C1, C2, C3, ..., Cp), and Cx refers to the variance list corresponding to the x-th pixel point;
[0061] Traverse Cx = (Cx1, Cx2, Cx3) and when Cx1, Cx2 and Cx3 are ≤ the preset variance threshold respectively
[0062] Specifically, Cx1 meets the following conditions:
[0063] in, It refers to the mean intensity corresponding to the red channel in Ai;
[0064] Specifically, Cx2 meets the following conditions:
[0065] in, It refers to the mean intensity corresponding to the green channel in Ai;
[0066] Specifically, Cx1 meets the following conditions:
[0067] in, It refers to the mean intensity corresponding to the blue channel in Ai.
[0068] The above method can make judgments through three image features: color feature, shape feature and texture feature. The three effective image features can be distinguished from other facial features to avoid missing the detection of underlying spots and improve the accuracy of underlying spot detection.
[0069] Embodiment 2
[0070] Embodiment 2 provides a method for detecting bottom layer spots, the method comprising the following steps:
[0071] S101, obtaining a frontal brown spot image of the user;
[0072] Specifically, the frontal brown spot image is generated by an underlying spot detector, and the underlying spot detector refers to a detection device used to generate an image corresponding to the underlying spots on the user's face.
[0073] S103. Perform image processing on the frontal brown spot image to obtain a target image and a detection area list A=(A1, A2, A3, ...Am) of the target image, where Ai refers to the i-th detection area, i=1...m, and m is the number of detection areas, wherein the image processing adopts one or more algorithm combinations.
[0074] In a specific embodiment, when the image processing adopts the adaptive binarization algorithm and also adopts the Gaussian filtering algorithm or the median fuzzy algorithm, the priority of the Gaussian filtering algorithm or the median fuzzy algorithm is greater than the priority of the adaptive binarization algorithm;
[0075] Preferably, the image processing is preprocessed using a Gaussian filtering algorithm, and the specific implementation steps are:
[0076] Divide the frontal brown spot image into kxk target image templates, where k is an odd number;
[0077] Obtain a unit area list Z=(Z1, Z2, Z3, ..., Zkxk) corresponding to the frontal brown spot image, where Zt refers to the t-th unit area, t=1...kxk;
[0078] The center of the target image template is the coordinate origin, and the coordinates (xt, yt) corresponding to any Zt are obtained;
[0079] According to the coordinates (xt, yt), the element value corresponding to Zt is calculated, so that according to the element value corresponding to Zt and the corresponding standard deviation, the Gaussian template corresponding to the frontal brown spot image is obtained.
[0080] Obtaining a first image based on a Gaussian template corresponding to the frontal brown spot image;
[0081] Specifically, the first image refers to an image processed by a Gaussian algorithm, which can effectively and smoothly filter noise without affecting the acquisition or judgment of other features of the image.
[0082] Specifically, those skilled in the art can set the standard deviation corresponding to the Gaussian template according to actual needs to obtain a desired image according to the Gaussian template, which will not be described in detail here.
[0083] Furthermore, the image processing adopts an adaptive binarization algorithm for preprocessing, and the specific implementation steps are:
[0084] Performing image grayscale processing on the first image to obtain a target grayscale image;
[0085] Traverse each pixel of the target grayscale image and compare the pixel of the target grayscale image with the corresponding threshold to obtain the target image, wherein,
[0086] When the pixel point of the target grayscale image is greater than the corresponding threshold value, the pixel point of the target grayscale image takes the value of 1;
[0087] When a pixel point of the target grayscale image is ≤ its corresponding threshold, the pixel point of the target grayscale image takes a value of 0.
[0088] Specifically, the threshold corresponding to the pixel point of the target grayscale image can be determined by using any adaptive threshold, which will not be described in detail here.
[0089] The above method can perform preprocessing through an adaptive binarization algorithm to remove noise in the image, facilitate comparison and distinction between the bottom-layer spot image and the preset image, and improve the accuracy of bottom-layer spot detection.
[0090] S105, mapping Ai to the front face polarized light map, obtaining a mapping area list B=(B1, B2, B3, ..., Bm) of the front face polarized light map, where Bi refers to the mapping area corresponding to Ai;
[0091] Specifically, the front face polarized light image is generated by a main detector, and the main detector includes a detection device for generating an image corresponding to facial features corresponding to the user's face, and the facial features include acne marks, eyebrows, scars and other features, that is, the front face polarized light image can reflect acne marks, spots, eyebrows, scars and other features.
[0092] S107 , traverse Ai and when the target similarity is less than a preset similarity threshold, determine Ai as a bottom spot area, wherein the target similarity refers to the similarity between Ai and Bi.
[0093] Specifically, the method further includes determining the target similarity by the following method:
[0094] Obtain an image feature vector (Ai1, Ai2, Ai3, ..., Ain) corresponding to Ai, wherein Aij refers to the feature value corresponding to the jth image feature, j = 1 ... n, n is the number of image features, and the image features corresponding to Aij include: one or more combinations of color features, shape features and texture features. Preferably, the image features corresponding to Aij include: color features, shape features and texture features;
[0095] Traverse the image feature vector corresponding to Ai to obtain the similarity vector F = (F1, F2, F3, ..., Fn), where Fj refers to the similarity value corresponding to Aij;
[0096] When Aij meets the preset characteristic conditions, Fj is set to 0;
[0097] When Aij does not meet the preset characteristic conditions, Fj is set to 1;
[0098] According to the weight vector W = (W1, W2, W3, ..., Wn) corresponding to F and F, the target similarity H is calculated, and H meets the following conditions:
[0099]
[0100] The preset feature condition refers to the image feature threshold corresponding to Aij.
[0101] Specifically, W1≥W2≥W3≥...≥Wn, and preferentially, W1=W2=W3=...=Wn.
[0102] In a specific embodiment, the image features are: color features, shape features and texture features;
[0103] like Figure 2 As shown, the method also includes the following method to determine Ai as the bottom spot area:
[0104] S201, when the image feature is a color feature, obtain the first pixel list Q=(Q1, Q2, Q3, ..., Qp) corresponding to Ai, and obtain the target variance T corresponding to Ai, where Qx refers to the RGB value corresponding to the x-th pixel, x=1...p, p is the number of pixels, and T meets the following conditions:
[0105] Among them, R refers to the RGB mean value corresponding to Bi, and Qx meets the following conditions:
[0106] Qx=Rx×Wr+Gx×Wg+Bx×Wb, where Rx refers to the intensity value of the red channel corresponding to the x-th pixel, Gx refers to the intensity value of the green channel corresponding to the x-th pixel, Bx refers to the intensity value of the blue channel corresponding to the x-th pixel, Wr refers to the weight corresponding to Rx, Wg refers to the weight corresponding to Gx, and Wb refers to the weight corresponding to Bx;
[0107] S203, traverse Q and set T and Qx to the first threshold value corresponding to each and the corresponding second threshold
[0108] S205, when or When , Ai is determined to be the non-bottom-layer spot area;
[0109] S207, when and When Ai is detected, other image features corresponding to Ai are judged to determine that Ai is the underlying spot area.
[0110] Specifically, Meet the following conditions:
[0111] Where D is the parameter of color feature.
[0112] Furthermore, S207 also includes the following steps:
[0113] When the image feature is a shape feature, the coordinates of the four vertices of Ai are (Xi1, Yi1), (Xi2, Yi1), (Xi1, Yi2) and (Xi2, Yi2) and the coordinates of the four vertices of Bi are and
[0114] According to the coordinates of the four vertices of Ai and the coordinates of the four vertices of Bi, the target area ratio S is obtained;
[0115] When S≤the preset area ratio threshold, Ai is determined to be a non-bottom-layer spot area;
[0116] When S>the preset area ratio threshold, other image features corresponding to Ai are judged to determine that Ai is the bottom spot area;
[0117] Specifically, S meets the following conditions:
[0118]
[0119] When the image feature is a texture feature, Ai corresponds to the second pixel point list C = (C1, C2, C3, ..., Cp), and Cx refers to the variance list corresponding to the x-th pixel point;
[0120] Traverse Cx = (Cx1, Cx2, Cx3) and when Cx1, Cx2 and Cx3 are ≤ the preset variance threshold respectively
[0121] Specifically, Cx1 meets the following conditions:
[0122] in, It refers to the mean intensity corresponding to the red channel in Ai;
[0123] Specifically, Cx2 meets the following conditions:
[0124] in, It refers to the mean intensity corresponding to the green channel in Ai;
[0125] Specifically, Cx1 meets the following conditions:
[0126] in, It refers to the mean intensity corresponding to the blue channel in Ai.
[0127] The above method can make judgments through three image features: color feature, shape feature and texture feature. The three effective image features can be distinguished from other facial features to avoid missing the detection of underlying spots and improve the accuracy of underlying spot detection.
[0128] Embodiment 3
[0129] Embodiment 3 provides a method for detecting bottom layer spots, the method comprising the following steps:
[0130] S101, obtaining a frontal brown spot image of the user;
[0131] Specifically, the frontal brown spot image is generated by an underlying spot detector, and the underlying spot detector refers to a detection device used to generate an image corresponding to the underlying spots on the user's face.
[0132] S103. Perform image processing on the frontal brown spot image to obtain a target image and a detection area list A=(A1, A2, A3, ...Am) of the target image, where Ai refers to the i-th detection area, i=1...m, and m is the number of detection areas, wherein the image processing adopts one or more algorithm combinations.
[0133] In a specific embodiment, when the image processing adopts a Gaussian filtering algorithm, a median fuzzy algorithm and an adaptive binarization algorithm, the priority of the Gaussian filtering algorithm is greater than the priority of the median fuzzy algorithm and greater than the priority of the adaptive binarization algorithm.
[0134] Preferably, the image processing is preprocessed using a Gaussian filtering algorithm, and the specific implementation steps are:
[0135] Divide the frontal brown spot image into a first target image template of kxk, where k is an odd number;
[0136] Obtain a unit area list Z=(Z1, Z2, Z3, ..., Zkxk) corresponding to the frontal brown spot image, where Zt refers to the t-th unit area, t=1...kxk;
[0137] The center of the target image template is the coordinate origin, and the coordinates (xt, yt) corresponding to any Zt are obtained;
[0138] According to the coordinates (xt, yt), the element value corresponding to Zt is calculated, so that according to the element value corresponding to Zt and the corresponding standard deviation, the Gaussian template corresponding to the frontal brown spot image is obtained.
[0139] Obtaining a first image based on a Gaussian template corresponding to the frontal brown spot image;
[0140] Specifically, the first image refers to an image processed by a Gaussian algorithm, which can effectively and smoothly filter noise without affecting the acquisition or judgment of other features of the image.
[0141] Specifically, those skilled in the art can set the standard deviation corresponding to the Gaussian template according to actual needs to obtain a desired image according to the Gaussian template, which will not be described in detail here.
[0142] Furthermore, the image processing adopts the median fuzzy algorithm for preprocessing, and the specific implementation steps are:
[0143] Divide the first image into kxk second target image templates, where k is an odd number;
[0144] Based on the second target image template, the first image is subjected to median filtering to obtain a second image.
[0145] The above method can better process image scanning noise. At the same time, under certain conditions, median filtering can better protect the edge information of the image and avoid blurring of image details. In addition, using the same image template as Gaussian filtering can improve computational efficiency and ensure stability between the two processing methods.
[0146] Furthermore, the image processing adopts an adaptive binarization algorithm for preprocessing, and the specific implementation steps are:
[0147] Performing image grayscale processing on the second image to obtain a target grayscale image;
[0148] Traverse each pixel of the target grayscale image and compare the pixel of the target grayscale image with its corresponding threshold to obtain the target image, where
[0149] When the pixel point of the target grayscale image is greater than the corresponding threshold value, the pixel point of the target grayscale image takes the value of 1;
[0150] When a pixel point of the target grayscale image is ≤ its corresponding threshold, the pixel point of the target grayscale image takes a value of 0.
[0151] Specifically, the threshold corresponding to the pixel point of the target grayscale image can be determined by using any adaptive threshold, which will not be described in detail here.
[0152] The above method can perform preprocessing through an adaptive binarization algorithm to remove noise in the image, facilitate comparison and distinction between the bottom-layer spot image and the preset image, and improve the accuracy of bottom-layer spot detection.
[0153] S105, mapping Ai to the front face polarized light map, obtaining a mapping area list B=(B1, B2, B3, ..., Bm) of the front face polarized light map, where Bi refers to the mapping area corresponding to Ai;
[0154] Specifically, the front face polarized light image is generated by a main detector, and the main detector includes a detection device for generating an image corresponding to facial features corresponding to the user's face, and the facial features include acne marks, eyebrows, scars and other features, that is, the front face polarized light image can reflect acne marks, spots, eyebrows, scars and other features.
[0155] S107 , traverse Ai and when the target similarity is less than a preset similarity threshold, determine Ai as a bottom spot area, wherein the target similarity refers to the similarity between Ai and Bi.
[0156] Specifically, the method further includes determining the target similarity by the following method:
[0157] Obtain an image feature vector (Ai1, Ai2, Ai3, ..., Ain) corresponding to Ai, wherein Aij refers to the feature value corresponding to the jth image feature, j = 1 ... n, n is the number of image features, and the image features corresponding to Aij include: one or more combinations of color features, shape features and texture features. Preferably, the image features corresponding to Aij include: color features, shape features and texture features;
[0158] Traverse the image feature vector corresponding to Ai to obtain the similarity vector F = (F1, F2, F3, ..., Fn), where Fj refers to the similarity value corresponding to Aij;
[0159] When Aij meets the preset characteristic conditions, Fj is set to 0;
[0160] When Aij does not meet the preset characteristic conditions, Fj is set to 1;
[0161] According to the weight vector W = (W1, W2, W3, ..., Wn) corresponding to F and F, the target similarity H is calculated, and H meets the following conditions:
[0162]
[0163] The preset feature condition refers to the image feature threshold corresponding to Aij.
[0164] Specifically, W1≥W2≥W3≥...≥Wn, and preferentially, W1=W2=W3=...=Wn.
[0165] In a specific embodiment, the image features are: color features, shape features and texture features;
[0166] like Figure 2 As shown, the method also includes the following method to determine Ai as the bottom spot area:
[0167] S201, when the image feature is a color feature, obtain the first pixel list Q=(Q1, Q2, Q3, ..., Qp) corresponding to Ai, and obtain the target variance T corresponding to Ai, where Qx refers to the RGB value corresponding to the x-th pixel, x=1...p, p is the number of pixels, and T meets the following conditions:
[0168] Among them, R refers to the RGB mean value corresponding to Bi, and Qx meets the following conditions:
[0169] Qx=Rx×Wr+Gx×Wg+Bx×Wb, where Rx refers to the intensity value of the red channel corresponding to the x-th pixel, Gx refers to the intensity value of the green channel corresponding to the x-th pixel, Bx refers to the intensity value of the blue channel corresponding to the x-th pixel, Wr refers to the weight corresponding to Rx, Wg refers to the weight corresponding to Gx, and Wb refers to the weight corresponding to Bx;
[0170] S203, traverse Q and set T and Qx to the first threshold value corresponding to each and the corresponding second threshold
[0171] S205, when or When , Ai is determined to be the non-bottom-layer spot area;
[0172] S207, when and When Ai is detected, other image features corresponding to Ai are judged to determine that Ai is the underlying spot area.
[0173] Specifically, Meet the following conditions:
[0174] Where D is the parameter of color feature.
[0175] Furthermore, S207 also includes the following steps:
[0176] When the image feature is a shape feature, the coordinates of the four vertices of Ai are (Xi1, Yi1), (Xi2, Yi1), (Xi1, Yi2) and (Xi2, Yi2) and the coordinates of the four vertices of Bi are and
[0177] According to the coordinates of the four vertices of Ai and the coordinates of the four vertices of Bi, the target area ratio S is obtained;
[0178] When S≤the preset area ratio threshold, Ai is determined to be a non-bottom-layer spot area;
[0179] When S>the preset area ratio threshold, other image features corresponding to Ai are judged to determine that Ai is the bottom spot area;
[0180] Specifically, S meets the following conditions:
[0181]
[0182] When the image feature is a texture feature, Ai corresponds to the second pixel point list C = (C1, C2, C3, ..., Cp), and Cx refers to the variance list corresponding to the x-th pixel point;
[0183] Traverse Cx = (Cx1, Cx2, Cx3) and when Cx1, Cx2 and Cx3 are ≤ the preset variance threshold respectively
[0184] Specifically, Cx1 meets the following conditions:
[0185] in, It refers to the mean intensity corresponding to the red channel in Ai;
[0186] Specifically, Cx2 meets the following conditions:
[0187] in, It refers to the mean intensity corresponding to the green channel in Ai;
[0188] Specifically, Cx1 meets the following conditions:
[0189] in, It refers to the mean intensity corresponding to the blue channel in Ai.
[0190] The above method can make judgments through three image features: color feature, shape feature and texture feature. The three effective image features can be distinguished from other facial features to avoid missing the detection of underlying spots and improve the accuracy of underlying spot detection.
[0191] Embodiments 1 to 3 provide a method for detecting bottom-layer spots, all of which can obtain a front-face brown spot image of a user, perform image processing on the front-face brown spot image, and obtain a target image and a detection area list of the target image, wherein a plurality of preprocessing algorithms are used to map any detection area to a front-face polarized light image, and obtain a mapping area list of the front-face polarized light image; traverse any detection area and when the target similarity corresponding to the detection area is less than a preset similarity threshold, determine whether the detection area is a bottom-layer spot area, which can achieve distinction from other facial features, avoid missing the detection of bottom-layer spots, and improve the accuracy of bottom-layer spot detection;
[0192] Secondly, compared with Embodiment 2 and Embodiment 1, Embodiment 3 adopts a combination of multiple algorithms to avoid noise interference in the image, which affects the detection of the bottom layer spots and improves the accuracy of the bottom layer spot detection; at the same time, multiple algorithms are combined for preprocessing to improve the clarity of the image, which is beneficial to the image presentation effect.
[0193] An embodiment of the present invention also provides an electronic device, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the bottom layer spot detection method as described above.
[0194] The computer device of the embodiment of the present invention exists in various forms, including but not limited to:
[0195] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as tPhone), multimedia phones, functional phones, and low-end phones.
[0196] (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have mobile Internet access features. These terminals include: PDA, MtD and UMPC devices, such as tPad.
[0197] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as tPod), handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0198] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0199] (5) Other electronic devices with data interaction functions.
[0200] An embodiment of the present invention also provides a computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to a method for detecting bottom-layer spots in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement the method for detecting bottom-layer spots provided in the above-mentioned method embodiment.
[0201] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0202] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting bottom-layer spots, characterized in that: The method comprises the following steps: S101, obtaining a frontal brown spot image of the user; S103, performing image processing on the frontal brown spot image to obtain a target image and a detection area list A=(A1, A2, A3, ...Am) of the target image, where Ai refers to the i-th detection area, i=1...m, and m is the number of detection areas, wherein the image processing adopts one or more algorithm combinations; S105, mapping Ai to the front face polarized light map, obtaining a mapping area list B=(B1, B2, B3, ..., Bm) of the front face polarized light map, where Bi refers to the mapping area corresponding to Ai; S107, traversing Ai and when the target similarity is less than a preset similarity threshold, determining Ai as an underlying spot region, wherein the target similarity refers to the degree of similarity between the image feature corresponding to Ai and the image feature corresponding to Bi.
2. The method for detecting bottom-layer spots according to claim 1, characterized in that: The frontal brown spot image is generated by an underlying spot detector, which refers to a detection device used to generate an image corresponding to the underlying spots on the user's face.
3. The method for detecting bottom layer spots according to claim 1, characterized in that: The front face polarized light image is generated by a main detector, which includes a detection device that generates an image corresponding to facial features corresponding to the user's face, and the facial features include acne marks, eyebrows, scars and other features.
4. The method for detecting bottom-layer spots according to claim 1, characterized in that: The image processing adopts an adaptive binarization algorithm.
5. The method for detecting bottom-layer spots according to claim 1, characterized in that: When the image processing adopts the adaptive binarization algorithm and also adopts a Gaussian filtering algorithm or a median fuzzy algorithm, the priority of the Gaussian filtering algorithm or the median fuzzy algorithm is greater than the priority of the adaptive binarization algorithm.
6. The method for detecting bottom layer spots according to claim 1, characterized in that: When the image processing adopts a Gaussian filtering algorithm, a median fuzzy algorithm and an adaptive binarization algorithm, the priority of the Gaussian filtering algorithm is greater than the priority of the median fuzzy algorithm and greater than the priority of the adaptive binarization algorithm.
7. The method for detecting bottom layer spots according to claim 1, characterized in that: The method also includes determining the target similarity by: Obtain the image feature vector (Ai1, Ai2, Ai3, ..., Ain) corresponding to Ai, where Aij refers to the feature value corresponding to the jth image feature, j = 1 ... n, n is the number of image features, and the image features corresponding to Aij include: one or more combinations of color features, shape features and texture features; Traverse the image feature vector corresponding to Ai to obtain the similarity vector F = (F1, F2, F3, ..., Fn), where Fj refers to the similarity value corresponding to Aij; When Aij meets the corresponding preset characteristic conditions, Fj is set to 0; When Aij does not meet the corresponding preset characteristic conditions, Fj is set to 1; According to the weight vector W = (W1, W2, W3, ..., Wn) corresponding to F and F, the target similarity H is calculated, and H meets the following conditions: The preset feature condition refers to the image feature threshold corresponding to Aij.
8. The method for detecting bottom layer spots according to claim 7, characterized in that: W1≥W2≥W3≥……≥Wn.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the bottom layer spot detection method according to any one of claims 1 to 8.
10. A computer-readable storage medium, wherein at least one instruction or at least one program is stored in the computer-readable storage medium, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the bottom layer spot detection method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Score mapping method and device, face comparison method and device, equipment and storage medium
CN110276243A
Image processing method and device, electronic equipment and storage medium
CN112598591A