Disclosure of Invention
The application aims to provide a technical scheme for analyzing and processing skin information so as to help a user to know own skin.
In one aspect, the invention provides a method for analyzing and processing skin information, comprising the following steps:
acquiring a white light image of a skin area, performing image processing on the white light image to acquire skin color information, and comparing the skin color information with a preset standard to acquire a skin color score;
Acquiring an ultraviolet image of the skin region, and processing the ultraviolet image to acquire a pore score, a stain score and a blackhead score, wherein:
The step of obtaining a pore score comprises: sequentially performing BGR conversion, noise removal and binarization processing on the ultraviolet image to obtain pore information; comparing the pore information with a preset standard to obtain a pore score;
The step of obtaining a stain score comprises: sequentially performing HSV conversion, noise removal, color decomposition and binarization processing on the ultraviolet image based on specific color components after the color decomposition to obtain color spot information; comparing the color spot information with a preset standard to obtain a color spot score;
The step of obtaining blackhead scores comprises the following steps: sequentially performing HSV conversion, noise removal, color decomposition and binarization processing on the ultraviolet image based on specific color components after the color decomposition to obtain black head information; comparing the blackhead information with a preset standard to obtain blackhead scores;
and comparing the skin color score, the pore score, the color spot score and the blackhead score with preset standards according to a preset priority scheme so as to obtain a comprehensive score.
As a preferred embodiment of the present invention, the step of obtaining a pore score further includes: after the binarization processing, contraction and expansion processing of the image are performed, and the number of pores is identified.
As a preferred embodiment of the present invention, the step of obtaining the stain score further includes: after the binarization processing, contraction and expansion processing of the image are performed, and the number and area of the color spots are identified.
As a preferred embodiment of the present invention, the step of obtaining a blackhead score further includes: after the binarization processing, contraction and expansion processing of the image are performed, and the number of blackheads is identified.
As a preferred embodiment of the present invention, the step of obtaining a skin color score includes a step of obtaining a whitening score, wherein the step of obtaining the whitening score includes: taking the product of the total pixel number in the white light image and a preset parameter as a first parameter, taking the sum of the products of each pixel and the brightness thereof in the white light image as a second parameter, and calculating the whitening score according to the ratio of the second parameter to the first parameter.
As a preferred embodiment of the present invention, the step of obtaining a skin color score includes a step of obtaining a wrinkle score, wherein the step of obtaining a wrinkle score includes: and identifying the white light image, obtaining the number of the hillocks and the number of the furrows, and calculating the wrinkle score according to the number of the hillocks and the number of the furrows.
As a preferred embodiment of the present invention, the method for analyzing skin information further includes the step of obtaining a moisture score: collecting the moisture information of the skin area through a sensor, and comparing the moisture information with a preset standard to obtain a moisture score; the step of obtaining the comprehensive score comprises the following steps: and comparing the moisture score, the skin color score, the pore score, the mottle score and the blackhead score with preset standards according to a preset priority scheme to obtain a comprehensive score.
In a preferred embodiment of the present invention, in the step of obtaining the composite score, a skin color score or a stain score is used as the first priority.
On the other hand, the invention provides a device for analyzing and processing skin information, which comprises a shell, a main control unit, a storage unit, a light emitting unit, a camera unit and a scoring unit, wherein the main control unit, the storage unit, the light emitting unit, the camera unit and the scoring unit are arranged in the shell, and the main control unit is arranged in the shell:
the storage unit stores a preset standard and a preset priority scheme;
the light-emitting unit is used for emitting white light and ultraviolet light to the skin area;
the camera unit is used for acquiring a white light image and an ultraviolet image of the skin region;
the main control unit is used for performing image processing on the white light image to obtain skin color information, and processing the ultraviolet image to obtain pore information, color spot information and blackhead information; the processing for obtaining pore information comprises BGR conversion, noise removal and binarization processing of the ultraviolet image in sequence; the processing for obtaining the color spot information comprises HSV conversion, noise removal, color decomposition and binarization processing based on specific color components after the color decomposition on the ultraviolet image in sequence; the black head information acquisition process comprises HSV conversion, noise removal, color decomposition and binarization processing based on specific color components after the color decomposition of the ultraviolet image in sequence;
The scoring unit is used for comparing the skin color information with a preset standard to obtain a skin color score, comparing the pore information with the preset standard to obtain a pore score, comparing the color spot information with the preset standard to obtain a color spot score, and comparing the blackhead information with the preset standard to obtain a blackhead score; and comparing the skin color score, pore score, mottle score and blackhead score with preset standards according to a preset priority scheme to obtain a comprehensive score.
As a preferable scheme of the invention, the skin-care device further comprises a sensor which is connected with the main control unit and used for collecting the moisture information of the skin area, the scoring unit also compares the moisture information with a preset standard to obtain a moisture score, and comparing the moisture score, the skin color score, the pore score, the stain score and the blackhead score with preset standards according to a preset priority scheme to obtain a comprehensive score.
By implementing the invention, the user can know and judge the skin of the user more accurately so as to conveniently select proper skin care products and skin care schemes.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings.
Referring to fig. 1 and 2, a housing of a device 100 for analyzing skin information according to an embodiment of the present invention is formed by fastening half-shells 11, 13. The housing formed by the engagement of the half shells 11, 13 forms a hand-held portion 17 and a working head 19 at one end of the hand-held portion 17. A middle case 15 is provided in the hand-held portion 17, the middle case 15 being for mounting a main board 21, the main board 21 being provided with a chip 23 and a battery 25. Preferably, the battery 25 is a rechargeable battery.
Referring to fig. 1 to 3, the main board 21 and the chip 23 are formed with a main control unit 31, a storage unit 37 communicatively connected to the main control unit 31, and a scoring unit 61, divided from the perspective of the functional module; and one end of the working head 19 is also provided with a light-emitting unit 33, a sensor 53 and a camera unit 35, which are all in communication connection with the main control unit 31. Wherein:
the storage unit 37 stores a preset standard and a preset priority scheme;
the scoring unit 61 scores relevant parameters of the skin based on preset criteria, and comprehensively scores the skin based on a preset priority scheme;
the light emitting unit 33 is used for emitting white light and ultraviolet light to the skin region;
The image capturing unit 35 is configured to acquire a white light image and an ultraviolet image of a skin region;
the main control unit 31 is used for performing image processing on the white light image to obtain skin color information, and processing on the ultraviolet image to obtain pore information, color spot information and blackhead information; the processing for obtaining pore information comprises BGR conversion, noise removal and binarization processing of the ultraviolet image in sequence; the processing for obtaining the color spot information comprises HSV conversion, noise removal, color decomposition and binarization processing based on specific color components after the color decomposition on the ultraviolet image in sequence; the black head information acquisition process comprises HSV conversion, noise removal, color decomposition and binarization processing of ultraviolet images based on specific color components after the color decomposition;
The scoring unit 61 is configured to compare skin color information with a preset standard to obtain a skin color score, compare pore information with a preset standard to obtain a pore score, compare stain information with a preset standard to obtain a stain score, and compare blackhead information with a preset standard to obtain a blackhead score; and comparing the skin color score, the pore score, the mottle score and the blackhead score with preset standards according to a preset priority scheme so as to obtain a comprehensive score.
In use, a user holds the handpiece with his or her hand, and activates the device 100. The light emitting unit 33 emits white light to the skin region under the control of the main control unit 31, and then the image capturing unit 35 obtains a white light image of the skin region under the control of the main control unit 31; next, the light emitting unit 33 emits ultraviolet light to the skin region under the control of the main control unit 31, and then the image capturing unit 35 acquires an ultraviolet image of the skin region under the control of the main control unit 31. Next, the main control unit 31, the scoring unit 61, and the like of the apparatus 100 process the white light image and the ultraviolet image. Analysis of skin information the flow of the analysis process is described with reference to fig. 4:
In step S110, a white light image of a skin area is obtained, the white light image is subjected to image processing to obtain skin color information, and the skin color information is compared with a preset standard to obtain a skin color score;
in step S120, an ultraviolet image of the skin region is obtained, and the ultraviolet image is processed to obtain a pore score, a stain score and a blackhead score;
In step S130, the skin color score, pore score, mottle score, and blackhead score are compared with preset criteria according to a preset priority scheme to obtain a comprehensive score.
The execution sequence of the steps S110 and S120 may be changed.
Step S120 may be split into several steps, referring to fig. 5:
in step S121, an ultraviolet image of a skin region is acquired;
In step S123, BGR conversion, noise removal, and binarization processing are sequentially performed on the ultraviolet image to obtain pore information; comparing the pore information with preset standards to obtain pore scores; the BGR conversion is to convert the color space of an image into BGR (B is blue, G is green, and R is red). Noise removal, also called noise reduction, makes the signal-to-noise ratio of the image not lower than 38 to improve the accuracy of pore judgment. The binarization processing means that the color of the image is converted into only two colors of black and white so as to further improve the recognition accuracy;
In step S125, the ultraviolet image is sequentially subjected to HSV conversion, noise removal, color decomposition, and binarization processing based on the color-decomposed specific color component to obtain color stain information; comparing the color spot information with a preset standard to obtain a color spot score; the HSV transform refers to performing an HSV Value transform on each pixel of an image, where H refers to chromaticity (Hue), S refers to Saturation (Saturation), and V refers to brightness (Value). Noise removal is also called noise reduction processing, and the signal-to-noise ratio of the image is made not lower than 41 in the present embodiment to improve the accuracy of stain judgment. Color decomposition refers to decomposition of a color into its constituent colors, for example, into a blue component (B), a green component (G), and a red component (R), so that identification and processing can be performed under a certain color component. In this embodiment, image processing is performed subsequently using the green component. The binarization processing means that the colors of the image with the green component are converted into only two colors of black and white so as to further improve the accuracy of recognition;
In step S127, the ultraviolet image is sequentially subjected to HSV conversion, noise removal, color decomposition, and binarization processing based on the color-decomposed specific color component to obtain blackhead information; comparing the blackhead information with a preset standard to obtain blackhead scores; the HSV transform refers to performing an HSV Value transform on each pixel of an image, where H refers to chromaticity (Hue), S refers to Saturation (Saturation), and V refers to brightness (Value). Noise removal is also called noise reduction processing, and the signal-to-noise ratio of the image is made not lower than 41 in the present embodiment to improve the accuracy of stain judgment. Color decomposition refers to decomposition of a color into its constituent colors, for example, into a blue component (B), a green component (G), and a red component (R), so that identification and processing can be performed under a certain color component. In this embodiment, image processing is performed subsequently using the green component. The binarization processing means converting the color of the image of the green component into only two colors of black and white to further improve the accuracy of recognition.
It should be noted that the order of steps S123, S125 and S127 may be exchanged; in each step, the processing process of the ultraviolet image is in sequence.
In a preferred embodiment, in step S123, the step of obtaining a pore score further includes: after the binarization processing, contraction and expansion processing of the image are performed, and the number of pores is identified. After the image binarization process, the resulting black-and-white image may have many burrs and small spots, as shown in fig. 6 (6 a). Therefore, the present invention removes burrs and dots to leave desired contents after binarization processing of an image, which is performed first by shrinkage processing of the image, as shown in (6 b) of fig. 6. Then, the image is subjected to an expansion process to restore the remaining content to a desired size, and the result of the process is shown in fig. 6 (6 c). In this embodiment, the convolution kernel adopted in the contraction processing of the image is 30, and the convolution kernel adopted in the expansion processing of the image is 25. After binarization processing, shrinkage and expansion processing are carried out on the image, the true circularity of color blocks in the image is calculated, and pores are identified, wherein the area of the pores is 50-80 pixels and the true circularity is not lower than 0.30, so that the number of the pores can be automatically identified. Further, the number of pores falling into each size class can be classified according to the size of the area of the pores, the number of pores falling into each size class is multiplied by a corresponding coefficient, and then the correlation products are summed to be used as an important basis for pore scoring. The preset criterion for pore scoring may be a value summed according to the number of pores, or according to the correlation product described above.
In a preferred embodiment, in step S125, the step of obtaining the stain score further includes: the step of obtaining a stain score further comprises: after the binarization processing, contraction and expansion processing of the image are performed, and the number and area of the color spots are identified. After the image binarization process, the obtained black-and-white image may have many burrs and small points. Therefore, the present invention removes burrs and small points to leave desired contents, after binarization processing of an image, first contraction processing of the image. Then, the image is expanded, and the remaining content is restored to a desired size. In this embodiment, the convolution kernel adopted in the contraction processing of the image is 10, and the convolution kernel adopted in the expansion processing of the image is 10. After binarization, shrinkage and expansion processing are performed on the image, the true circularity of color blocks in the image is calculated, and the areas and the true circularities meet the preset conditions and are identified as color spots, for example, the areas are in the range of 1000-2000 pixels, the true circularities are not lower than 0.20 and not higher than 0.93, and therefore the number and the areas of the color spots can be automatically identified. Further, the total area ratio of the color spots can be used as an important basis for scoring the color spots. For example, the preset criteria for stain score may be based on the total area ratio of the stain.
In a preferred embodiment, in step S127, the step of obtaining a blackhead score further includes: after the binarization processing, contraction and expansion processing of the image are performed, and the number and area of the color spots are identified. After the image binarization process, the obtained black-and-white image may have many burrs and small points. Therefore, the present invention removes burrs and small points to leave desired contents, after binarization processing of an image, first contraction processing of the image. Then, the image is expanded, and the remaining content is restored to a desired size. In this embodiment, the convolution kernel adopted in the contraction processing of the image is 10, and the convolution kernel adopted in the expansion processing of the image is 7. After binarization processing, shrinkage and expansion processing are carried out on the image, the roundness of color blocks in the image is calculated, and the area, the roundness and the brightness meet preset conditions and are identified as blackheads, for example, the area is in the range of 80-1000 pixels, the roundness is not lower than 0.40 and not higher than 0.9, and the brightness is not higher than 140 and is identified as blackheads, so that the quantity of blackheads can be automatically identified. Further, the number of blackheads can be used as an important basis for blackhead scoring. For example, the preset criterion of blackhead scoring may be a division according to the number of blackheads. In this embodiment, the step of obtaining the skin color score includes a step of obtaining a whitening score and a step of obtaining a wrinkle score. The step of obtaining the whitening score comprises the following steps: taking the product of the total pixel number in the white light image and the preset parameter as a first parameter, taking the sum of the products of each pixel and the brightness thereof in the white light image as a second parameter, and calculating the whitening score according to the ratio of the second parameter to the first parameter. The step of obtaining a skin tone score comprises, wherein the step of obtaining a wrinkle score comprises: and identifying the white light image, obtaining the number of the hillocks and the number of the furrows, and calculating the wrinkle score according to the number of the hillocks and the number of the furrows.
In this embodiment, the method for analyzing skin information further includes a step of obtaining a moisture score: the sensor is used for collecting the moisture information of the skin area, and the moisture information is compared with a preset standard to obtain a moisture score. Referring to fig. 4, the step of obtaining the moisture score should precede step S130. Accordingly, in step S130, the step of obtaining the composite score includes: and comparing the moisture score, the skin color score, the pore score, the mottle score and the blackhead score with preset standards according to a preset priority scheme to obtain a comprehensive score.
In an alternative embodiment, the step of obtaining the composite score takes the skin color score or stain score as the first priority.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.