Method and device for color recognition of cupping mark images
The method for color recognition of cupping marks through image processing and contour mapping addresses the inaccuracy of conventional methods, enabling precise and automated cupping mark color analysis.
Patent Information
- Application Number
- JP2025519831
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-11-17
- Filing Date
- 2023-08-25
- Publication Date
- 2025-09-29
- Estimated Expiration
- 2043-08-25
AI Technical Summary
Conventional methods for determining the color of cupping marks in traditional Chinese medicine are inaccurate due to the inability to accurately reflect the color information of cupping mark images, leading to inconsistent diagnoses.
A method and apparatus for color recognition of cupping mark images that involves acquiring an image, converting it to a target color space, calculating color distribution information, and determining a color judgment result based on this information, utilizing techniques such as image segmentation and contour mapping to analyze the entire image area.
This approach allows for accurate and automatic color judgment of cupping marks, reducing human subjectivity and establishing a standardized classification, thereby improving diagnostic consistency and efficiency.
Smart Images

Figure 2025532381000001_ABST
Abstract
Description
[Technical Field]
[0001] This application claims priority to a Chinese patent application filed with the State Intellectual Property Office of the People's Republic of China on November 17, 2022, bearing application number 202211437597.7 and entitled "Method and apparatus for color recognition of cupping mark images," the entire contents of which are incorporated herein by reference.
[0002] The present invention relates to the technical field of image processing, and in particular to a method and apparatus for color recognition of cupping mark images. [Background technology]
[0003] Cupping marks are marks of various shapes and colors that appear on the skin surface at the suction and removal points after cupping. In cupping, a traditional Chinese physical therapy, doctors generally observe the color and shape characteristics of the cupping marks on different areas of the back after cupping to gain insight into the functional status of the organs and the health of the body. Therefore, accurately determining the color of cupping marks is particularly important.
[0004] The conventional method for determining the color of a cupping mark involves photographing the cupping mark to obtain a cupping mark image, extracting pixel values at multiple positions on the cupping mark image, and determining the color of the cupping mark based on the average value of these pixel values. The problem with this method is that the color information of the cupping mark image cannot be accurately reflected from the pixel values at multiple positions sparsely distributed in the cupping mark image, and therefore the accuracy of this method is low. Summary of the Invention [Problem to be solved by the invention]
[0005] In view of the above-mentioned deficiencies of the prior art, the present invention provides a method and apparatus for recognizing color of cupping mark images, so as to provide a solution for more accurately determining the color of cupping mark images. [Means for solving the problem]
[0006] A first aspect of the present application provides a method for color recognition of cupping mark images, comprising: acquiring a cupping mark image to be recognized; converting the cupping mark image to be recognized into a predetermined target color space; a step of calculating color distribution information of the cupping mark image to be recognized in the target color space, the color distribution information being used to indicate the number of pixels of different colors in the cupping mark image to be recognized; and determining a color judgment result for the cupping mark image to be recognized based on the color distribution information.
[0007] Preferably, the step of acquiring a cupping mark image to be recognized includes: obtaining an original cupping mark image taken with an imaging device; and performing image segmentation on the original cupping mark image to remove skin areas without cupping marks from the original cupping mark image, thereby obtaining a cupping mark image to be recognized.
[0008] Preferably, the step of collecting statistics of color distribution information of the cupping mark image to be recognized in the target color space includes: determining a contour coordinate system having coordinate axes corresponding to the color components of the target color space; For each point in the contour coordinate system, counting the number of pixels in the cupping mark image to be recognized whose color components match the coordinates of the point, and determining the height of the point based on the statistical results; and connecting points having the same height in the contour coordinate system with a curve to obtain a contour map showing color distribution information.
[0009] Preferably, before determining a contour coordinate system having coordinate axes corresponding to the color components of the target color space, for each color component of the target color space, dividing a range of values for that color component into a plurality of subintervals according to a predetermined step size for that color component, and determining an interval value for each of the subintervals; The method further includes a step of replacing, for each pixel of the cupping mark image to be recognized, the value of the pixel in each color component with the section value of the sub-section to which the pixel belongs.
[0010] Preferably, the step of determining a color judgment result of the cupping mark image to be recognized based on the color distribution information includes: calculating at least one height threshold based on the height of each point in the contour map; selecting a contour line from the contour map that corresponds to each of the height thresholds as a target contour line; The method includes a step of determining a color judgment result of the cupping mark image to be recognized based on a predetermined color judgment section to which the color component corresponding to each point on each of the target contour lines belongs, and each of the color judgment sections corresponds to one color.
[0011] A second aspect of the present application provides a color recognition device for cupping mark images, an acquisition unit for acquiring a cupping mark image to be recognized; a conversion unit for converting the cupping mark image to be recognized into a predetermined target color space; a statistical unit for calculating color distribution information of the cupping mark image to be recognized in the target color space, the color distribution information being used to indicate the number of pixels of different colors in the cupping mark image to be recognized; and a determination unit that determines a color determination result of the cupping mark image to be recognized based on the color distribution information.
[0012] Preferably, when acquiring the cupping mark image to be recognized, the acquisition unit specifically: The original cupping mark image was taken with an imaging device, Image segmentation is performed on the original cupping mark image to remove skin areas in the original cupping mark image that do not have cupping marks, thereby obtaining a cupping mark image to be recognized.
[0013] Preferably, when the statistical unit calculates the color distribution information of the cupping mark image to be recognized in the target color space, the statistical unit specifically: determining a contour coordinate system having coordinate axes corresponding to the color components of the target color space; For each point in the contour coordinate system, the number of pixels in the cupping mark image to be recognized whose color components match the coordinates of the point is calculated, and the height of the point is determined based on the statistical results; Points having the same height in the contour coordinate system are connected with a curve to obtain a contour map showing color distribution information.
[0014] Preferably, the statistics unit further comprises: for each color component of the target color space, dividing a range of values for the color component into a plurality of subintervals according to a predetermined step size for the color component, and determining an interval value for each of the subintervals; For each pixel of the cupping mark image to be recognized, the value of the pixel in each color component is replaced with the section value of the sub-section to which it belongs.
[0015] Preferably, when determining the color judgment result of the cupping mark image to be recognized based on the color distribution information, the determination unit specifically: calculating at least one height threshold based on the height of each point in the contour map; selecting a contour line from the contour map that corresponds to each of the height thresholds as a target contour line; The color judgment result of the cupping mark image to be recognized is determined based on a predetermined color judgment section to which the color component corresponding to each point on each target contour line belongs, and each of the color judgment sections corresponds to one color. [Effects of the Invention]
[0016] The present application provides a method and apparatus for color recognition of cupping mark images, the method including the steps of: acquiring a cupping mark image to be recognized; converting the cupping mark image to be recognized into a predetermined target color space; calculating color distribution information of the cupping mark image to be recognized in the target color space, the color distribution information being used to indicate the number of pixels of different colors in the cupping mark image to be recognized; and determining a color judgment result for the cupping mark image to be recognized based on the color distribution information. This solution automatically collects and analyzes color distribution information of the entire area of the cupping mark image to be recognized, and can obtain a color judgment result for the cupping mark image to be recognized based on the color distribution information, thereby realizing automatic judgment of cupping marks and cupping colors and improving the accuracy of the judgment result. [Brief explanation of the drawings]
[0017] In order to more clearly explain the embodiments of the present invention or the technical solutions of the prior art, the following briefly introduces drawings necessary for describing the embodiments or prior art. The drawings described below are only embodiments of the present invention, and those skilled in the art can obtain other drawings based on the provided drawings without exerting any effort that amounts to inventive step. [Figure 1] 1 is a flowchart of a method for color recognition of cupping mark images according to an embodiment of the present application. [Figure 2] FIG. 1 is a schematic diagram of an original cupping mark image divided according to an embodiment of the present application. [Figure 3] FIG. 2 is a schematic two-dimensional contour diagram reflecting the number of pixels having different combinations of chromaticity and saturation components according to an embodiment of the present application. [Figure 4] FIG. 2 is a schematic two-dimensional contour diagram reflecting the number of pixels having different chromaticity and lightness component combinations according to an embodiment of the present application. [Figure 5] FIG. 10 is a plan view of a three-dimensional contour map obtained by performing statistics when the target color space is the HSV color space according to an embodiment of the present application. [Figure 6]FIG. 10 is a perspective view of a three-dimensional contour map obtained by performing statistics when the target color space is an HSV color space according to an embodiment of the present application; [Figure 7] FIG. 10 is a side view of a three-dimensional contour map obtained by performing statistics when the target color space is an HSV color space, according to an embodiment of the present application. [Figure 8] 1 is a structural schematic diagram of a color recognition device for cupping mark images according to an embodiment of the present application; DETAILED DESCRIPTION OF THE INVENTION
[0018] The following clearly and completely describes the technical solutions of the embodiments of the present invention, combined with the drawings of the embodiments of the present invention, and the described embodiments are not all embodiments but only some embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without any inventive effort fall within the scope of protection of the present invention.
[0019] In order to easily understand the technical solution of the present application, some possible concepts related to the present application are first described.
[0020] Traditional Chinese cupping therapy, similar to so-called cupping (or can-pulling), is a traditional Chinese medicine diagnostic and treatment method that uses a specialized cupping instrument to stimulate designated reaction zones on the back by sucking and releasing, thereby providing insight into the functional status of organs and the overall health of the body. Currently, the application and research of cupping therapy primarily relies on human visual observation and personal experience, and the color and morphological characteristics of cupping marks are determined based on relevant traditional Chinese and Western medical theories. While there is a certain degree of consensus in traditional Chinese cupping therapy regarding the determination of cupping mark color and morphological characteristics, the classification and assessment criteria for cupping mark color and morphological characteristics are currently only vaguely defined, and no precise and standardized classification methods or criteria have been established. Therefore, doctors may make different diagnoses for the same cupping mark. This reliance on doctors' experience and lack of objective standards for determining the color and morphological characteristics of cupping marks limits the wider adoption and application of traditional Chinese cupping therapy. Some conventional methods for automatically recognizing the color of cupping marks using the image processing capabilities of a computer often have the problem that the judgment results are inaccurate and cannot reflect the color distribution situation of the entire cupping mark image, as described in the background art, for example.
[0021] HSV color space is a perceptual color model, where HSV is an acronym of three words: Hue, Saturation, and Value. The chromaticity component of HSV color space has obvious skin clustering properties, so it is widely applied in skin-related image segmentation, image retrieval, face detection, and other fields. HSV color space represents the color of a pixel as three components: Hue, Saturation, and Value.
[0022] Hue is measured in degrees, ranging from 0° to 360°, counting counterclockwise from red: red is 0°, yellow is 60°, green is 120°, cyan is 180°, blue is 240°, and magenta is 300°.
[0023] Saturation indicates the degree to which a color approaches a spectral color. The closer a color approaches a spectral color, the more saturated the color is. The saturation value ranges from 0% to 100%, and the higher the saturation value, the more saturated the color.
[0024] Value, also called luminance, indicates the degree of brightness of a color, and the value ranges from 0% to 100%, corresponding to black to spectrum color (the brightest color of the current hue).
[0025] Preferably, the hue range from 0° to 360° starts from red and ends at red. To quantify the continuity of the red hue, the present embodiment shifts the hue range corresponding to red in the HSV color space. Specifically, the hue shifting method may involve clockwise or counterclockwise rotation. The rotation angle may be determined according to the actual situation. The purpose is to adjust the hue range corresponding to red on both sides of 0° to a range with continuous values. For example, the hue shift may involve rotating the hue 20° clockwise, thereby adjusting the range from 0° to 20°, which originally represents red, to 340° to 360°, and correspondingly shifting the range from 340° to 360°, which originally represents red, to 320° to 340°, so that red can be represented in a continuous range from 320° to 360° in the adjusted HSV color space.
[0026] Like the HSV color space, the HSL color space has three components: hue, saturation, and lightness. The lightness component L differs from that of HSV; if the L component of HSL is 100, it indicates white, and if it is 0, it indicates black.
[0027] The Lab color space is a physiological color system that primarily describes human visual perception in a digital way. In the Lab color space, the color of a pixel is represented by three components: L, a, and b. L is the luminance, with a value range of [0, 100]; a is the green to red component, with a value range of [127, -128]; and b is the blue to yellow component, with a value range of [127, -128].
[0028] The YUV color space is a widely used color space in color television systems, which separates the luma information from the chroma information and employs different sampling rates for luma and chroma in the same frame of an image. In the YUV color model, the color of a pixel is represented by a luma component Y and chroma components U and V, which represent chroma, and the luma and chroma components are independent of each other.
[0029] Referring to FIG. 1, which is a flowchart of a method for color recognition of cupping mark images according to an embodiment of the present application, the method includes the following steps: S101: An image of a cupping mark to be recognized is obtained.
[0030] Preferably, the step of acquiring the cupping mark image to be recognized includes: obtaining an original cupping mark image taken with an imaging device; The method includes a step of performing image segmentation on the original cupping mark image, removing skin areas in the original cupping mark image that do not have cupping marks, and obtaining a cupping mark image to be recognized.
[0031] Referring to Figure 2, the original cupping mark image is an image obtained by using a dedicated cupping tool to cup a designated reaction zone on the back of a human body, and then photographing the area of the skin surface covered by the cup with an imaging device. Generally, due to the structure of the cup, there are skin areas without cupping marks (i.e., marks of multiple shapes and colors that appear after the cup is sucked in and removed) at the periphery and center of the original cupping mark image, as shown in Figure 2 (1). After obtaining the original cupping mark image, the skin areas without cupping marks in the original cupping mark image are removed by image segmentation to obtain an image of the skin area completely covered with cupping marks, as shown in Figure 2 (2), i.e., the cupping mark image to be recognized in step S101.
[0032] In some preferred embodiments, after dividing the image of the area covered by the cupping marks from the original cupping mark image, further image preprocessing may be performed on the divided image, and the preprocessed image may be determined as the cupping mark image to be recognized.
[0033] Image pre-processing may include adjusting the size of the image and white balancing the image.
[0034] By adjusting the image size, the efficiency of executing S102 and the subsequent steps can be improved, and by white balancing the image, the interference of background light on the pixel color in the cupping mark image to be recognized can be eliminated, thereby making the final color judgment result more accurate.
[0035] S102: The cupping mark image to be recognized is converted into a predetermined target color space.
[0036] In this embodiment, the target color space may be any one of the above-mentioned HSV color space, HSL color space, Lab color space and YUV color space.
[0037] For specific conversion methods, please refer to technical literature on these color spaces, and the description will not be repeated here.
[0038] S103: Statistical calculation is performed on color distribution information of the cupping mark image to be recognized in the target color space.
[0039] The color distribution information is used to indicate the number of pixels of different colors in the cupping mark image to be recognized.
[0040] The color distribution information may have different display forms, and preferably may be shown in the form of two-dimensional contour maps as shown in Figures 3 and 4, or three-dimensional contour maps as shown in Figures 5, 6 and 7.
[0041] 3 and 4 are two-dimensional contour maps representing color distribution information of the cupping mark image to be recognized when the target color space is the HSV color space according to an embodiment of the present application.
[0042] Figure 3 reflects the number of pixels with different combinations of chromaticity and saturation components, and the horizontal axis of Figure 3 indicates the chromaticity (Hue) component of the pixel in the cupping mark image to be recognized, and the vertical axis indicates the saturation component of the pixel in the cupping mark image to be recognized. The acquisition process of Figure 3 is as follows: First, in the coordinate system of Figure 3, a corresponding height can be assigned to each point in the coordinate system according to the following rules:
[0043] For each point, the number of pixels having chromaticity and saturation components at the coordinates of the point in the cupping mark image to be recognized is counted, and a corresponding height is assigned to the point based on the statistical results.The height may be equal to the total number of pixels having chromaticity and saturation components at the coordinates of the point in the cupping mark image to be recognized, or may be equal to the proportion of pixels having chromaticity and saturation components at the coordinates of the point in the cupping mark image to be recognized.
[0044] The following is a combined example: 3, the abscissa is 190 and the ordinate is 60, for the point (190, 60), and the number of pixels in the cupping mark image to be recognized whose chromaticity component is equal to 190 and whose saturation component is equal to 60 is counted. If the statistical result shows that there are 100 pixels whose chromaticity component is equal to 190 and whose saturation component is equal to 60, the height corresponding to the point (190, 60) is set to 100. Alternatively, if the statistical result shows that the percentage of pixels in the cupping mark image to be recognized whose chromaticity component is equal to 190 and whose saturation component is equal to 60 is 1%, the height corresponding to the point (190, 60) is set to 1%. The color coordinates on the right side of FIG. 3 are the heights of each point expressed as a percentage.
[0045] After assigning heights according to the above rules, lines are formed by connecting some points with the same height in Fig. 3, thereby obtaining multiple contour lines, and points on one contour line have the same height, but the corresponding heights between different contour lines may be different. For example, Fig. 3 shows three contour lines, 0.8, 1.6, and 2.4, and the heights of each point on the 0.8 contour line are 0.8%, the heights of each point on the 1.6 contour line are 1.6%, and the heights of each point on the 2.4 contour line are 2.4%.
[0046] Figure 4 reflects the number of pixels with different combinations of chromaticity and brightness components, and the horizontal axis of Figure 4 indicates the chromaticity (Hue) component of the pixel in the cupping mark image to be recognized, and the vertical axis indicates the brightness (Value) component of the pixel in the cupping mark image to be recognized. The acquisition process of Figure 4 is as follows: first, in the coordinate system of Figure 4, a corresponding height is assigned to each point in the coordinate system according to the following rules:
[0047] For each point, the number of pixels having chromaticity and brightness components at the coordinates of the point in the cupping mark image to be recognized is counted, and a corresponding height is assigned to the point based on the statistical results.The height may be equal to the total number of pixels having chromaticity and brightness components at the coordinates of the point in the cupping mark image to be recognized, or may be equal to the proportion of pixels having chromaticity and brightness components at the coordinates of the point in the cupping mark image to be recognized.
[0048] Similar to Figure 3, after assigning heights according to the above rules, lines can be formed by connecting some points with the same height in Figure 4, thereby obtaining multiple contour lines, and points on one contour line have the same height, while the corresponding heights between different contour lines may be different.
[0049] 5 to 7 are three-dimensional contour maps representing color distribution information of the cupping mark image to be recognized obtained by statistical analysis when the target color space is the HSV color space according to an embodiment of the present application, where FIG. 5 is a plan view of the three-dimensional map, FIG. 6 is a perspective view of the three-dimensional map, and FIG. 7 is a side view of the three-dimensional map.
[0050] Referring to FIG. 6, in this three-dimensional diagram, the coordinate of the X axis is chromaticity, the coordinate of the Y axis is saturation, and the coordinate of the Z axis is brightness.
[0051] The process of obtaining the three-dimensional contour map shown in Figures 5 to 7 is similar to the process of obtaining the two-dimensional contour map described above, that is, first, assign a corresponding height to each point in the three-dimensional coordinate system according to the following rules: For each point, the number of pixels having chromaticity, saturation, and brightness components at the coordinates of the point in the cupping mark image to be recognized is counted. For example, for a point with coordinates (100, 50, 60), the number of pixels in the cupping mark image to be recognized that have a chromaticity of 100, a saturation of 50, and a brightness of 60 is counted. A corresponding height is assigned to the point based on the statistical results. The height may be equal to the number of pixels having chromaticity, brightness, and saturation components at the coordinates of the point in the cupping mark image to be recognized, or may be equal to the proportion of the number of pixels having chromaticity, brightness, and saturation components at the coordinates of the point in the cupping mark image to be recognized.
[0052] After assigning heights according to the above rules, lines can be formed by connecting several points that have the same height in the three-dimensional coordinate system, thereby obtaining multiple contour lines in the three-dimensional coordinate system, where points on one contour line have the same height, and the corresponding heights between different contour lines may be different.
[0053] Preferably, when the three-dimensional contour map is displayed on the visual interface of the terminal device, the height corresponding to each point is indicated by the color of the point, and the darker the color of the point, the greater the height, and the lighter the color of the point, the smaller the height.
[0054] 3 to 7 are all schematic contour diagrams representing color distribution information obtained by statistical analysis on the premise that the target color space is determined to be the HSV color space.
[0055] The above process for obtaining two-dimensional contour maps and three-dimensional contour maps can also be applied to situations where the target color space is another color space (e.g., Lab color space), and the color components of the HSV color space in the above process only need to be replaced with corresponding color components of the other color space, and the description will not be repeated here.
[0056] Based on the above process of determining the contour map, if the color distribution information is represented by a contour map, the specific execution process of step S103 is as follows: determining a contour coordinate system with coordinate axes corresponding to color components of the target color space; For each point in the contour coordinate system, counting the number of pixels in the cupping mark image to be recognized whose color components match the coordinates of the point, and determining the height of the point based on the statistical results; and connecting points having the same height in the contour coordinate system with a curve to obtain a contour map showing color distribution information.
[0057] In some preferred embodiments, when performing S103, the color distribution information may be obtained by directly calculating the color components of each pixel in the cupping mark image to be recognized in the target color space.
[0058] In some other preferred embodiments, the color components of the cupping mark image to be recognized may be compressed, and then color distribution information may be calculated based on the compressed cupping mark image to be recognized. That is, the execution process of step S103 may include the following steps: A1: For each color component of the target color space, divide the value range of the color component into a plurality of subintervals according to the step size corresponding to the color component, and determine an interval value for each subinterval.
[0059] The step sizes corresponding to different color components may be the same or different. Take the HSV color space as an example, when executing A1, the step size corresponding to the chrominance component is 5, and the step size corresponding to the saturation component is 10.
[0060] For example, assume that for the HSV color space, the step size corresponding to the hue component is 10, and the step sizes for the saturation and lightness components are both 5. Then, the chromaticity value range of 0° to 360° may be divided into a total of 36 chromaticity sub-intervals: 0° to 10°, 10° to 20°, ... 350° to 360°, the saturation value range of 0% to 100% may be divided into a total of 20 saturation sub-intervals: 0% to 5%, 5% to 10% ... 95% to 100%, and lightness may similarly be divided into a total of 20 lightness sub-intervals: 0% to 5%, 5% to 10% ... 95% to 100%.
[0061] The interval value of each subinterval is determined based on the numerical values within the interval. In this embodiment, the specific method for determining the interval value is not limited. For example, the interval value of one subinterval may be any one of the mean value, maximum value, minimum value, median value, quantile, mode value, and midpoint value (the average of the maximum and minimum values within the interval) of the subinterval.
[0062] Taking the above 36 chromaticity sub-intervals as an example, if the minimum value of each sub-interval is taken as the interval value of that sub-interval, then the interval value of the interval from 0° to 10° is 0°, the interval value of the interval from 10° to 20° is 20°, and so on up to the interval value of the interval from 350° to 360° is 350°.
[0063] A2: For each pixel of the cupping mark image to be recognized, the value of the pixel in each color component is replaced with the section value of the sub-section to which it belongs.
[0064] In step A2, the following operations are performed for each pixel of the cupping mark image to be recognized: After determining which sub-interval of the color component divided in step A1 the numerical value of each color component of the pixel belongs to, the numerical value of the color component corresponding to the pixel is replaced with the interval value of the sub-interval to which it belongs.
[0065] Continuing with the example of step A1, suppose that the chromaticity of a pixel in the cupping mark image to be recognized is 136°, the lightness is 72%, and the saturation is 34%. Then, based on the sub-intervals of chromaticity, lightness, and saturation divided in step A1, it can be determined that the chromaticity of the pixel belongs to the above-mentioned interval of 130°-140°. Therefore, the chromaticity value of the pixel is replaced with the interval value of the interval from the original 136° to 130°-140°, for example, 130°, which is the minimum value of the interval; Similarly, it can be determined that the brightness of the pixel belongs to the above-mentioned interval of 70% to 75%, and the brightness value of the pixel is replaced with an interval value from the original 72% to the interval of 70% to 75%, for example, 70%, which is the minimum value of the interval; The saturation of the pixel belongs to the above-mentioned interval of 30% to 35%, so the saturation value of the pixel is replaced with an interval value from the original 34% to the interval of 30% to 35%, for example, 30%, which is the minimum value of the interval; After the above operation, the chromaticity of the pixel is 130°, the brightness is 70%, and the saturation is 30%.
[0066] As can be seen, step A2 classifies color components with similar values into the same sub-section, and uniformly sets the values to the section values of the sub-section, thereby achieving the purpose of compressing data volume and improving efficiency.
[0067] When adopting the solution of compressing color components and then statistically analyzing color distribution information, the coordinates corresponding to color components in the contour map representing color distribution information are discontinuous. Taking Figure 3 as an example, after dividing the chromaticity, lightness, and saturation components into the above sub-intervals according to the example of step A1, the coordinate values on the chromaticity coordinate axis in Figure 3 become several discrete values, i.e., 0°, 10°, 20°...360°, and in this case, the interval between two adjacent coordinate values is the step size when dividing the sub-intervals.
[0068] By compressing the color components and then calculating the color distribution information, the amount of calculation required to calculate the color distribution information can be reduced, which has the advantage of improving the execution efficiency of this embodiment.
[0069] S104: Based on the color distribution information, the color determination result of the cupping mark image to be recognized is determined.
[0070] When the color distribution information is represented by a contour map (two-dimensional contour or three-dimensional contour), the specific execution process of step S104 includes the following steps: B1: Calculate at least one height threshold based on the height of each point in the contour map; B2: Select the contour lines corresponding to each height threshold from the contour map as the target contour lines; B3: The color judgment result of the cupping mark image to be recognized is determined based on a predetermined color judgment section to which the color component corresponding to each point on each target contour line belongs, and each color judgment section corresponds to one color.
[0071] When performing step B1, if the color distribution information is represented by a 3D contour map, one or more of the average value, maximum value, minimum value, median value, quantile value, mode value and midpoint value of the heights of all points in the 3D contour map can be directly calculated, and the calculation result can be used as at least one height threshold value in B1. Of course, more height threshold values can be calculated according to other algorithms, for example, 50% of the average value of the heights of all points can be calculated as the height threshold value. This embodiment does not limit the specific algorithm.
[0072] When the color distribution information is represented by a two-dimensional contour map, at least two two-dimensional contour maps can be obtained by statistically analyzing one cupping mark image to be recognized. In this case, the two two-dimensional contour map with the greatest influence of the abscissa and ordinate on the actual color of the pixel is selected as the reference two-dimensional contour map, and one or more of the average value, minimum value, median value, quantile value, mode value, midpoint value, and other values such as 50% of the average value of the heights of all points in the reference two-dimensional contour map are calculated, and the calculation result is used as at least one height threshold value in B1.
[0073] In step B2, when the color distribution information is represented by a three-dimensional contour map, the contour corresponding to the height threshold is determined according to the following method: A contour line in the three-dimensional contour map whose height is equal to the height threshold is determined as the contour line corresponding to the height threshold. For example, if the height of one contour line in the three-dimensional contour map is 3.5 and one height threshold obtained by calculation in B1 is 3.5, then the contour line with a height of 3.5 is the target contour line corresponding to the height threshold of 3.5.
[0074] When the color distribution information is represented by a two-dimensional contour map, target contours corresponding to each height threshold are determined in the reference two-dimensional contour map determined in step B1 according to the above method.
[0075] As can be seen, step B2 allows for determining, for each height threshold, a unique target contour corresponding to that height threshold, the target contour being the contour whose height is equal to the corresponding height threshold.
[0076] In step B3, when the color distribution information is represented by a three-dimensional contour map, the color judgment result of the cupping mark image to be recognized can be determined according to the following method: For each target contour line, the color judgment section to which the color component corresponding to each point on the target contour line belongs is detected, and the color corresponding to the color judgment section to which these points belong is determined as the color judgment result corresponding to the target contour line. At least one color is included in the color judgment result. A set of non-overlapping colors in the color judgment results of each target contour line may be considered as the color judgment result of the cupping mark image to be recognized.
[0077] For example, if two target contour lines are determined from a three-dimensional contour map, and the color judgment result corresponding to one of the target contour lines includes red and purple, and the color judgment result of the other target contour line is red, then the set consisting of both is red and purple, and the color judgment result of the cupping mark image to be recognized is red and purple.
[0078] To realize the above method, at least one color judgment section for each color component is set in advance, and it is possible to specify which combination of color judgment sections corresponds to which color. For example, in the HSV color space, the correspondence between the combination of color judgment sections and colors is shown in Table 1 below.
[0079] [Table 1]
[0080] In the cells of Table 1, the symbol " / " indicates that the cell is the default. A default cell means that whether the color of a pixel corresponds to the color of the default cell is regardless of the color component corresponding to the default cell. Taking red in Table 1 as an example, the cell belonging to the column "luminosity" in the row where red is located is the default cell. As can be seen from this, whether the color of a pixel is red is regardless of the value of the luminosity component of the pixel.
[0081] The meaning of Table 1 will be explained below using the three colors red, purple, and cyan in Table 1 as an example.
[0082] Red belongs to the second row of Table 1. Based on Table 1, if the chromaticity of a pixel is within the range of 156 to 190 and the saturation is greater than or equal to 60, the color of the pixel is red. That is, the color judgment range corresponding to red is chromaticity 156 to 190 and saturation greater than 60.
[0083] As can be determined based on the two rows to which purple belongs in Table 1, if a pixel's chromaticity is between 125 and 155 and its saturation is greater than or equal to 60, the pixel is displayed as purple; alternatively, if a pixel's chromaticity is between 125 and 155, its saturation is greater than or equal to 52, and its lightness is less than or equal to 148, the pixel is displayed as purple. In other words, the color judgment range corresponding to purple includes the case where the chromaticity is between 125 and 155 and the saturation is greater than 60, and the case where the chromaticity is between 125 and 155, the saturation is greater than 52, and the lightness is less than 148.
[0084] As can be determined based on the two rows to which cyan belongs in Table 1, when a pixel's chromaticity is in the range of 125 to 155 and its saturation is in the range of 25 to 50, the pixel is displayed as cyan; alternatively, when a pixel's chromaticity is in the range of 100 to 124 and its saturation is 34 or greater, the pixel is displayed as cyan. In other words, the color judgment range corresponding to cyan includes the cases where the chromaticity is 125 to 155 and the saturation is 25 to 50, and the cases where the chromaticity is 100 to 124 and the saturation is 34 or greater.
[0085] Combining the examples in Table 1, for any one target contour line, if the color components corresponding to each point on the target contour line are all within the color judgment section corresponding to purple in Table 1, the color judgment result of the target contour line is purple; If the color components corresponding to some points on the target contour line fall within the purple color judgment range and the color components corresponding to other points fall within the cyan color judgment range, the color judgment result of the target contour line is purple and cyan; If the color components corresponding to some points on the target contour line fall within the purple color judgment range, and the color components corresponding to other points do not fall within the color judgment range of any one of the colors specified in Table 1, the color judgment result of the target contour line is purple and pink.
[0086] When the color distribution information is represented by a two-dimensional contour map, color judgment sections related to only two color components in the reference two-dimensional contour image are determined in advance. For example, if the reference two-dimensional contour image is a two-dimensional contour map corresponding to chromaticity-saturation, color judgment sections of chromaticity and color judgment sections of saturation corresponding to each of the normal colors can be determined in advance, for example; The color judgment section corresponding to cyan includes a chromaticity of 125 to 155 and a saturation of 25 to 50, and a chromaticity of 100 to 124 and a saturation of 34 or greater.
[0087] The color judgment section corresponding to red is chromaticity 156 to 190, and saturation is greater than 60.
[0088] Then, by referring to the above process for determining the color determination result of the target contour line based on the three-dimensional contour line map, the color determination result of each of the two-dimensional contour line maps is determined.
[0089] In the above-mentioned judgment process, the color judgment interval corresponding to each color is calculated and obtained based on the color setting of the color space and the experience of the doctor in the cupping therapy.
[0090] If the color determination result of the cupping mark image to be recognized contains one or more colors, especially if the color determination result obtained in step B3 contains multiple colors, the multiple colors in the result are de-duped and merged according to predetermined de-duplication rules and merge rules to obtain a more accurate color determination result. The de-duplication rules and merge rules can be set based on actual application scenarios and related experience in this field, and are not limited by this embodiment.
[0091] As some examples, merger rules may include: Merging rule 1 defines the first priority of multiple colors typically found in cupping marks, and when multiple colors are included in the color determination result, the multiple colors are sorted in descending order according to the first priority, and only the first N colors among them are retained as the color determination result of the cupping mark image to be recognized, where N is a preset value, for example, set to 2. As a preferred first priority setting, red and purple have the same first priority and are the highest, and white, cyan, and pink have the same first priority and are all lower than red and purple.
[0092] The function of merge rule 1 is as follows: colors with a high first priority generally indicate abnormal cupping colors, for example, red and purple are abnormal cupping colors, and if there is a small amount of red or purple in the cupping marks, it indicates that there is a problem, so it is necessary to emphasize colors with a high first priority as color judgment results.
[0093] In merge rule 2, the second priority of each color is determined based on the height corresponding to each color in the contour map; the higher the height, the higher the second priority. Colors with the same first priority are sorted in descending order according to the second priority, and only the first N colors are retained as the color judgment results for the cupping mark image to be recognized. The height of a color in the contour map is equal to the sum of the heights of all points whose coordinates fall within the color judgment range of that color in the contour map. Here, it can be understood that the higher the height of a color in the contour map, the more pixels of that color there are in the cupping mark image to be recognized.
[0094] In Merging Rule 3, when the color determination result includes several colors with different first priorities, the first and second priorities of these several colors are sorted together. For example, the first priorities are sorted in descending order, and then colors with the same first priority are sorted in descending order ...
[0095] In addition to the above-mentioned several merging rules, other merging rules may be set based on the organs targeted by cupping therapy, and this embodiment is not specifically limited. For example, for a pulmonary cupping mark image obtained when cupping therapy is performed on the lungs, the color determination result may include red and purple at the same time, or may include white and cyan at the same time.
[0096] In addition to the above listed combination rules, there may be other combination rules set based on the diagnosis and treatment experience of doctors, and this is not limited thereto.
[0097] The beneficial effects of this solution are as follows: The present invention provides a method for analyzing the color of cupping mark images, and based on this method, the color recognition and classification of the entire cupping mark / functional area can be performed automatically, avoiding the influence of human subjectivity, forming a unified cupping color classification standard, improving efficiency, and reducing labor costs.
[0098] In addition, this analysis method extracts all color features of the cupping marks to form color distribution information, and then uses the contour method to find the color range where the color tends / concentrates as the cupping color judgment result. This method not only fully considers all color information, but also obtains important color information of the cupping marks, and can accurately judge the color result, especially for cupping marks images with multiple color features.
[0099] Based on the cupping mark image color recognition method provided by the embodiment of the present application, the embodiment of the present application further provides a cupping mark image color recognition device, which is shown in FIG. 8 as a structural schematic diagram of the device, and the device comprises: an acquisition unit 801 for acquiring a cupping mark image to be recognized; a conversion unit 802 for converting the cupping mark image to be recognized into a predetermined target color space; a statistics unit 803 for calculating color distribution information of the cupping mark image to be recognized in a target color space, the color distribution information being used to indicate the number of pixels of different colors in the cupping mark image to be recognized; and a determination unit 804 for determining a color determination result of the cupping mark image to be recognized based on the color distribution information.
[0100] Preferably, when acquiring the cupping mark image to be recognized, the acquisition unit 801 specifically: The original cupping mark image was taken with an imaging device, Image division is performed on the original cupping mark image, and skin areas without cupping marks in the original cupping mark image are removed to obtain a cupping mark image to be recognized.
[0101] Preferably, the statistical unit 803, when calculating the color distribution information of the cupping mark image to be recognized in the target color space, specifically: determining a contour coordinate system with the color components of the target color space as its coordinate axes; For each point in the contour coordinate system, the number of pixels in the cupping mark image to be recognized whose color components match the coordinates of the point is calculated, and the height of the point is determined based on the statistical results; Points with the same height in the contour coordinate system are connected with a curve to obtain a contour map showing color distribution information.
[0102] Preferably, the statistics unit 803 further comprises: for each color component of the target color space, dividing the range of values of the color component into a plurality of subintervals according to a predetermined step size for the color component, and determining an interval value for each subinterval; For each pixel of the cupping mark image to be recognized, the value of that pixel in each color component is replaced with the section value of the sub-section to which it belongs.
[0103] Preferably, when determining the color judgment result of the cupping mark image to be recognized based on the color distribution information, the determining unit 804 specifically: calculating at least one height threshold based on the height of each point in the contour map; Selecting a contour line from the contour map corresponding to each height threshold as a target contour line; The color judgment result of the cupping mark image to be recognized is determined based on the predetermined color judgment section to which the color component corresponding to each point on each target contour line belongs, and each color judgment section corresponds to one color.
[0104] For the specific operating principles and beneficial effects of the cupping mark image color recognition device provided by the embodiments of the present application, please refer to the relevant steps and beneficial effects of the cupping mark image color recognition method provided by the embodiments of the present application, and the description will not be repeated here.
[0105] Finally, relational terms such as "first" and "second" are used herein only to distinguish one entity or operation from another and do not necessarily require or imply any actual relationship or order between those entities or operations. Furthermore, the terms "comprise," "consist of," or any other variation thereof, are intended to cover a non-exclusive inclusion, whereby a process, method, article, or device comprising a set of elements not only includes those elements, but also includes other elements not expressly listed, or further elements inherent in such process, method, article, or device. Unless further limited, elements defined by the phrase "comprise" do not exclude the presence of other identical elements in the process, method, article, or device that includes the elements.
[0106] It should be noted that the concepts of "first", "second", etc. mentioned in the present invention are merely used to distinguish between different devices, modules or units, and do not limit the order of functions performed by these devices, modules or units or their mutual dependencies.
[0107] Those skilled in the art will be able to make or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Thus, the present application is not limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for color recognition of cupping mark images, comprising: acquiring a cupping mark image to be recognized; converting the cupping mark image to be recognized into a predetermined target color space; a step of calculating color distribution information of the cupping mark image to be recognized in the target color space, the color distribution information being used to indicate the number of pixels of different colors in the cupping mark image to be recognized; determining a color determination result of the cupping mark image to be recognized based on the color distribution information; A method comprising:
2. The step of acquiring a cupping mark image to be recognized includes: obtaining an original cupping mark image taken with an imaging device; performing image segmentation on the original cupping mark image to remove skin areas without cupping marks from the original cupping mark image, thereby obtaining a cupping mark image to be recognized; 2. The method of claim 1, comprising:
3. The step of collecting statistics of color distribution information of the cupping mark image to be recognized in the target color space includes: determining a contour coordinate system having coordinate axes corresponding to the color components of the target color space; For each point in the contour coordinate system, counting the number of pixels in the cupping mark image to be recognized whose color components match the coordinates of the point, and determining the height of the point based on the statistical results; connecting points having the same height in the contour coordinate system with a curve to obtain a contour map showing color distribution information; 2. The method of claim 1, comprising:
4. Before determining a contour coordinate system having coordinate axes of color components of the target color space, for each color component of the target color space, dividing a range of values for that color component into a plurality of subintervals according to a predetermined step size for that color component, and determining an interval value for each of the subintervals; a step of replacing, for each pixel of the cupping mark image to be recognized, the value of the pixel in each color component with the section value of the sub-section to which the pixel belongs; 4. The method of claim 3, further comprising:
5. The step of determining a color determination result of the cupping mark image to be recognized based on the color distribution information includes: calculating at least one height threshold based on the height of each point in the contour map; selecting a contour line from the contour map that corresponds to each of the height thresholds as a target contour line; a step of determining a color judgment result of the cupping mark image to be recognized based on a predetermined color judgment section to which a color component corresponding to each point on each of the target contour lines belongs, and each of the color judgment sections corresponds to one color; 4. The method of claim 3, comprising:
6. A color recognition device for cupping mark images, an acquisition unit for acquiring a cupping mark image to be recognized; a conversion unit for converting the cupping mark image to be recognized into a predetermined target color space; a statistical unit for calculating color distribution information of the cupping mark image to be recognized in the target color space, the color distribution information being used to indicate the number of pixels of different colors in the cupping mark image to be recognized; a determination unit for determining a color determination result of the cupping mark image to be recognized based on the color distribution information; 10. An apparatus comprising:
7. When acquiring the cupping mark image to be recognized, the acquisition unit specifically: The original cupping mark image was taken with an imaging device, performing image segmentation on the original cupping mark image to remove skin areas without cupping marks from the original cupping mark image, thereby obtaining a cupping mark image to be recognized; 7. The device according to claim 6.
8. When the statistical unit calculates the color distribution information of the cupping mark image to be recognized in the target color space, the statistical unit specifically: determining a contour coordinate system having coordinate axes corresponding to the color components of the target color space; For each point in the contour coordinate system, the number of pixels in the cupping mark image to be recognized whose color components match the coordinates of the point is calculated, and the height of the point is determined based on the statistical results; connecting points having the same height in the contour coordinate system with a curve to obtain a contour map showing color distribution information; 7. The device according to claim 6.
9. The statistical unit further comprises: for each color component of the target color space, dividing a range of values for the color component into a plurality of subintervals according to a predetermined step size for the color component, and determining an interval value for each of the subintervals; For each pixel of the cupping mark image to be recognized, the value of the pixel in each color component is replaced with the section value of the sub-section to which the pixel belongs.
9. The device according to claim 8.
10. When determining the color judgment result of the cupping mark image to be recognized based on the color distribution information, the determination unit specifically: calculating at least one height threshold based on the height of each point in the contour map; selecting a contour line from the contour map that corresponds to each of the height thresholds as a target contour line; determining a color judgment result of the cupping mark image to be recognized based on a predetermined color judgment section to which a color component corresponding to each point on each of the target contour lines belongs, and each of the color judgment sections corresponds to one color; 9. The device according to claim 8.
Citation Information
Patent Citations
Intelligent cupping device and using method thereof
CN105833367A
Traditional Chinese medicine quantitative color discrimination diagnosis technology and traditional Chinese medicine quantitative color discrimination diagnosis method on basis of two-dimensional codes and topological codes
CN106725314A
Intelligent cupping diagnosis and treatment system
CN107432822A
Identification method, system and device for electromagnetic therapeutic instrument can marks, and therapeutic instrument
CN110490844A