CN105761260B - A kind of skin image affected part dividing method - Google Patents
A kind of skin image affected part dividing method Download PDFInfo
- Publication number
- CN105761260B CN105761260B CN201610085988.5A CN201610085988A CN105761260B CN 105761260 B CN105761260 B CN 105761260B CN 201610085988 A CN201610085988 A CN 201610085988A CN 105761260 B CN105761260 B CN 105761260B
- Authority
- CN
- China
- Prior art keywords
- skin
- component
- image
- skin color
- area
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 15
- 230000011218 segmentation Effects 0.000 claims abstract description 14
- 230000003902 lesion Effects 0.000 claims abstract description 8
- 230000000877 morphologic effect Effects 0.000 claims abstract description 7
- 238000001514 detection method Methods 0.000 claims description 7
- 208000017520 skin disease Diseases 0.000 abstract description 7
- 238000007781 pre-processing Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 6
- 238000003745 diagnosis Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 201000010099 disease Diseases 0.000 description 1
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000037311 normal skin Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30004—Biomedical image processing
- G06T2207/30088—Skin; Dermal
Landscapes
- Image Analysis (AREA)
- Measuring And Recording Apparatus For Diagnosis (AREA)
Abstract
本发明涉及一种皮肤图像患处分割方法,包括:对输入皮肤图像进行预处理,提取RGB分量值,将图像转换HSV色彩空间;检测肤色区域和非肤色区域,对肤色区域进行内部填充;对3)中得到的肤色区域H分量图进行像素值直方图统计,使用Otsu阈值法新的肤色区域H分量图;对肤色区域H分量图二值化,形态学处理。本发明适用于多种皮肤病图像中的患处的分割,具有运行速度快,准确率高的特点。
The invention relates to a skin image lesion segmentation method, comprising: preprocessing an input skin image, extracting RGB component values, converting the image into an HSV color space; detecting skin-colored areas and non-skinned areas, and filling the skin-colored area; ) to perform pixel value histogram statistics on the H component map of the skin color region, and use the Otsu threshold method to obtain a new H component map of the skin color region; binarize the H component map of the skin color region, and perform morphological processing. The invention is applicable to the segmentation of affected parts in various skin disease images, and has the characteristics of fast running speed and high accuracy.
Description
技术领域technical field
本发明涉及医学图像处理领域,特别涉及一种皮肤图像患处分割方法。The invention relates to the field of medical image processing, in particular to a skin image lesion segmentation method.
背景技术Background technique
随着图像处理技术在医学领域的广泛应用,计算机诊断和辅助诊断成为研究的热门。皮肤病是一类常见的疾病,由于其患处可直接观察到,所以通过图像处理技术可实现皮肤病的计算机诊断和分析。皮肤病计算机诊断的首要步骤就是将皮肤病患处区域从采集到的皮肤图片中分割出来,只有实现了对患处的精确和高效的分割才能进一步分析患处的各种特征。目前的主要困难有:(1)因为皮肤受到多种因素的影响,皮肤病的形态和颜色差异较大;(2)患处周围常出现皮肤泛红区域,使得患处与皮肤的交界边缘并不明显,用基于梯度边缘的分割算法效果并不理性;(3)如果照片中存在皮肤之外的区域,此区域可能对分割产生干扰。With the wide application of image processing technology in the medical field, computer diagnosis and assisted diagnosis have become a hot topic in research. Skin disease is a kind of common disease. Since the affected area can be directly observed, computer diagnosis and analysis of skin disease can be realized through image processing technology. The first step in the computer diagnosis of skin diseases is to segment the affected area of the skin disease from the collected skin pictures. Only when the accurate and efficient segmentation of the affected area is realized can the various characteristics of the affected area be further analyzed. The main difficulties at present are: (1) Because the skin is affected by many factors, the shape and color of skin diseases are quite different; (2) There are often red areas around the affected area, so that the border between the affected area and the skin is not obvious , the effect of segmentation algorithm based on gradient edge is not rational; (3) If there is an area other than the skin in the photo, this area may interfere with the segmentation.
发明内容Contents of the invention
本发明的目的是提供一种运行速度快,准确率高的皮肤图像患处分割方法。本发明的技术方案如下:The purpose of the present invention is to provide a skin image lesion segmentation method with high speed and high accuracy. Technical scheme of the present invention is as follows:
1.一种皮肤图像患处分割方法,包括以下步骤:1. A skin image lesion segmentation method, comprising the following steps:
1)对输入皮肤图像进行预处理,提取RGB分量值,将图像转换HSV色彩空间中,并得到归一化值的H分量图。1) Preprocess the input skin image, extract the RGB component value, convert the image into the HSV color space, and obtain the H component map of the normalized value.
2)使用基于RGB色彩空间的肤色检测算法检测肤色区域和非肤色区域,对肤色区域进行内部填充;2) Use a skin color detection algorithm based on the RGB color space to detect skin color areas and non-skin color areas, and fill the skin color area internally;
3)将非肤色区域对应的H分量的H值为零,得到肤经过内部填充的肤色区域H分量图;3) Set the H value of the H component corresponding to the non-skin color area to zero, and obtain the H component map of the skin color area filled with the skin;
4)对3)中得到的肤色区域H分量图进行像素值直方图统计,直方图中令H分量值为零的点纵坐标值等于前后点纵坐标值的均值,将直方图向右平移0.6,使用Otsu阈值法计算H分量直方图的最佳阈值T;4) Perform pixel value histogram statistics on the H component map of the skin color area obtained in 3), the ordinate value of the point whose H component value is zero in the histogram is equal to the mean value of the ordinate values of the front and rear points, and shift the histogram to the right by 0.6 , using the Otsu threshold method to calculate the optimal threshold T of the H component histogram;
5)对3)中得到的H分量值向左平移T+0.6,得到新的肤色区域H分量图;5) Translate the H component value obtained in 3) to the left by T+0.6 to obtain a new H component map of the skin color area;
6)将5)中得到的肤色区域H分量图二值化,白色区域为患处区域,黑色区域为非患处区域,对二值化后的图像采用形态学处理中的闭运算消除白色区域内部空洞并使边缘平滑;6) Binarize the H-component map of the skin color area obtained in 5), the white area is the affected area, and the black area is the non-affected area, and the closed operation in the morphological processing is used to eliminate the inner cavity of the white area for the binarized image and smooth the edges;
7)提取6)中闭运算处理后的二值图像边缘,在原图像中标记边缘,并输出图像。7) Extract the edge of the binary image processed by the closed operation in 6), mark the edge in the original image, and output the image.
本发明首先将输入图片由RGB色彩空间转换到HSV色彩空间得到归一化H分量,然后使用肤色检测算法去除非肤色区域干扰,使用Otsu阈值法计算H分量直方图阈值,使H分量左移该阈值的大小,最后用形态学闭运算得到准确的分割结果,适用于多种皮肤病图像中的患处的分割,具有运行速度快,准确率高的特点。The present invention first converts the input picture from the RGB color space to the HSV color space to obtain the normalized H component, then uses the skin color detection algorithm to remove the non-skin color area interference, and uses the Otsu threshold method to calculate the H component histogram threshold, so that the H component is shifted to the left. The size of the threshold value, and finally use the morphological closed operation to obtain accurate segmentation results, which is suitable for the segmentation of affected areas in various skin disease images, and has the characteristics of fast running speed and high accuracy.
附图说明Description of drawings
图1为本发明流程框图。Fig. 1 is a flow chart of the present invention.
图2为本发明具体实施示例用图。Fig. 2 is a diagram for a specific implementation example of the present invention.
图3为H分量示例图。Figure 3 is an example diagram of the H component.
图4为肤色检测并内部填充结果示例图。Figure 4 is an example of skin color detection and internal filling results.
图5为H分量去除非肤色部分示例图。Fig. 5 is an example diagram of H component removal of non-skin color parts.
图6为H分量平移后示例图。Fig. 6 is an example diagram after translation of the H component.
图7为形态学闭运算结果示例图。Figure 7 is an example diagram of the results of the morphological closing operation.
图8为患处分割结果输出示例图像。Figure 8 is an example image of the output of the lesion segmentation result.
具体实施方式Detailed ways
为了进一步说明本发明,下面结合附图1的流程框图和附图2-8的实施示例用图给出一个具体实例。In order to further illustrate the present invention, a specific example is given below in conjunction with the flow chart of accompanying drawing 1 and the implementation examples of accompanying drawing 2-8.
图2所示为一张典型的患病皮肤图像。其中有数块患处区域,除此之外还有两部分皮肤之外的背景区域造成干扰。图中的部分患处与正常皮肤边界并不明显。Figure 2 shows a typical image of diseased skin. There are several affected areas, in addition to two background areas outside the skin causing interference. In the picture, the boundary between some affected areas and normal skin is not obvious.
参考框图1所示流程,本发明具体的皮肤图像患处分割过程描述如下:With reference to the process shown in block diagram 1, the specific skin image lesion segmentation process of the present invention is described as follows:
步骤一:对图2所示的输入图像进行去噪预处理。将图像转换到HSV色彩空间中,得到归一化的H分量图I1,即H分量的值在0到1之间。由R、G、B分量计算归一化的H分量的公式为:Step 1: Perform denoising preprocessing on the input image shown in Fig. 2 . Convert the image to the HSV color space to obtain a normalized H component map I 1 , that is, the value of the H component is between 0 and 1. The formula for calculating the normalized H component from the R, G, and B components is:
其中max=max{R,G,B},min=min{R,G,B}。图3所示为归一化后的H分量图。where max=max{R,G,B}, min=min{R,G,B}. Figure 3 shows the normalized H component map.
步骤二:使用基于RGB色彩空间的肤色检测算法检测图像中的肤色区域和非肤色区域。肤色检测判别公式如下:Step 2: Use a skin color detection algorithm based on RGB color space to detect skin color areas and non-skin color areas in the image. The skin color detection discriminant formula is as follows:
[yj(1)>95&&yj(2)>40&&yj(3)>20&&yj(1)-yj(3)>15&&yj(1)-yj(2)>15][y j (1)>95&&y j (2)>40&&y j (3)>20&&y j (1)-y j (3)>15&&y j (1)-y j (2)>15]
||[yj(1)>200&&yj(2)>210&&yj(1)>170&&abs(yj(1)-yj(3)]||[y j (1)>200&&y j (2)>210&&y j (1)>170&&abs(y j (1)-y j (3)]
<=[15&&yj(1)>yj(3)&&yj(2)>yj(3)]<=[15&&y j (1)>y j (3)&&y j (2)>y j (3)]
其中yj(1),yj(2),yj(3)分别为每个图像像素的R、G、B颜色分量值。符合上述判别式的像素点判定为皮肤区域,在二值图中赋值为1,否则为非皮肤区域,在二值图中赋值为0。对皮肤区域内部进行填充,输出二值图I2。图4所示为肤色检测和内部填充后的二值图Among them, y j (1), y j (2), and y j (3) are the R, G, and B color component values of each image pixel, respectively. Pixels that meet the above discriminant formula are judged as skin areas, and are assigned a value of 1 in the binary image; otherwise, they are non-skin areas, and are assigned a value of 0 in the binary image. Fill the inside of the skin area and output the binary image I 2 . Figure 4 shows the binary image after skin color detection and internal filling
步骤三:从I2统计值为0的位置,在I1中对应位置令这部分区域的H值为0,得到I3,以去除非肤色区域的影响。图5所示为I3。Step 3: From the position where the statistical value of I 2 is 0, set the H value of this part of the area to 0 at the corresponding position in I 1 to obtain I 3 to remove the influence of the non-skinned area. Figure 5 shows I 3 .
步骤四:对I3中的H分量值进行直方图统计,直方图中令H分量值为0的点纵坐标值等于前后点纵坐标值的均值。由于肤色和患处的色彩特征,H分量直方图分布集中在值为0-0.35和0.87-1之间,在使用Otsu阈值法计算阈值时,需要对直方图分布进行调整。考虑到皮肤图像在H分量为0.6左右无像素分布,将直方图向右平移0.6。使用Otsu阈值法计算H分量直方图的最佳阈值T。阈值T的计算方法即求以下目标函数的最大时的T值。Step 4: Perform histogram statistics on the H component value in I 3 , the ordinate value of the point whose H component value is 0 in the histogram is equal to the mean value of the ordinate values of the front and rear points. Due to the skin color and the color characteristics of the affected area, the histogram distribution of the H component is concentrated between 0-0.35 and 0.87-1. When using the Otsu threshold method to calculate the threshold, the histogram distribution needs to be adjusted. Considering that the skin image has no pixel distribution around the H component of 0.6, shift the histogram to the right by 0.6. The optimal threshold T for the H component histogram was calculated using the Otsu threshold method. The calculation method of the threshold T is to find the T value at the maximum of the following objective function.
其中w(T)为H分量值在0到T之间的出现概率,μ(T)是阈值为T时的H分量平均值,μ是整体图像的H分量平均值。Where w(T) is the occurrence probability of the H component value between 0 and T, μ(T) is the average value of the H component when the threshold is T, and μ is the average value of the H component of the overall image.
步骤五:对I3中的H分量值向左平移T+0.6,得到新的H分量图I4。图6所示为H分量平移后的图像。Step 5: Translate the H component value in I 3 to the left by T+0.6 to obtain a new H component map I 4 . Figure 6 shows the image after H component translation.
步骤六:将I4二值化得到I5,白色区域为患处区域,黑色区域为非患处区域。为了消除白色区域内部空洞并使边缘平滑,对二值化后的图像采用形态学处理中的闭运算,即先膨胀后腐蚀:Step 6: Binarize I 4 to obtain I 5 , the white area is the affected area, and the black area is the non-affected area. In order to eliminate the internal cavity of the white area and smooth the edge, the closed operation in the morphological processing is used for the binarized image, that is, first dilated and then corroded:
其中B(x)为结构元素。最后得到二值图像记为I6。图7所示为形态学处理后的二值图像。where B(x) is a structural element. The finally obtained binary image is denoted as I 6 . Figure 7 shows the binary image after morphological processing.
步骤七:提取I6的边缘,在原图像中标记处边缘,并输出图像。图8所示为输出结果图像,患处分割边缘在图中用绿色线标记。Step 7: Extract the edge of I 6 , mark the edge in the original image, and output the image. Figure 8 shows the output result image, and the segmentation edge of the lesion is marked with a green line in the figure.
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610085988.5A CN105761260B (en) | 2016-02-15 | 2016-02-15 | A kind of skin image affected part dividing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610085988.5A CN105761260B (en) | 2016-02-15 | 2016-02-15 | A kind of skin image affected part dividing method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105761260A CN105761260A (en) | 2016-07-13 |
CN105761260B true CN105761260B (en) | 2018-09-28 |
Family
ID=56330773
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610085988.5A Expired - Fee Related CN105761260B (en) | 2016-02-15 | 2016-02-15 | A kind of skin image affected part dividing method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105761260B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3291173A1 (en) | 2016-09-02 | 2018-03-07 | Casio Computer Co., Ltd. | Diagnosis assisting device, image processing method in diagnosis assisting device, and program |
CN106875391A (en) * | 2017-03-02 | 2017-06-20 | 深圳可思美科技有限公司 | The recognition methods of skin image and electronic equipment |
CN107392904A (en) * | 2017-07-28 | 2017-11-24 | 陆杰 | A kind of partitioning algorithm of the medical image based on mathematical morphology |
CN109035289B (en) * | 2018-07-27 | 2021-11-12 | 重庆师范大学 | Purple soil image segmentation and extraction method based on Chebyshev inequality H threshold |
CN108961295B (en) * | 2018-07-27 | 2022-01-28 | 重庆师范大学 | Purple soil image segmentation and extraction method based on normal distribution H threshold |
CN110490844A (en) * | 2019-07-24 | 2019-11-22 | 广州三得医疗科技有限公司 | A kind of recognition methods, system, device and the therapeutic equipment of electromagnetic therapeutic apparatus tank print |
CN110766713A (en) * | 2019-10-30 | 2020-02-07 | 上海微创医疗器械(集团)有限公司 | Lung image segmentation method and device and lung lesion region identification equipment |
CN112037235B (en) * | 2020-08-27 | 2023-01-10 | 平安科技(深圳)有限公司 | Injury picture automatic auditing method and device, electronic equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102479322A (en) * | 2010-11-30 | 2012-05-30 | 财团法人资讯工业策进会 | System, device and method for analyzing facial defects by using facial image with angle |
CN103632132A (en) * | 2012-12-11 | 2014-03-12 | 广西工学院 | Face detection and recognition method based on skin color segmentation and template matching |
CN103646398A (en) * | 2013-12-04 | 2014-03-19 | 山西大学 | Demoscopy focus automatic segmentation method |
-
2016
- 2016-02-15 CN CN201610085988.5A patent/CN105761260B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102479322A (en) * | 2010-11-30 | 2012-05-30 | 财团法人资讯工业策进会 | System, device and method for analyzing facial defects by using facial image with angle |
CN103632132A (en) * | 2012-12-11 | 2014-03-12 | 广西工学院 | Face detection and recognition method based on skin color segmentation and template matching |
CN103646398A (en) * | 2013-12-04 | 2014-03-19 | 山西大学 | Demoscopy focus automatic segmentation method |
Also Published As
Publication number | Publication date |
---|---|
CN105761260A (en) | 2016-07-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105761260B (en) | A kind of skin image affected part dividing method | |
CN105261017B (en) | The method that image segmentation based on road surface constraint extracts pedestrian's area-of-interest | |
CN102722891B (en) | Method for detecting image significance | |
CN103559719B (en) | A kind of interactive image segmentation method | |
Rad et al. | Digital dental X-ray image segmentation and feature extraction | |
Annangi et al. | A region based active contour method for x-ray lung segmentation using prior shape and low level features | |
US10885321B2 (en) | Hand detection method and system, image detection method and system, hand segmentation method, storage medium, and device | |
Salem et al. | A comparative study of white blood cells segmentation using otsu threshold and watershed transformation | |
CN101826209B (en) | Canny model-based method for segmenting three-dimensional medical image | |
CN109978848B (en) | Method for detecting hard exudation in fundus image based on multi-light-source color constancy model | |
CN104036479B (en) | Multi-focus image fusion method based on non-negative matrix factorization | |
CN107169985A (en) | A kind of moving target detecting method based on symmetrical inter-frame difference and context update | |
CN107506770A (en) | Diabetic retinopathy eye-ground photography standard picture generation method | |
CN102663714B (en) | Saliency-based method for suppressing strong fixed-pattern noise in infrared image | |
CN104766344B (en) | Vehicle checking method based on movement edge extractor | |
CN103985119A (en) | Method for partitioning cytoplasm and cell nucleuses of white blood cells in color blood cell image | |
CN106157279A (en) | Eye fundus image lesion detection method based on morphological segment | |
CN104021566A (en) | GrabCut algorithm-based automatic segmentation method of tongue diagnosis image | |
CN105809089A (en) | Multi-face detection method and device under complex background | |
CN106557750A (en) | It is a kind of based on the colour of skin and the method for detecting human face of depth y-bend characteristics tree | |
CN108563979A (en) | A method of based on the farmland image discriminating rice blast state of an illness of taking photo by plane | |
CN111160194B (en) | A still gesture image recognition method based on multi-feature fusion | |
CN116091421A (en) | A Method for Automatic Segmentation and Area Calculation of Blastomere Images of In Vitro Fertilization Embryos | |
CN111028263B (en) | Moving object segmentation method and system based on optical flow color clustering | |
CN105118051A (en) | Saliency detecting method applied to static image human segmentation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20180928 Termination date: 20200215 |