Color spot non-contact measurement method, device, processor and storage medium
By using image acquisition equipment and a color patch recognition model, non-contact color patch detection was achieved, solving the problems of low detection efficiency and accuracy in existing technologies and providing a safe and efficient color patch detection solution.
Patent Information
- Application Number
- CN202111517868.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-12-09
AI Technical Summary
The lack of effective non-contact methods for detecting facial pigmentation in existing technologies results in low detection efficiency and accuracy.
The test image is acquired by an image acquisition device, the location and area of the color patch are determined by a color patch recognition model, and the color difference is calculated by a color difference measurement model to achieve non-contact color patch detection.
It achieves safe and efficient detection of color patches, and can quickly and accurately obtain data on the number, area and color difference of color patches, providing a fair and objective evaluation.
Smart Images

Figure CN114190894B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical cosmetic skin detection, and in particular to a non-contact color spot measurement method, device, processor and storage medium. Background Art
[0002] Facial pigmentation is a common skin disease with brown or black pigmentation and disfigurement on the face due to the increase of melanin in the skin. It is more common on the cheeks and forehead, and worsens after sun exposure. It is more common in women and is related to pregnancy and menstrual disorders caused by long-term oral contraceptives. It belongs to the black spots and liver spots in traditional Chinese medicine. Facial pigmentation includes freckles, black spots, chloasma and age spots, which are pigmentary disorder skin diseases. Freckles: Freckles are yellow-brown or dark brown pigment spots that are prone to occur on the face, neck and back of the hands. They often appear around the age of 6 and often increase with age. According to the introduction, pathological examination showed an increase in basal black granules, no increase in melanocytes, and a strong positive dopa reaction. This disease is autosomal dominant and its development is related to sun exposure. It is more common in exposed areas such as the face, neck, and back of the hands of adolescents. It is light brown or dark brown patches, mostly scattered and symmetrically distributed, with a genetic tendency. It worsens in spring and summer and becomes lighter in autumn and winter. Chloasma: Chloasma is a common pigmentation skin disease that occurs on the face in light brown or brown patches. This disease is equivalent to the "liver spots" in traditional Chinese medicine, also known as "black spots", which are more common in middle-aged women. It is an acquired localized hyperpigmentation disease, also known as butterfly spots, pregnancy spots, etc. These are the same disease, named according to different morphology, age group characteristics, etc.
[0003] In the prior art, professionals usually observe with the naked eye based on their experience, but no other effective method is provided for detecting color spots on the user's skin, resulting in low efficiency and accuracy in detecting color spots. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a non-contact measurement method, device, processor and storage medium for color spots.
[0005] In order to achieve the above object, the present invention provides a non-contact color spot measurement method in a first aspect, comprising:
[0006] Acquire the image to be tested through the image acquisition device;
[0007] Inputting the image to be tested into a color patch recognition model to determine the number of color patches in the image to be tested through the color patch recognition model;
[0008] For each color patch in the image to be tested, determine the left end starting pixel position, the right end pixel position and the maximum horizontal span of the color patch;
[0009] Determine the top starting pixel position, the bottom ending pixel position and the maximum vertical span of the color patch;
[0010] Determine the area of the region contour of each color patch according to the left end starting pixel position, the right end pixel position, the maximum horizontal span of the color patch, the top starting pixel position, the bottom end pixel position and the maximum vertical span of the color patch;
[0011] Determine the image space area of each color patch area contour according to the area contour of each color patch;
[0012] According to the spatial area of the regional contour image of each color patch, the actual area of the color patch is determined.
[0013] Optionally, the regional contour area of each color patch is determined based on the left end starting pixel position, the right end terminal pixel position, the horizontal maximum span, the top starting pixel position, the bottom end pixel position and the vertical maximum span of the color patch, including the area covered by the rectangular frame constructed with the horizontal maximum span and the vertical maximum span as the regional contour area of the measured patch.
[0014] Optionally, determining the image space area of each color patch area contour according to the area contour area of each color patch includes: multiplying the area contour area of each color patch by the percentage of the actual area of the patch texture within the contour area and then multiplying by the area of each pixel unit to obtain the image space area of each color patch area contour.
[0015] Optionally, the method also includes: converting the image of the regional contour area into a black and white binary bitmap in which the actual area of the plaque texture is black and the rest of the area is white, and taking the percentage of black pixels in the total number of black and white pixels as the effective proportion; determining the effective proportion as the percentage of the actual area of the plaque texture within the contour area.
[0016] Optionally, determining the actual area of the color patch according to the image space area of the regional outline of each color patch includes: multiplying the image space area of the regional outline of each color patch by the effective proportion to determine the actual image space area of the color patch; and multiplying the actual image space area of each color patch by the square of the imaging ratio of the lens module to determine the actual area of each color patch.
[0017] Optionally, the method also includes: if the contour areas of two or more patches overlap during the measurement process, it is necessary to filter out the number of black pixels generated by adjacent patches enclosed in the contours of adjacent overlapping areas that are not associated with the main patch that generates the maximum horizontal and vertical spans when performing black and white binary bitmap conversion, so as to distinguish whether the adjacent patches are connected to the main patch currently being measured.
[0018] Optionally, the method further comprises:
[0019] Determine the color difference of each color patch;
[0020] For any pigment pixel contained in each patch, firstly, green filtering is performed on the pigment pixel to clear the green spectral component of the pigment pixel, and then blue filtering is performed on the pigment pixel to clear the blue spectral component of the pigment pixel, and finally the red spectral component R of each pigment pixel is determined;
[0021] Secondly, the pigment pixels are filtered in red to clear the red spectral component of the pigment pixels, and then the pigment pixels are filtered in blue to clear the blue spectral component of the pigment pixels, and finally the green spectral component G of each pigment pixel is determined;
[0022] Then, the pigment pixels are subjected to red filtering to clear the red spectral component of the pigment pixels, and then the pigment pixels are subjected to green filtering to clear the green spectral component of the pigment pixels, and finally the blue spectral component B of each pigment pixel is determined;
[0023] The color coordinates corresponding to each pixel included in each color patch are determined according to the red spectral component R, the green spectral component G and the blue spectral component B of each pigment pixel, and the color difference of each pigmentation block is determined by the Euclidean distance in the LAB color space.
[0024] A second aspect of the present invention provides a processor configured to execute the above-mentioned non-contact color spot measurement method.
[0025] A third aspect of the present invention provides a machine-readable storage medium having instructions stored thereon, which, when executed by a processor, configure the processor to execute the above-mentioned non-contact color spot measurement method.
[0026] The above-mentioned non-contact color spot measurement method obtains the image to be tested through an image acquisition device, inputs the image to be tested into the color spot block recognition model, and determines the number of color spots in the image to be tested through the color spot block recognition model. For each color spot in the image to be tested, the left end starting pixel, the right end pixel position and the maximum horizontal span of the color spot are determined, and the top starting pixel position, the bottom end pixel position and the maximum vertical span of the color spot are determined. According to the left end starting pixel position, the right end pixel position, the maximum horizontal span, the top starting pixel position, the bottom end pixel position and the maximum vertical span of the color spot, the area contour area of each color spot is determined according to the area contour area of each color spot, and the image space area of the area contour of each color spot is determined according to the image space area of the area contour of each color spot. For each color spot in the image to be tested, the color difference of each color spot is determined using the color difference measurement model. This method can achieve a safe, efficient and non-contact way to quickly, efficiently and accurately detect color spots, one of the skin surface defects, and obtain the detection data of color spots, which provides a nearly perfect solution. The intrinsically safe product provided can give a fair and objective evaluation of the color spot data.
[0027] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0029] Figure 1 The schematic diagram shows a flow chart of a non-contact color spot measurement method according to an embodiment of the present invention;
[0030] Figure 2 A schematic diagram schematically shows color differentiation according to an embodiment of the present invention;
[0031] Figure 3 A schematic diagram showing a color patch measurement of two pixels located in the same row according to an embodiment of the present invention is shown;
[0032] Figure 4 A schematic diagram showing a color patch measurement in which two pixels are located in different rows according to an embodiment of the present invention is shown;
[0033] Figure 5 A schematic diagram of measuring the area of a color patch according to an embodiment of the present invention is shown schematically;
[0034] Figure 6The internal structure of a computer device according to an embodiment of the present invention is schematically shown. DETAILED DESCRIPTION
[0035] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0036] Figure 1 The flowchart of the non-contact measurement method of color spots according to an embodiment of the present invention is schematically shown. Figure 1 As shown, in one embodiment of the present invention, a non-contact measurement method for color spots is provided, comprising the following steps:
[0037] Step 101: Acquire a picture to be tested through an image acquisition device.
[0038] Step 102: input the image to be tested into a color patch recognition model to determine the number of color patches in the image to be tested through the color patch recognition model.
[0039] Step 103: for each color patch in the image to be tested, determine the left end pixel position, the right end pixel position and the maximum horizontal span of the color patch.
[0040] Step 104, determining the top starting pixel position, the bottom ending pixel position and the maximum vertical span of the color patch.
[0041] Step 105, determining the area of the region contour of each color patch according to the left end starting pixel position, the right end pixel position, the horizontal maximum span, the top starting pixel position, the bottom end pixel position and the vertical maximum span of the color patch.
[0042] Step 106: determine the image space area of the area contour of each color patch according to the area contour of each color patch.
[0043] Step 107, determining the actual area of each color patch according to the area of the regional contour image of each color patch.
[0044] The processor can obtain the image to be tested through the image acquisition device, and the image to be tested can be a user's face image or a skin image of other body parts, etc. The image acquisition device refers to a device with an image acquisition function. For example, a camera, a camcorder, a scanner, and other devices with a camera function such as mobile phones and tablets. Among them, the image receiving sensor size of the optical lens module and the vertical and horizontal distribution of pixels, as well as the size of the pixel unit determine the technical indicators of the detection function characteristics of the lens. The image acquisition device in this solution has an optical lens module with an automatic focusing function. First, the focal length of the lens is automatically adjusted so that the object to be tested is perfectly imaged on the sensor plane of the receiving element, and the distance from the object to be tested to the lens (object distance) and the distance from the lens to the receiving plane (image distance) are accurately measured, and the imaging ratio of the lens is indirectly obtained as the technical basis for implementing this solution. An optical lens module system and operation control driving main control software, an image sensor, a touch-controlled human-machine interface display screen, a color patch image recognition algorithm (1), a screen pixel distance measurement algorithm (2), a screen target area measurement algorithm (3), a screen target quantity statistics algorithm (4), and a target color difference measurement algorithm (5) are used to construct a skin color patch non-contact testing system device, which is characterized by the connection between the various parts.
[0045] The key characteristic indicators of the objective data evaluation color patch test are: quantity, area and color difference with the standard. Therefore, after obtaining the image to be tested, the processor can input the image to be tested into the color patch recognition model to determine the number of color patches in the image to be tested through the color patch recognition model. Then, for each color patch in the image to be tested, the left end starting pixel position, the right end pixel position and the maximum horizontal span of the color patch are determined. The top starting pixel position, the bottom end pixel position and the maximum vertical span of the color patch can also be determined. Then, the area contour area of each color patch can be determined according to the left end starting pixel position, the right end pixel position, the maximum horizontal span, the top starting pixel position, the bottom end pixel position and the maximum vertical span of the color patch. Further, in one embodiment, the area covered by the rectangular frame constructed by the horizontal maximum span and the vertical maximum span can be used as the area contour area of the measured patch. Then, the image space area of the area contour of each color patch can be determined according to the area contour of each color patch, and the actual area of the color patch can be determined according to the image space area of the area contour of each color patch.
[0046] In one embodiment, determining the image space area of each color patch area contour according to the area contour area of each color patch includes: multiplying the area contour area of each color patch by the percentage of the actual area of the patch texture in the contour area and then multiplying by the area of each pixel unit to obtain the image space area of each color patch area contour. Specifically, the image of the area contour area can be converted into a black and white binary value with the actual area of the patch texture being black and the remaining area being white, and the percentage of the black pixels in the total number of black and white pixels is taken as the effective proportion. The effective proportion can be determined as the percentage of the actual area of the patch texture in the contour area.
[0047] Specifically, this method can be called the screen target area measurement algorithm. Screen target area measurement algorithm: For a piece of target area to be measured, first use a rectangular frame with a maximum span of not less than the horizontal and vertical lengths to surround the target area to be measured, record the horizontal and vertical pixel numbers and capture the image of the enclosed area, and convert the captured image into a bitmap (the bitmap mode only uses one of the two colors, black and white, to represent the pixels in the image. The image in the bitmap mode is also called a black and white image) and convert it into a black and white binary value. Statistically calculate the percentage of black and white pixels, where the percentage of black pixels represents the percentage of the target area in the entire picture, and then count the horizontal and vertical pixels of the regional image to convert the total area of the image space; finally, the actual area of the target to be measured is converted according to the total number of regional pixels, the area percentage and the lens imaging ratio.
[0048] Furthermore, if the contour areas of two or more patches overlap during the measurement process, it is necessary to filter out the number of black pixels generated by adjacent patches enclosed in the contours of adjacent overlapping areas that are not associated with the main patches that generate the maximum horizontal and vertical spans when performing black-and-white binary bitmap conversion, so as to distinguish whether the adjacent patches are connected to the main patch currently being measured.
[0049] In one embodiment, determining the actual area of the color patch according to the image space area of the regional outline of each color patch includes: multiplying the image space area of the regional outline of each color patch by the effective proportion to determine the actual image space area of the color patch; and multiplying the actual image space area of each color patch by the square of the imaging ratio of the lens module to determine the actual area of each color patch.
[0050] In one embodiment, the method also includes: determining the color difference of each color patch; for any pigment pixel contained in each patch, firstly performing green filtering on the pigment pixel to clear the green spectral component of the pigment pixel, and then performing blue filtering on the pigment pixel to clear the blue spectral component of the pigment pixel, and finally determining the red spectral component R of each pigment pixel; secondly performing red filtering on the pigment pixel to clear the red spectral component of the pigment pixel, and then performing blue filtering on the pigment pixel to clear the blue spectral component of the pigment pixel, and finally determining the green spectral component G of each pigment pixel; then performing red filtering on the pigment pixel to clear the red spectral component of the pigment pixel, and then performing green filtering on the pigment pixel to clear the green spectral component of the pigment pixel, and finally determining the blue spectral component B of each pigment pixel; determining the color coordinates corresponding to each pixel included in each color patch according to the red spectral component R, green spectral component G and blue spectral component B of each pigment pixel, and determining the color difference of each pigmentation block by the Euclidean distance in the LAB color space.
[0051] The target color difference measurement algorithm belongs to the color material subtractive method. Among them, the three primary colors of color light refer to red, green and blue, and the corresponding wavelengths are 700nm, 546.1nm, 435.8nm respectively, and the central wavelength of yellow light is 570nm. The three primary colors of the object to be measured can present various light colors when mixed in a certain proportion. According to the research results of Thomas Young and Helmholtz: these three primary colors are determined to be red, green and blue. Various color states in nature can be produced by mixing these three primary colors in different proportions and strengths. For the target color block to be measured, the red component is tested first. In one embodiment, for each color patch in the picture to be tested, the color difference of each color patch is determined using a color difference measurement model, including:
[0052] Step 1: for each color patch pixel contained in each color patch, perform green filtering on the color patch pixel to clear the green spectral component of the color patch pixel, and then perform blue filtering on the color patch pixel to clear the blue spectral component of the color patch pixel, and finally determine the red spectral component R of each color patch pixel;
[0053] Step 2: for each color patch pixel contained in each color patch, perform red filtering on the color patch pixel to clear the red spectral component of the color patch pixel, and then perform blue filtering on the color patch pixel to clear the blue spectral component of the color patch pixel, and finally determine the green spectral component G of each color patch pixel;
[0054] Step 3: For each color patch pixel contained in each color patch, perform red filtering on the color patch pixel to clear the red spectral component of the color patch pixel, and then perform green filtering on the color patch pixel to clear the green spectral component of the color patch pixel, and finally determine the blue spectral component of each color patch pixel. The LAB color space (as shown in the figure) is a three-dimensional space coordinate based on the human eye's perception of color, which can represent all colors that the human eye can perceive. L represents lightness, A represents the red-green difference, and B represents the blue-yellow difference.
[0055] The meaning of three basic coordinates:
[0056] 1. Lightness of the color (L*, L*=0 produces black and L*=100 indicates white);
[0057] 2. Position between red / magenta and green (negative a* values indicate green and positive values indicate magenta);
[0058] 3. Position between yellow and blue (negative b* values indicate blue and positive b* values indicate yellow).
[0059] CIELAB is a uniform color space, so-called uniformity means that when the value changes uniformly, the human sense also changes uniformly. Uniform changes in the L*a*b* model correspond to uniform changes in perceived color. Therefore, the relative perceived difference between any two colors in L*a*b* can be approximated by treating each color as a point in a three-dimensional space (with three components: L*, a*, b*) and calculating the Euclidean distance between them.
[0060] The Euclidean distance between two colors in L*a*b* space is ΔE (“Delta E”, ΔE*ab).
[0061]
[0062] Then, the color difference of each color patch can be determined according to the Euclidean distance.
[0063] In one embodiment, the method also includes: before inputting the test picture into the color plaque recognition model, training the color plaque recognition model with a preset number of facial image samples; when the prediction accuracy of the color plaque recognition model reaches a preset accuracy threshold, determining that the color plaque recognition model training is completed, wherein the preset number is greater than 10.
[0064] In order to improve the prediction accuracy of the model, the model can be trained in advance. Specifically, at least 10 facial color patch image specimens determined by humans are prepared in advance, the recognition features are measured and summarized, and then recognition tests are conducted to learn, improve and update. When the color patch recognition accuracy is gradually achieved to be no less than 90%, it can be determined that the model has completed training and can be put into practical use.
[0065] In a specific embodiment, Figure 2 The schematic diagram of color differentiation according to an embodiment of the present invention is schematically shown. Figure 3-5 The color patch diagram shown in the figure shows that the image acquisition device uses a 1 / 1.65-inch image sensor with an effective diagonal length of 9.72mm. Converted to a frame aspect ratio of 3 / 4, the actual size of the image sensor is 7.78x5.83mm, the pixel array is 3648 (H) × 2736 (V), and the pixel scale is 2.13um. The measurement data of the three color patches are: ① Color difference 1.2, area 4.9cm 2 ;② Color difference 2.7, area 3.6cm 2 ; ③ Color difference 3.4, area 2.5cm 2 .
[0066] The above-mentioned non-contact color spot measurement method obtains the image to be tested through an image acquisition device, inputs the image to be tested into the color spot block recognition model, and determines the number of color spots in the image to be tested through the color spot block recognition model. For each color spot in the image to be tested, the left end starting pixel, the right end pixel position and the maximum horizontal span of the color spot are determined, and the top starting pixel position, the bottom end pixel position and the maximum vertical span of the color spot are determined. According to the left end starting pixel position, the right end pixel position, the maximum horizontal span, the top starting pixel position, the bottom end pixel position and the maximum vertical span of the color spot, the area contour area of each color spot is determined according to the area contour area of each color spot, and the image space area of the area contour of each color spot is determined according to the image space area of the area contour of each color spot. For each color spot in the image to be tested, the color difference of each color spot is determined using the color difference measurement model. This method can achieve a safe, efficient and non-contact way to quickly, efficiently and accurately detect color spots, one of the skin surface defects, and obtain the detection data of color spots, which provides a nearly perfect solution. The intrinsically safe product provided can give a fair and objective evaluation of the color spot data.
[0067] An embodiment of the present invention provides a storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned non-contact color spot measurement method is implemented.
[0068] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the program executes the above-mentioned non-contact color spot measurement method when running.
[0069] In one embodiment, a color patch recognition device is provided, and the device includes the above-mentioned processor and storage medium.
[0070] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor A01, a network interface A02, a memory (not shown in the figure) and a database (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02 and a database (not shown in the figure). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The database of the computer device is used to store relevant data such as pictures to be tested. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program B02 is executed by the processor A01, a non-contact measurement method for color spots is implemented.
[0071] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0072] An embodiment of the present invention provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps of the above-mentioned non-contact color spot measurement method are implemented.
[0073] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing the steps of the non-contact measurement method for color spots.
[0074] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0075] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0076] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0077] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0078] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0079] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0080] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0081] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0082] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A non-contact measurement method for color spots, characterized in that: The method comprises: Acquire the image to be tested through the image acquisition device; Inputting the image to be tested into a color patch recognition model to determine the number of color patches in the image to be tested through the color patch recognition model; For each color patch in the image to be tested, determine the left end starting pixel position, the right end pixel position and the maximum horizontal span of the color patch; Determine the top starting pixel position, the bottom ending pixel position and the maximum vertical span of the color patch; Determine the area contour of each color patch according to the left end starting pixel position, the right end pixel position, the maximum horizontal span, the top starting pixel position, the bottom end pixel position and the maximum vertical span of the color patch; including: the area covered by the rectangular frame constructed by the horizontal maximum span and the vertical maximum span is the area contour of the measured patch; Determine the image space area of each color patch area contour according to the area contour of each color patch; According to the spatial area of the regional contour image of each color patch, the actual area of the color patch is determined; Determining the image space area of each color patch area contour according to the area contour of each color patch includes: The image space area of each color patch area outline is obtained by multiplying the area of each color patch area outline by the percentage of the actual area of the patch texture within the outline area and then multiplying it by the area of each pixel unit; The method further comprises: After converting the image of the area contour area into black and white binary, with the real area of the patch texture as black and the rest of the area as white, the percentage of black pixels to the total number of black and white pixels is taken as the effective percentage; The effective proportion is determined as the percentage of the actual area of the plaque texture within the contour area; Determining the actual area of each color patch according to the area of the regional contour image space of each color patch includes: The image space area of each color patch area outline is multiplied by the effective proportion to determine the actual image space area of the color patch; The actual area of each color patch is multiplied by the square of the imaging ratio of the lens module to determine the actual area of each color patch. Determine the color difference of each color patch; The color coordinates corresponding to each pixel included in each color patch are determined according to the red spectral component R, the green spectral component G and the blue spectral component B of each pigment pixel, and the color difference of each pigmentation block is determined by the Euclidean distance in the LAB color space.
2. The method according to claim 1, characterized in that: The method further comprises: If the contour areas of two or more patches overlap during the measurement process, it is necessary to filter out the number of black pixels generated by adjacent patches enclosed in the contours of adjacent overlapping areas that are not associated with the main patches that generate the maximum horizontal and vertical spans when converting the black-and-white binary bitmap, so as to distinguish whether the adjacent patches are connected to the main patch currently being measured.
3. The method according to claim 1, characterized in that The method further comprises: For any pigment pixel contained in each patch, firstly, green filtering is performed on the pigment pixel to clear the green spectral component of the pigment pixel, and then blue filtering is performed on the pigment pixel to clear the blue spectral component of the pigment pixel, and finally the red spectral component R of each pigment pixel is determined; Secondly, the pigment pixels are filtered in red to clear the red spectral component of the pigment pixels, and then the pigment pixels are filtered in blue to clear the blue spectral component of the pigment pixels, and finally the green spectral component G of each pigment pixel is determined; Then, the pigment pixels are subjected to red filtering to clear the red spectral components of the pigment pixels, and then the pigment pixels are subjected to green filtering to clear the green spectral components of the pigment pixels, and finally the blue spectral component B of each pigment pixel is determined.
4. A processor, characterized in that: The method is configured to perform the non-contact color spot measurement method according to any one of claims 1 to 3.
5. A non-contact color spot measurement device, characterized in that: Comprising a processor according to claim 4.
6. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor is configured to perform the non-contact color spot measurement method according to any one of claims 1 to 3.
