[go: up one dir, main page]

CN109919929B - Tongue crack feature extraction method based on wavelet transformation - Google Patents

Tongue crack feature extraction method based on wavelet transformation Download PDF

Info

Publication number
CN109919929B
CN109919929B CN201910169550.9A CN201910169550A CN109919929B CN 109919929 B CN109919929 B CN 109919929B CN 201910169550 A CN201910169550 A CN 201910169550A CN 109919929 B CN109919929 B CN 109919929B
Authority
CN
China
Prior art keywords
image
tongue
wavelet
pixel
gradient
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.)
Active
Application number
CN201910169550.9A
Other languages
Chinese (zh)
Other versions
CN109919929A (en
Inventor
杜春慧
刘勇国
肖迪尹
巩小强
李巧勤
杨尚明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN201910169550.9A priority Critical patent/CN109919929B/en
Publication of CN109919929A publication Critical patent/CN109919929A/en
Application granted granted Critical
Publication of CN109919929B publication Critical patent/CN109919929B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a tongue crack feature extraction method based on wavelet transformation, which comprises the following steps: applying median filtering to the original tongue image to smooth noise interference factors in the original tongue image; segmenting the smoothed tongue image by using a Canny edge detection operator; wavelet decomposition is carried out on the segmented tongue image to obtain a high-frequency tongue image component diagram and a low-frequency tongue image component diagram; fusing the high-low frequency component graph by using a wavelet fusion technology; and reconstructing clear tongue crack characteristics through wavelet inverse transformation. Decomposing and reconstructing a wavelet function, and applying the wavelet function to processing of tongue crack images, including tongue image denoising; by adding the wavelet transform processing technology, the feature extraction and matching of the tongue crack image can be more accurate.

Description

一种基于小波变换的舌裂纹特征提取方法A tongue crack feature extraction method based on wavelet transform

技术领域Technical Field

本发明属于中医技术领域,具体地说,涉及一种基于小波变换的舌裂纹特征提取方法。The invention belongs to the technical field of traditional Chinese medicine, and in particular relates to a tongue crack feature extraction method based on wavelet transform.

背景技术Background Art

中医认为舌象变化能够反映患者身体的脏腑病变情况,通过对患者舌象的诊察,医生能够及时发现患者某部位功能异常,对一些疾病的诊断起到较好的辅助作用。在传统中医中,医生通过“四诊”来对患者进行检查,以此来判断患者脏腑的气血、阴阳的生理以及病理状态。中医诊断中“四诊”分为望、闻、问、切四种方式,其中,舌诊是中医诊病的重要组成部分,在临床疾病诊断中起着重要作用。舌诊是一种通过观察舌体的生理与病理学形态来发现人体脏腑病理生理变化的诊察方法,医生通过对舌象观察能够对患者的病情作出相应的诊断和评估,在传统中医学中具有重要的价值。经过长期的的临床实践,结果证明舌诊能够准确地辨别出病变部位和疾病的严重程度。因此,针对舌诊这一医学理论的研究具有十分重要的意义,能为临床疾病的诊疗提供重要依据Traditional Chinese medicine believes that changes in tongue patterns can reflect the pathological conditions of the patient's internal organs. By examining the patient's tongue, doctors can promptly discover abnormal functions of certain parts of the patient, which plays a good auxiliary role in the diagnosis of some diseases. In traditional Chinese medicine, doctors use the "four examinations" to examine patients in order to determine the physiological and pathological conditions of the patient's internal organs' qi and blood, yin and yang. The "four examinations" in traditional Chinese medicine diagnosis are divided into four methods: observation, auscultation, questioning, and palpation. Among them, tongue diagnosis is an important part of traditional Chinese medicine diagnosis and plays an important role in clinical disease diagnosis. Tongue diagnosis is a diagnostic method that discovers pathological and physiological changes in human internal organs by observing the physiological and pathological morphology of the tongue. Doctors can make corresponding diagnoses and evaluations of patients' conditions by observing tongue patterns, which has important value in traditional Chinese medicine. After long-term clinical practice, the results show that tongue diagnosis can accurately identify the site of the lesion and the severity of the disease. Therefore, research on the medical theory of tongue diagnosis is of great significance and can provide an important basis for the diagnosis and treatment of clinical diseases.

舌面上出现各种形状的裂纹、裂沟,深浅不一,可见于全舌,也可见于舌面前部或舌尖、舌边等处。主阴血亏虚、脾虚湿侵。裂纹是发生在舌背黏膜的一种疾病,裂纹舌分布在舌的整个表面,是一种病态舌,主要是以舌前半部或舌尖两侧缘为主。舌象的研究意义对于人类健康等问题有非常深远的影响。裂纹是发生在舌背黏膜的一种疾病,裂纹舌分布在舌的整个表面,是一种病态舌,就诊率较低,主要是以舌前半部或舌尖两侧缘为主。其临床特点就是舌背黏膜出现深浅不一、规则或不规则的裂沟。裂纹舌发生的原因总的来说有四点,分别是阴虚论、血虚论、气虚论和阳虚论。常见的证型包括肝肾阴虚证、胃阴亏虚证、肝血亏虚证、气阴两虚证、肝郁脾虚证、心火亢盛证、脾胃气虚证、脾肾阳虚证等。Cracks and grooves of various shapes appear on the tongue surface, with varying depths. They can be seen on the entire tongue, the front of the tongue, the tip of the tongue, the sides of the tongue, etc. It mainly indicates deficiency of Yin and blood, and spleen deficiency and dampness. Cracks are a disease that occurs on the mucosa of the back of the tongue. Cracked tongue is distributed on the entire surface of the tongue. It is a pathological tongue, mainly in the front half of the tongue or the sides of the tip of the tongue. The research significance of tongue image has a profound impact on human health and other issues. Cracks are a disease that occurs on the mucosa of the back of the tongue. Cracked tongue is distributed on the entire surface of the tongue. It is a pathological tongue with a low rate of medical treatment, mainly in the front half of the tongue or the sides of the tip of the tongue. Its clinical feature is the appearance of regular or irregular cracks on the mucosa of the back of the tongue. In general, there are four reasons for the occurrence of cracked tongue, namely Yin deficiency theory, blood deficiency theory, Qi deficiency theory and Yang deficiency theory. Common syndromes include liver-kidney yin deficiency, stomach yin deficiency, liver blood deficiency, qi and yin deficiency, liver depression and spleen deficiency, hyperactivity of heart fire, spleen and stomach qi deficiency, and spleen and kidney yang deficiency.

舌裂纹图像具有裂纹处光线的反射率极低,裂纹灰度远低于背景灰度,并且裂纹处灰度变化强烈的缺陷。目前,有关舌裂纹的研究方法大致可分成两大类。其中,一类方法主要是基于舌图像的灰度、色彩信息对舌裂纹进行阈值分割,但并未考虑舌裂纹特征,因而难以精确、完整地分割出舌裂纹。另一类主要是基于线侦测方法对舌裂纹进行分割,还可以分成3个小类,即基于轮廓的线侦测方法、基于中心线的线侦测方法及基于区域的线侦测方法。虽然基于线侦测的方法考虑了舌裂纹纹理特征,但都存在一定程度的不足,例如:基于轮廓的线侦测方法采用的是一阶导数,对噪声敏感,而且在实际应用中往往得不到闭合的轮廓;基于中心线的线侦测方法一般采用的是二阶导数,同样对噪声敏感,而且中心线位置的提取往往存在较大误差;而基于区域的线侦测方法往往会将舌苔上的粗纹理、伪裂纹也分割出来,需要手动去除多余纹理、才能分割出裂纹。Tongue crack images have the defects of extremely low reflectivity of light at the crack, the grayscale of the crack is much lower than the background grayscale, and the grayscale changes strongly at the crack. At present, the research methods on tongue cracks can be roughly divided into two categories. Among them, one method mainly performs threshold segmentation of tongue cracks based on the grayscale and color information of the tongue image, but does not consider the characteristics of the tongue crack, so it is difficult to accurately and completely segment the tongue crack. The other method is mainly based on line detection methods to segment tongue cracks, which can also be divided into three subcategories, namely contour-based line detection methods, centerline-based line detection methods, and region-based line detection methods. Although the line detection methods take into account the texture features of tongue cracks, they all have certain deficiencies. For example, the contour-based line detection method uses the first-order derivative, which is sensitive to noise and often fails to obtain a closed contour in practical applications. The centerline-based line detection method generally uses the second-order derivative, which is also sensitive to noise and often has large errors in the extraction of the centerline position. The region-based line detection method often segments the coarse texture and pseudo-cracks on the tongue coating, and it is necessary to manually remove redundant texture to segment the cracks.

发明内容Summary of the invention

有鉴于此,本发明提供了一种基于小波变换的舌裂纹特征提取方法。In view of this, the present invention provides a tongue crack feature extraction method based on wavelet transform.

为了解决上述技术问题,本发明公开了一种基于小波变换的舌裂纹特征提取方法,包括以下步骤:In order to solve the above technical problems, the present invention discloses a tongue crack feature extraction method based on wavelet transform, comprising the following steps:

S1、将中值滤波作用于原始舌图像,以平滑原始舌图像中的噪声干扰因素;S1, applying median filtering to the original tongue image to smooth out the noise interference factors in the original tongue image;

S2、利用Canny边缘检测算子对平滑后的舌图像进行分割;S2, segmenting the smoothed tongue image using the Canny edge detection operator;

S3、对分割后的舌图像利用小波分解得到高频和低频舌图像分量图;S3, using wavelet decomposition to obtain high-frequency and low-frequency tongue image component images for the segmented tongue image;

S4、将高低频分量图用小波融合技术进行融合;S4, fusion of high and low frequency component images using wavelet fusion technology;

S5、通过小波逆变换重构出清晰的舌裂纹特征。S5. Reconstruct clear tongue crack features through inverse wavelet transform.

可选地,所述步骤S1中将中值滤波作用于原始舌图像具体为:Optionally, the median filter is applied to the original tongue image in step S1 as follows:

用二维滑动模板,将板内像素按照像素值的大小进行排序,生成单调上升或下降的为二维数据序列;Use a two-dimensional sliding template to sort the pixels in the board according to the size of the pixel value, and generate a two-dimensional data sequence that is monotonically rising or falling;

二维中值滤波输出为The output of the two-dimensional median filter is

g(x,y)=med{f(x-k,y-l),(k,l∈W)} (1)g(x, y)=med{f(x-k, y-l), (k, l∈W)} (1)

其中f(x,y),g(x,y)分别为原始图像和处理后的图像,k、l分别为像素x、y的领域像素;W为二维模板,为3×3区域。Where f(x, y), g(x, y) are the original image and the processed image respectively, k and l are the domain pixels of pixels x and y respectively; W is a two-dimensional template, which is a 3×3 area.

可选地,所述步骤S2中利用Canny边缘检测算子对平滑后的舌图像进行分割具体为:Optionally, the step S2 uses the Canny edge detection operator to segment the smoothed tongue image as follows:

S2.1、使用高斯滤波器,以平滑图像,滤除噪声;S2.1, use Gaussian filter to smooth the image and filter out noise;

S2.2、计算图像中每个像素点的梯度强度和方向;S2.2, calculate the gradient strength and direction of each pixel in the image;

S2.3、应用非极大值抑制,以消除边缘检测带来的杂散响应;S2.3, apply non-maximum suppression to eliminate spurious responses caused by edge detection;

S2.4、应用双阈值检测来确定真实的和潜在的边缘。S2.4. Apply dual threshold detection to determine real and potential edges.

可选地,所述步骤S2.1中使用高斯滤波器,以平滑图像,滤除噪声具体为:为了平滑图像,使用高斯滤波器与图像进行卷积,大小为(2k+1)x(2k+1)的高斯滤波器核的生成方程式由下式给出:Optionally, in step S2.1, a Gaussian filter is used to smooth the image and filter out noise. Specifically, in order to smooth the image, a Gaussian filter is used to convolve the image, and the generation equation of the Gaussian filter kernel with a size of (2k+1)x(2k+1) is given by the following formula:

Figure BDA0001987468000000031
Figure BDA0001987468000000031

其中,σ是方差,k是确定核矩阵的维数,i、j是图像的像素值。Among them, σ is the variance, k is the dimension of the kernel matrix, and i and j are the pixel values of the image.

可选地,所述步骤S2.2中计算图像中每个像素点的梯度强度和方向具体为:Optionally, the gradient strength and direction of each pixel in the image are calculated in step S2.2 as follows:

图像中的边缘可以指向各个方向,因此Canny算法使用Sobel算子来检测图像中的水平、垂直和对角边缘;边缘检测的算子返回水平Gx和垂直Gy方向的一阶导数值,由此便可以确定像素点的梯度G和方向theta;The edges in an image can point in various directions, so the Canny algorithm uses the Sobel operator to detect horizontal, vertical, and diagonal edges in an image; the edge detection operator returns the first-order derivative values in the horizontal G x and vertical G y directions, from which the gradient G and direction theta of the pixel point can be determined;

Sobel卷积因子为:The Sobel convolution factor is:

Figure BDA0001987468000000032
Figure BDA0001987468000000032

Figure BDA0001987468000000041
Figure BDA0001987468000000041

该算子包含两组3×3的矩阵,分别为水平方向及垂直方向,将之与图像作平面卷积,分别得出水平方向及垂直方向的亮度差分近似值;以I代表原始图像,Gx及Gy分别代表水平方向及垂直方向边缘检测的图像灰度值,其公式如下:The operator contains two sets of 3×3 matrices, one in the horizontal direction and the other in the vertical direction. Planar convolution is performed with the image to obtain the approximate brightness difference in the horizontal direction and the vertical direction respectively. I represents the original image, G x and G y represent the image grayscale values of the horizontal and vertical edge detection respectively. The formula is as follows:

Figure BDA0001987468000000042
Figure BDA0001987468000000042

Figure BDA0001987468000000043
Figure BDA0001987468000000043

图像中的每一个像素的水平方向及垂直灰度值通过以下公式结合,来计算该点灰度的大小:The horizontal and vertical grayscale values of each pixel in the image are combined by the following formula to calculate the grayscale of the point:

Figure BDA0001987468000000044
Figure BDA0001987468000000044

用以下公式计算梯度方向:The gradient direction is calculated using the following formula:

θ=arc tan(Gy/Gx) (6)θ = arc tan (G y /G x ) (6)

其中,G为梯度强度,θ表示梯度方向,theta表示梯度方向,arctan为反正切函数;Among them, G is the gradient strength, θ is the gradient direction, theta is the gradient direction, and arctan is the inverse tangent function;

Sobel算子根据像素点上下、左右领点灰度加权差,在边缘处达到极值这一现象检测边缘。The Sobel operator detects edges based on the phenomenon that the weighted difference in grayscale between the upper and lower pixels and the left and right pixels reaches an extreme value at the edge.

可选地,所述步骤S2.3中应用非极大值抑制,以消除边缘检测带来的杂散响应具体为:Optionally, the non-maximum suppression is applied in step S2.3 to eliminate the spurious response caused by edge detection as follows:

在非极大值抑制过程中,使用3×3的移动窗口对图像进行处理,中心像素梯度值与领域内的其他像素梯度值进行比较,如果中心像素值不是领域像素的极大值,则把该像素点赋值为0,反之则把该像素点视为图像的边缘;对梯度图像中每个像素进行非极大值抑制的步骤是:In the process of non-maximum suppression, a 3×3 moving window is used to process the image, and the central pixel gradient value is compared with the gradient values of other pixels in the domain. If the central pixel value is not the maximum value of the domain pixel, the pixel point is assigned a value of 0, otherwise the pixel point is regarded as the edge of the image; the steps for non-maximum suppression of each pixel in the gradient image are:

a)将其梯度方向近似为以下值中的一个(0,45,90,135,180,225,270,315),即上下左右和45°方向;a) approximate its gradient direction to one of the following values (0, 45, 90, 135, 180, 225, 270, 315), i.e. up, down, left, right and 45° directions;

b)比较该像素点,和其梯度方向正负方向的像素点的梯度强度;b) Compare the gradient strength of the pixel point with the pixel points in the positive and negative directions of its gradient direction;

c)如果该像素点梯度强度最大则保留,否则抑制,删除,即置为0;c) If the pixel has the largest gradient strength, it is retained; otherwise, it is suppressed and deleted, i.e., set to 0;

在跨越梯度方向的两个相邻像素之间使用线性插值来得到要比较的像素梯度;其具体的数学表达式如式(7)所示:Linear interpolation is used between two adjacent pixels that cross the gradient direction to obtain the pixel gradient to be compared; its specific mathematical expression is shown in formula (7):

Figure BDA0001987468000000051
Figure BDA0001987468000000051

其中,i、j表示图像的像素,maxgrade代表图像的最大像素梯度。Among them, i and j represent the pixels of the image, and maxgrade represents the maximum pixel gradient of the image.

可选地,所述步骤S3中对分割后的舌图像利用小波分解得到高频和低频舌图像分量图,具体为:Optionally, in step S3, the segmented tongue image is decomposed by wavelet to obtain high-frequency and low-frequency tongue image component images, specifically:

采用Daubechies-4型小波,对指纹图像进行i层小波分解;Using Daubechies-4 wavelet, the fingerprint image is decomposed by i-layer wavelet;

一幅图像信号为正方形图像,分为左右两个相同的区域,其中左侧区域为L,右侧区域为H;L是低频,H是高频;An image signal is a square image, divided into two identical left and right areas, where the left area is L and the right area is H; L is low frequency and H is high frequency;

将该图像信号进行i次小波分解,得到一组小波系数,其尺寸与形状均与原图像相同;其中,左上方区域分解为4各区域,其中,左上方区域为LLi,左下方区域为LHi;右上方区域为HLi,右下方区域为HHi;其余区域与一层分解相同。The image signal is subjected to i-time wavelet decomposition to obtain a set of wavelet coefficients, whose size and shape are the same as the original image; among them, the upper left area is decomposed into 4 areas, among which the upper left area is LLi, the lower left area is LHi; the upper right area is HLi, and the lower right area is HHi; the remaining areas are the same as the decomposition of one layer.

可选地,所述步骤S4中将高低频分量图用小波融合技术进行融合具体为:Optionally, the step S4 of fusing the high-frequency and low-frequency component images using wavelet fusion technology is specifically as follows:

在低频中利用局部方差作为依据;假设c(X)表示舌裂纹图像X的小波低频分量的系数矩阵;p(m,n)表示小波系数的空间位置;然后c(X,p)表示低频分量系数矩阵下标为(m,n)的元素的值;首先,以p为中心,用区域Q中的加权方差表示区域方差显著性;u(X,p)表示舌裂纹图像X低频系数矩阵的均值,p点为Q区域的中心;如果G(X,p)代表舌裂纹图像X中低频系数矩阵的区域方差显著性,以p点为Q区域的中心,则:In low frequency, local variance is used as the basis; assuming that c(X) represents the coefficient matrix of the wavelet low-frequency component of the tongue crack image X; p(m, n) represents the spatial position of the wavelet coefficient; then c(X, p) represents the value of the element with the subscript (m, n) of the low-frequency component coefficient matrix; first, with p as the center, the weighted variance in the area Q represents the regional variance significance; u(X, p) represents the mean of the low-frequency coefficient matrix of the tongue crack image X, and point p is the center of the Q area; if G(X, p) represents the regional variance significance of the low-frequency coefficient matrix in the tongue crack image X, with point p as the center of the Q area, then:

G(X,p)=∑P∈Qω(p)|c(X,p)-u(X,p)|2 (8)G(X, p)=∑ P∈Q ω(p)|c(X, p)-u(X, p)| 2 (8)

ω(p)表示权重,当它越接近p点时值越大;图像A和B的低频系数矩阵的区域方差表示为G(A,p)和G(B,p);此外,图像A和B的低频系数矩阵的区域方差匹配度由点p处的M2(p)定义:ω(p) represents the weight, and its value increases as it approaches point p; the regional variance of the low-frequency coefficient matrices of images A and B are expressed as G(A, p) and G(B, p); in addition, the regional variance matching degree of the low-frequency coefficient matrices of images A and B is defined by M 2 (p) at point p:

Figure BDA0001987468000000061
Figure BDA0001987468000000061

M2(p)的值在0~1之间变化,值越小,两幅图像的低频系数矩阵的匹配受越低;The value of M 2 (p) varies between 0 and 1. The smaller the value, the lower the matching of the low-frequency coefficient matrices of the two images.

设T2是匹配度的阈值,通常的取值为0.5-1;Let T 2 be the threshold of matching degree, which is usually 0.5-1;

当M2(p)<T2时,选择融合策略如下:When M 2 (p)<T 2 , the fusion strategy is selected as follows:

Figure BDA0001987468000000062
Figure BDA0001987468000000062

当M2(p)≥T2时,平均融合策略如下:When M 2 (p) ≥ T 2 , the average fusion strategy is as follows:

Figure BDA0001987468000000063
Figure BDA0001987468000000063

其中,

Figure BDA0001987468000000064
in,
Figure BDA0001987468000000064

在小波变换的高频部分,选择小波系数绝对值的最大值,弥补高低频之间信息的确实部分;由于裂纹目标的噪声和缺陷都是高频信息,所述的中值滤波用来对融合后的舌裂纹图像的高频系数进行滤波,以去除舌裂纹图像的噪声和缺陷:In the high-frequency part of the wavelet transform, the maximum value of the absolute value of the wavelet coefficient is selected to make up for the real part of the information between the high and low frequencies; since the noise and defects of the crack target are high-frequency information, the median filter is used to filter the high-frequency coefficients of the fused tongue crack image to remove the noise and defects of the tongue crack image:

Figure BDA0001987468000000065
Figure BDA0001987468000000065

d(X,p)表示在P点的小波高频分量的系数矩阵。d(X, p) represents the coefficient matrix of the wavelet high-frequency component at point P.

与现有技术相比,本发明可以获得包括以下技术效果:Compared with the prior art, the present invention can achieve the following technical effects:

1)舌裂纹图像有如下特点:裂纹处光线的反射率极低,裂纹灰度远低于背景灰度,并且裂纹处灰度变化强烈。因此,本发明选择中值滤波先将图像表明平滑化,减少图像噪声同时保留裂纹边缘信息,然后用频域滤波加强裂纹区域。该方法分为五个部分,将中值滤波作用于原始舌图像,目的是为了平滑原始舌图像中的噪声等干扰因素;利用Canny边缘检测算子对平滑后的舌图像进行分割;对分割后的舌图像利用小波分解得到高频和低频舌图像分量图;将高低频分量图用小波融合技术进行融合,最后通过小波逆变换重构出清晰的舌裂纹特征。本发明旨在提高舌裂纹检测的识别率。将小波函数进行分解与重构,并将其运用到对舌裂纹图像的处理中,包括舌图像去噪。通过加入小波变换的处理技术,可使舌裂纹图像的特征提取与匹配更加精确。1) The tongue crack image has the following characteristics: the reflectivity of light at the crack is extremely low, the crack grayscale is much lower than the background grayscale, and the grayscale at the crack changes strongly. Therefore, the present invention selects median filtering to first smooth the image surface, reduce image noise while retaining the crack edge information, and then uses frequency domain filtering to strengthen the crack area. The method is divided into five parts. The median filter is applied to the original tongue image in order to smooth the noise and other interference factors in the original tongue image; the Canny edge detection operator is used to segment the smoothed tongue image; the segmented tongue image is decomposed by wavelet to obtain high-frequency and low-frequency tongue image component images; the high-frequency and low-frequency component images are fused by wavelet fusion technology, and finally a clear tongue crack feature is reconstructed by inverse wavelet transform. The present invention aims to improve the recognition rate of tongue crack detection. The wavelet function is decomposed and reconstructed, and applied to the processing of tongue crack images, including tongue image denoising. By adding wavelet transform processing technology, the feature extraction and matching of tongue crack images can be made more accurate.

2)与现有技术相比,本发明提出的技术方案中所述的小波系数绝对值越大,表示原始图像灰度变化越大,重要性越高。像裂纹这样不规则的结构体在小波变换后会转化为高频子带里的高幅值系数,计算高频子带里那些幅值大于某个阈值的系数的数量,作为裂纹图像的一种特征。2) Compared with the prior art, the greater the absolute value of the wavelet coefficients in the technical solution proposed by the present invention, the greater the grayscale change of the original image and the higher the importance. Irregular structures such as cracks will be converted into high-amplitude coefficients in the high-frequency sub-band after wavelet transformation. The number of coefficients in the high-frequency sub-band with amplitudes greater than a certain threshold is calculated as a feature of the crack image.

3)本发明采用北京东直门医院提供的32例舌裂纹图像,其中2例舌裂纹识别失败,准确率高达93.75%。小波分解与重构技术方案解决了传统分割方法中存在的一些缺陷分割不完整、过分割的问题。本发明能够正确检测舌裂纹图像,具有一定的抗干扰能力,解决了信息丢失和过度分割的问题。3) The present invention uses 32 tongue crack images provided by Beijing Dongzhimen Hospital, of which 2 tongue cracks failed to be identified, with an accuracy rate of up to 93.75%. The wavelet decomposition and reconstruction technology solves some defects in the traditional segmentation method, such as incomplete segmentation and over-segmentation. The present invention can correctly detect tongue crack images, has a certain anti-interference ability, and solves the problems of information loss and over-segmentation.

当然,实施本发明的任一产品并不一定需要同时达到以上所述的所有技术效果。Of course, any product implementing the present invention does not necessarily need to achieve all of the above-mentioned technical effects at the same time.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处所说明的附图用来提供对本发明的进一步理解,构成本发明的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

图1是本发明舌裂纹识别过程图;FIG1 is a diagram of the tongue crack identification process of the present invention;

图2是本发明小波分解;其中,a代表图像的低频和高频分量;b代表图像的小波一级分解;c代表图像的小波二级分解。FIG2 is a wavelet decomposition of the present invention; wherein a represents the low-frequency and high-frequency components of an image; b represents the first-level wavelet decomposition of an image; and c represents the second-level wavelet decomposition of an image.

具体实施方式DETAILED DESCRIPTION

以下将配合实施例来详细说明本发明的实施方式,藉此对本发明如何应用技术手段来解决技术问题并达成技术功效的实现过程能充分理解并据以实施。The following will describe the implementation methods of the present invention in detail with reference to the embodiments, so that the implementation process of how the present invention applies technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.

本发明公开了一种基于小波变换的舌裂纹特征提取方法,包括以下步骤:The invention discloses a tongue crack feature extraction method based on wavelet transform, comprising the following steps:

S1、将中值滤波作用于原始舌图像,以平滑原始舌图像中的噪声等干扰因素;S1, applying median filtering to the original tongue image to smooth out interference factors such as noise in the original tongue image;

所述中值滤波法,是一种非线性图像增强技术,是基于排序统计理论的滤波方法。中值滤波能明显地抑制噪声,它将图像中每一像素点的灰度值设置为该点某邻域窗口内的所有像素点灰度值的中值。中值滤波的基本原理是把数字图像或数字序列中一点的值用该点的一个邻域中各点值的中值代替,让周围的像素值接近的真实值,从而消除孤立的噪声点。方法是用二维滑动模板,将板内像素按照像素值的大小进行排序,生成单调上升(或下降)的为二维数据序列。The median filtering method is a nonlinear image enhancement technology and a filtering method based on sorting statistics theory. Median filtering can significantly suppress noise. It sets the grayscale value of each pixel in the image to the median of the grayscale values of all pixels in a certain neighborhood window of the point. The basic principle of median filtering is to replace the value of a point in a digital image or digital sequence with the median of the values of each point in a neighborhood of the point, so that the surrounding pixel values are close to the true value, thereby eliminating isolated noise points. The method is to use a two-dimensional sliding template to sort the pixels in the plate according to the size of the pixel value, and generate a monotonically rising (or falling) two-dimensional data sequence.

二维中值滤波输出为The output of the two-dimensional median filter is

g(x,y)=med{f(x-k,y-l),(k,l∈W)} (1)g(x, y)=med{f(x-k, y-l), (k, l∈W)} (1)

其中f(x,y),g(x,y)分别为原始图像和处理后的图像,k、1分别为像素x、y的领域像素。W为二维模板,通常为3×3,5×5区域,也可以是不同的的形状,如线状,圆形,十字形,圆环形等。本发明使用3×3区域。Where f(x, y), g(x, y) are the original image and the processed image respectively, k and 1 are the domain pixels of pixels x and y respectively. W is a two-dimensional template, usually a 3×3, 5×5 area, and can also be different shapes, such as linear, circular, cross, annular, etc. The present invention uses a 3×3 area.

S2、利用Canny边缘检测算子对平滑后的舌图像进行分割;S2, segmenting the smoothed tongue image using the Canny edge detection operator;

所述Canny边缘分割,边缘是对象和背景之间的边界,还能表示重叠对象之间的边界。和其他边缘检测算法相比,canny检测能够有效的抑制图像噪声和较准确的确定图像边缘的位置。Canny边缘检测可以分为四个步骤:In the Canny edge segmentation, the edge is the boundary between the object and the background, and can also represent the boundary between overlapping objects. Compared with other edge detection algorithms, Canny detection can effectively suppress image noise and more accurately determine the location of the image edge. Canny edge detection can be divided into four steps:

S2.1、使用高斯滤波器,以平滑图像,滤除噪声。S2.1. Use a Gaussian filter to smooth the image and remove noise.

为了尽可能减少噪声对边缘检测结果的影响,所以必须滤除噪声以防止由噪声引起的错误检测。为了平滑图像,使用高斯滤波器与图像进行卷积,该步骤将平滑图像,以减少边缘检测器上明显的噪声影响。大小为(2k+1)x(2k+1)的高斯滤波器核的生成方程式由下式给出:In order to minimize the effect of noise on edge detection results, it is necessary to filter out the noise to prevent false detection caused by noise. To smooth the image, a Gaussian filter is convolved with the image. This step will smooth the image to reduce the obvious effect of noise on the edge detector. The generation equation of the Gaussian filter kernel of size (2k+1)x(2k+1) is given by the following equation:

Figure BDA0001987468000000081
Figure BDA0001987468000000081

其中,σ是方差,k是确定核矩阵的维数,i、j是图像的像素值;Among them, σ is the variance, k is the dimension of the kernel matrix, and i and j are the pixel values of the image;

S2.2、计算图像中每个像素点的梯度强度和方向。S2.2. Calculate the gradient strength and direction of each pixel in the image.

图像中的边缘可以指向各个方向,因此Canny算法使用四个算子来检测图像中的水平、垂直和对角边缘。边缘检测的算子(如Roberts,Prewitt,Sobel等)返回水平Gx和垂直Gy方向的一阶导数值,由此便可以确定像素点的梯度G和方向theta。本发明选择使用Sobel算子,因为这是最常见的一种算子。The edges in an image can point to various directions, so the Canny algorithm uses four operators to detect horizontal, vertical and diagonal edges in an image. Edge detection operators (such as Roberts, Prewitt, Sobel, etc.) return the first-order derivative values in the horizontal G x and vertical G y directions, from which the gradient G and direction theta of the pixel point can be determined. The present invention chooses to use the Sobel operator because it is the most common operator.

Sobel算子主要用作边缘检测,在技术上,它是一种离散性差分算子。Sobel卷积因子为:The Sobel operator is mainly used for edge detection. Technically, it is a discrete difference operator. The Sobel convolution factor is:

Figure BDA0001987468000000091
Figure BDA0001987468000000091

该算子包含两组3×3的矩阵,分别为水平方向及垂直方向,将之与图像作平面卷积,即可分别得出水平方向及垂直方向的亮度差分近似值。以I代表原始图像,Gx及Gy分别代表水平方向及垂直方向边缘检测的图像灰度值,其公式如下:The operator contains two sets of 3×3 matrices, one in the horizontal direction and the other in the vertical direction. By performing a plane convolution with the image, the approximate brightness difference in the horizontal direction and the vertical direction can be obtained respectively. Let I represent the original image, G x and G y represent the image grayscale values of the horizontal and vertical edge detection respectively, and the formula is as follows:

Figure BDA0001987468000000092
Figure BDA0001987468000000092

Figure BDA0001987468000000094
Figure BDA0001987468000000094

图像中的每一个像素的水平方向及垂直灰度值可以通过以下公式结合,来计算该点灰度的大小:The horizontal and vertical grayscale values of each pixel in the image can be combined by the following formula to calculate the grayscale of the point:

Figure BDA0001987468000000093
Figure BDA0001987468000000093

可用以下公式计算梯度方向:The gradient direction can be calculated using the following formula:

θ=arc tan(Gy/Gx) (6)θ = arc tan (G y /G x ) (6)

其中G为梯度强度,θ表示梯度方向,theta表示梯度方向,arctan为反正切函数。Where G is the gradient strength, θ is the gradient direction, theta is the gradient direction, and arctan is the inverse tangent function.

Sobel算子根据像素点上下、左右领点灰度加权差,在边缘处达到极值这一现象检测边缘。对噪声具有平滑作用,提供较为精确的边缘方向信息。The Sobel operator detects edges based on the grayscale weighted difference of the upper and lower pixels and the left and right pixels, which reaches an extreme value at the edge. It has a smoothing effect on noise and provides more accurate edge direction information.

S2.3、应用非极大值(Non-Maximum Suppression)抑制,以消除边缘检测带来的杂散响应:S2.3. Apply non-maximum suppression to eliminate spurious responses caused by edge detection:

对图像进行梯度计算后,仅仅基于梯度值提取的边缘仍然很模糊。而非极大值抑制则可以帮助将局部最大值之外的所有梯度值抑制为0。在非极大值抑制过程中,使用3×3的移动窗口对图像进行处理,中心像素梯度值与领域内的其他像素梯度值进行比较,如果中心像素值不是领域像素的极大值,则把该像素点赋值为0,反之则把该像素点视为图像的边缘。对梯度图像中每个像素进行非极大值抑制的步骤是:After the gradient calculation of the image, the edge extracted based on the gradient value alone is still fuzzy. Non-maximum suppression can help suppress all gradient values outside the local maximum to 0. In the non-maximum suppression process, a 3×3 moving window is used to process the image, and the central pixel gradient value is compared with the gradient values of other pixels in the domain. If the central pixel value is not the maximum value of the domain pixel, the pixel point is assigned a value of 0, otherwise the pixel point is regarded as the edge of the image. The steps for non-maximum suppression of each pixel in the gradient image are:

a)将其梯度方向近似为以下值中的一个(0,45,90,135,180,225,270,315)(即上下左右和45°方向);a) approximate its gradient direction to one of the following values (0, 45, 90, 135, 180, 225, 270, 315) (i.e. up, down, left, right and 45° directions);

b)比较该像素点,和其梯度方向正负方向的像素点的梯度强度;b) Compare the gradient strength of the pixel point with the pixel points in the positive and negative directions of its gradient direction;

c)如果该像素点梯度强度最大则保留,否则抑制(删除,即置为0);c) If the pixel has the largest gradient intensity, it is retained; otherwise, it is suppressed (deleted, i.e., set to 0);

通常为了更加精确的计算,在跨越梯度方向的两个相邻像素之间使用线性插值来得到要比较的像素梯度。其具体的数学表达式如式Usually, for more accurate calculation, linear interpolation is used between two adjacent pixels across the gradient direction to obtain the pixel gradient to be compared. Its specific mathematical expression is as follows:

Figure BDA0001987468000000101
Figure BDA0001987468000000101

其中,i、j表示图像的像素,maxgrade代表图像的最大像素梯度。Among them, i and j represent the pixels of the image, and maxgrade represents the maximum pixel gradient of the image.

非极大值抑制既有效保留了图像边缘的梯度,又达到了图像细化的目的。Non-maximum suppression not only effectively preserves the gradient of the image edge, but also achieves the purpose of image refinement.

S2.4、应用双阈值(Double-Threshold)检测来确定真实的和潜在的边缘。S2.4. Apply double-threshold detection to determine real and potential edges.

经过非极大值抑制后图像仍然有很多噪声点,canny算法应用一种双阈值的技术,即设定一个阈值上界和阈值下届,图像中的像素点如果大于阈值上界则认为必然是边界,小于阈值则认为必然不是边界。After non-maximum suppression, the image still has many noise points. The Canny algorithm uses a double threshold technology, that is, setting an upper threshold and a lower threshold. If the pixel in the image is greater than the upper threshold, it is considered to be a boundary, and if it is less than the threshold, it is considered not to be a boundary.

对于canny边缘分割图像,高频图像中包含了目标缺陷的虚实边缘信息,同时也包含了舌裂纹图像中的一些噪声。低频图像包含目标缺陷的轮廓信息。For the canny edge segmentation image, the high-frequency image contains the virtual and real edge information of the target defect, and also contains some noise in the tongue crack image. The low-frequency image contains the contour information of the target defect.

S3、对分割后的舌图像利用小波分解得到高频和低频舌图像分量图;S3, using wavelet decomposition to obtain high-frequency and low-frequency tongue image component images for the segmented tongue image;

所述小波变换,是一种将图像分解为不同的频域。然后在不同的频域应用不同的融合规则,最后,利用小波逆变换对图像进行重构。小波变换可以将舌裂纹图像分解为平均图像和细节图像的组合,这分别代表图像的不同结构。因此很容易提取原始图像的结构信息和细节信息。小波变换是建立在Fourier分析的基础之上的,利用小波变换的多分辨率分析的特点,在时域与频域均能够表征信号的局部特点,根据窗口大小不变而形状可变的特点,在图像信号的低频部分采用频率较高的分辨率,而在高频部分采用时间分辨率较高同时频率分辨率较低的方法,将其用在舌裂纹识别的预处理阶段,能够对信号不规律的舌裂纹进行处理。The wavelet transform is a method of decomposing an image into different frequency domains. Different fusion rules are then applied in different frequency domains, and finally, the image is reconstructed using an inverse wavelet transform. Wavelet transform can decompose the tongue crack image into a combination of an average image and a detail image, which represent different structures of the image. Therefore, it is easy to extract the structural information and detail information of the original image. Wavelet transform is based on Fourier analysis. It uses the characteristics of multi-resolution analysis of wavelet transform to characterize the local characteristics of the signal in both the time domain and the frequency domain. Based on the characteristics of the constant window size and variable shape, a higher frequency resolution is used in the low-frequency part of the image signal, and a method with a higher time resolution and a lower frequency resolution is used in the high-frequency part. It is used in the preprocessing stage of tongue crack recognition and can process tongue cracks with irregular signals.

对于二维小波变换来讲,可将其当做两个连续的一维小波变换的进行处理后得到的。通过二维小波变换进行图像的处理,可将其分解成一系列低频子图像,其结果取决于小波基的类型,即决定于滤波器的类型,本发明采用广泛使用的Daubechies-4型小波,对指纹图像进行2层小波分解。For the two-dimensional wavelet transform, it can be regarded as two consecutive one-dimensional wavelet transforms. By processing the image through the two-dimensional wavelet transform, it can be decomposed into a series of low-frequency sub-images. The result depends on the type of wavelet basis, that is, the type of filter. The present invention adopts the widely used Daubechies-4 wavelet to perform a two-layer wavelet decomposition on the fingerprint image.

本发明将一幅图像信号进行小波分解,会得到一组小波系数,其尺寸与形状均与原图像相同。一副300×300的图像经过两层小波分解,得到如图2所示的7块小波分解结果,一共有90000个系数。The present invention performs wavelet decomposition on an image signal to obtain a set of wavelet coefficients, whose size and shape are the same as the original image. A 300×300 image is decomposed by two layers of wavelets to obtain 7 blocks of wavelet decomposition results as shown in Figure 2, with a total of 90,000 coefficients.

将该图像信号进行i次小波分解,得到一组小波系数,其尺寸与形状均与原图像相同;其中,左上方区域分解为4各区域,其中,左上方区域为LLi,左下方区域为LHi;右上方区域为HLi,右下方区域为HHi;其余区域与一层分解相同;L是低频,H是高频;下标1和2表示一次或二次分解。在每个分解层上,图像被分解成LL、LH、HH、HL四个波段。只分解下一层的低频分量。四个子图像中的每一个都是由原始图像的内积和一个小波基函数生成的。然后在X和Y方向采样2次。逆变换,即图像重构,是通过增加图像的采样频率和卷积来实现的。自处理过的数据可能超过255或出现负数,它需要归一化到0-255显示图像。The image signal is decomposed by wavelet i times to obtain a set of wavelet coefficients, whose size and shape are the same as the original image; the upper left area is decomposed into 4 areas, among which the upper left area is LLi and the lower left area is LHi; the upper right area is HLi and the lower right area is HHi; the remaining areas are the same as the first layer of decomposition; L is low frequency and H is high frequency; subscripts 1 and 2 indicate one or two decompositions. At each decomposition layer, the image is decomposed into four bands: LL, LH, HH, and HL. Only the low-frequency components of the next layer are decomposed. Each of the four sub-images is generated by the inner product of the original image and a wavelet basis function. Then it is sampled twice in the X and Y directions. The inverse transform, that is, image reconstruction, is achieved by increasing the sampling frequency and convolution of the image. Since the processed data may exceed 255 or appear negative, it needs to be normalized to 0-255 to display the image.

S4、将高低频分量图用小波融合技术进行融合:S4. Use wavelet fusion technology to fuse the high and low frequency component images:

所述小波融合,低频的小波系数包含图像的轮廓信息,因此需要选择合适的小波系数进行融合操作。本发明在低频中利用局部方差作为依据。假设c(X)表示舌裂纹图像X的小波低频分量的系数矩阵。p(m,n)表示小波系数的空间位置。然后c(X,p)表示低频分量系数矩阵下标为(m,n)的元素的值。首先,以p为中心,用区域Q中的加权方差表示区域方差显著性。u(X,p)表示舌裂纹图像X低频系数矩阵的均值,p点为Q区域的中心。如果G(X,p)代表舌裂纹图像X中低频系数矩阵的区域方差显著性,以p点为Q区域的中心,则:In the wavelet fusion, the low-frequency wavelet coefficients contain the contour information of the image, so it is necessary to select appropriate wavelet coefficients for the fusion operation. The present invention uses local variance as a basis in low frequency. Assume that c(X) represents the coefficient matrix of the wavelet low-frequency component of the tongue crack image X. p(m, n) represents the spatial position of the wavelet coefficient. Then c(X, p) represents the value of the element with the subscript (m, n) of the low-frequency component coefficient matrix. First, with p as the center, the weighted variance in the area Q is used to represent the regional variance significance. u(X, p) represents the mean of the low-frequency coefficient matrix of the tongue crack image X, and point p is the center of the Q area. If G(X, p) represents the regional variance significance of the low-frequency coefficient matrix in the tongue crack image X, with point p as the center of the Q area, then:

G(X,p)=∑P∈Qω(p)|c(X,p)-u(X,p)|2 (8)G(X, p)=∑ P∈Q ω(p)|c(X, p)-u(X, p)| 2 (8)

ω(p)表示权重,当它越接近p点时值越大。图像A和B的低频系数矩阵的区域方差表示为G(A,p)和G(B,p)。此外,图像A和B的低频系数矩阵的区域方差匹配度由点p处的M2(p)定义:ω(p) represents a weight, and its value increases as it approaches point p. The regional variance of the low-frequency coefficient matrices of images A and B are represented by G(A, p) and G(B, p). In addition, the regional variance matching degree of the low-frequency coefficient matrices of images A and B is defined by M 2 (p) at point p:

Figure BDA0001987468000000121
Figure BDA0001987468000000121

M2(p)的值在0~1之间变化,值越小,两幅图像的低频系数矩阵的匹配度越低。The value of M 2 (p) varies between 0 and 1. The smaller the value, the lower the matching degree of the low-frequency coefficient matrices of the two images.

设T2是匹配度的阈值,通常的取值为(0.5-1)。Let T 2 be the threshold of matching degree, which is usually (0.5-1).

当M2(p)<T2时,选择(最优)融合策略如下:When M 2 (p)<T 2 , the (optimal) fusion strategy is selected as follows:

Figure BDA0001987468000000122
Figure BDA0001987468000000122

当M2(p)≥T2时,平均融合策略如下:When M 2 (p) ≥ T 2 , the average fusion strategy is as follows:

Figure BDA0001987468000000123
Figure BDA0001987468000000123

其中

Figure BDA0001987468000000124
in
Figure BDA0001987468000000124

以上的策略是基于领域像素之间的相关性,这种相关性可以有效的保留基于canny检测的细节和边缘。The above strategy is based on the correlation between pixels in the field, which can effectively preserve the details and edges based on canny detection.

所述的小波系数绝对值越大,表示原始图像灰度变化越大,重要性越高。像裂纹这样不规则的结构体在小波变换后会转化为高频子带里的高幅值系数,计算高频子带里那些幅值大于某个阈值的系数的数量,作为裂纹图像的一种特征。The larger the absolute value of the wavelet coefficient, the greater the grayscale change of the original image and the higher its importance. Irregular structures such as cracks will be converted into high-amplitude coefficients in the high-frequency sub-band after wavelet transformation. The number of coefficients in the high-frequency sub-band with amplitudes greater than a certain threshold is calculated as a feature of the crack image.

经过准确的canny边缘分割后,图像的对比度较强。本发明在小波变换的高频部分,选择小波系数绝对值的最大值,可以弥补高低频之间信息的确实部分。由于裂纹目标的噪声和缺陷都是高频信息,因此所述的中值滤波用来对融合后的舌裂纹图像的高频系数进行滤波,以去除舌裂纹图像的噪声和缺陷。After accurate canny edge segmentation, the image has a strong contrast. The present invention selects the maximum value of the absolute value of the wavelet coefficient in the high-frequency part of the wavelet transform, which can make up for the exact part of the information between high and low frequencies. Since the noise and defects of the crack target are high-frequency information, the median filter is used to filter the high-frequency coefficients of the fused tongue crack image to remove the noise and defects of the tongue crack image.

Figure BDA0001987468000000131
Figure BDA0001987468000000131

d(X,p)表示在P点的小波高频分量的系数矩阵。d(X, p) represents the coefficient matrix of the wavelet high-frequency component at point P.

S5、通过小波逆变换重构出清晰的舌裂纹特征。S5. Reconstruct clear tongue crack features through inverse wavelet transform.

所述小波逆变换通过作用于处理后的高频和低频分量,重构出清晰的舌裂纹图像。The inverse wavelet transform acts on the processed high-frequency and low-frequency components to reconstruct a clear tongue crack image.

本发明采用北京东直门医院提供的32例舌裂纹图像,其中2例舌裂纹识别失败,准确率高达93.75%。小波分解与重构技术方案解决了传统分割方法中存在的一些缺陷分割不完整、过分割的问题。本发明能够正确检测舌裂纹图像,具有一定的抗干扰能力,解决了信息丢失和过度分割的问题。The present invention uses 32 tongue crack images provided by Beijing Dongzhimen Hospital, of which 2 tongue cracks failed to be identified, with an accuracy rate of up to 93.75%. The wavelet decomposition and reconstruction technical solution solves some defects in the traditional segmentation method, such as incomplete segmentation and over-segmentation. The present invention can correctly detect tongue crack images, has a certain anti-interference ability, and solves the problems of information loss and over-segmentation.

上述说明示出并描述了发明的若干优选实施例,但如前所述,应当理解发明并非局限于本文所披露的形式,不应看作是对其他实施例的排除,而可用于各种其他组合、修改和环境,并能够在本文所述发明构想范围内,通过上述教导或相关领域的技术或知识进行改动。而本领域人员所进行的改动和变化不脱离发明的精神和范围,则都应在发明所附权利要求的保护范围内。The above description shows and describes several preferred embodiments of the invention, but as mentioned above, it should be understood that the invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the invention concept described herein through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall be within the scope of protection of the claims attached to the invention without departing from the spirit and scope of the invention.

Claims (5)

1.一种基于小波变换的舌裂纹特征提取方法,其特征在于,包括以下步骤:1. A tongue crack feature extraction method based on wavelet transform, characterized in that it comprises the following steps: S1、将中值滤波作用于原始舌图像,以平滑原始舌图像中的噪声干扰因素,将中值滤波作用于原始舌图像具体为:S1. Apply median filtering to the original tongue image to smooth out the noise interference factors in the original tongue image. The specific steps of applying median filtering to the original tongue image are as follows: 用二维滑动模板,将板内像素按照像素值的大小进行排序,生成单调上升或下降的为二维数据序列;Use a two-dimensional sliding template to sort the pixels in the board according to the size of the pixel value, and generate a two-dimensional data sequence that is monotonically rising or falling; 二维中值滤波输出为The output of the two-dimensional median filter is g(x,y)=med{f(x-k,y-l),(k,l∈W)} (1)g(x,y)=med{f(x-k,y-l),(k,l∈W)} (1) 其中f(x,y),g(x,y)分别为原始图像和处理后的图像,k、l分别为像素x、y的领域像素;W为二维模板,为3×3区域;Where f(x,y), g(x,y) are the original image and the processed image respectively, k and l are the domain pixels of pixels x and y respectively; W is a two-dimensional template, which is a 3×3 area; S2、利用Canny边缘检测算子对平滑后的舌图像进行分割,利用Canny边缘检测算子对平滑后的舌图像进行分割具体为:S2. Segment the smoothed tongue image using the Canny edge detection operator. Segment the smoothed tongue image using the Canny edge detection operator is specifically as follows: S2.1、使用高斯滤波器,以平滑图像,滤除噪声;S2.1, use Gaussian filter to smooth the image and filter out noise; S2.2、计算图像中每个像素点的梯度强度和方向;S2.2, calculate the gradient strength and direction of each pixel in the image; S2.3、应用非极大值抑制,以消除边缘检测带来的杂散响应;S2.3, apply non-maximum suppression to eliminate spurious responses caused by edge detection; S2.4、应用双阈值检测来确定真实的和潜在的边缘;S2.4, apply double threshold detection to determine real and potential edges; S3、对分割后的舌图像利用小波分解得到高频和低频舌图像分量图;S3, using wavelet decomposition to obtain high-frequency and low-frequency tongue image component images for the segmented tongue image; S4、将高低频分量图用小波融合技术进行融合;S4, fusion of high and low frequency component images using wavelet fusion technology; S5、通过小波逆变换重构出清晰的舌裂纹特征。S5. Reconstruct clear tongue crack features through inverse wavelet transform. 2.根据权利要求1所述的方法,其特征在于,所述步骤S2.1中使用高斯滤波器,以平滑图像,滤除噪声具体为:为了平滑图像,使用高斯滤波器与图像进行卷积,大小为(2k+1)x(2k+1)的高斯滤波器核的生成方程式由下式给出:2. The method according to claim 1 is characterized in that the step S2.1 uses a Gaussian filter to smooth the image and filter out noise. Specifically, in order to smooth the image, a Gaussian filter is used to convolve with the image, and the generation equation of the Gaussian filter kernel with a size of (2k+1)x(2k+1) is given by the following formula:
Figure FDA0003823280390000011
Figure FDA0003823280390000011
其中,σ是方差,k是确定核矩阵的维数,i、j是图像的像素值。Among them, σ is the variance, k is the dimension of the kernel matrix, and i and j are the pixel values of the image.
3.根据权利要求2所述的方法,其特征在于,所述步骤S2.2中计算图像中每个像素点的梯度强度和方向具体为:3. The method according to claim 2, characterized in that the step S2.2 of calculating the gradient strength and direction of each pixel in the image is specifically: 图像中的边缘可以指向各个方向,因此Canny算法使用Sobel算子来检测图像中的水平、垂直和对角边缘;边缘检测的算子返回水平Gx和垂直Gy方向的一阶导数值,由此便可以确定像素点的梯度G和方向theta;The edges in an image can point in various directions, so the Canny algorithm uses the Sobel operator to detect horizontal, vertical, and diagonal edges in an image; the edge detection operator returns the first-order derivative values in the horizontal G x and vertical G y directions, from which the gradient G and direction theta of the pixel point can be determined; Sobel卷积因子为:The Sobel convolution factor is: -1-1 00 +1+1 -2-2 00 +2+2 -1-1 00 +1+1
+1+1 +2+2 +1+1 00 00 00 -1-1 -2-2 -1-1
该算子包含两组3×3的矩阵,分别为水平方向及垂直方向,将之与图像作平面卷积,分别得出水平方向及垂直方向的亮度差分近似值;以I代表原始图像,Gx及Gy分别代表水平方向及垂直方向边缘检测的图像灰度值,其公式如下:The operator contains two sets of 3×3 matrices, one in the horizontal direction and the other in the vertical direction. Planar convolution is performed with the image to obtain the approximate brightness difference in the horizontal direction and the vertical direction respectively. I represents the original image, G x and G y represent the image grayscale values of the horizontal and vertical edge detection respectively. The formula is as follows:
Figure FDA0003823280390000021
Figure FDA0003823280390000021
Figure FDA0003823280390000022
Figure FDA0003823280390000022
图像中的每一个像素的水平方向及垂直灰度值通过以下公式结合,来计算该点灰度的大小:The horizontal and vertical grayscale values of each pixel in the image are combined by the following formula to calculate the grayscale of the point:
Figure FDA0003823280390000023
Figure FDA0003823280390000023
用以下公式计算梯度方向:The gradient direction is calculated using the following formula: θ=arctan(Gy/Gx) (6)θ=arctan(G y /G x ) (6) 其中,G为梯度强度,θ表示梯度方向,theta表示梯度方向,arctan为反正切函数;Among them, G is the gradient strength, θ is the gradient direction, theta is the gradient direction, and arctan is the inverse tangent function; Sobel算子根据像素点上下、左右领点灰度加权差,在边缘处达到极值这一现象检测边缘。The Sobel operator detects edges based on the phenomenon that the weighted grayscale difference of the upper and lower pixels and the left and right pixels reaches an extreme value at the edge.
4.根据权利要求1所述的方法,其特征在于,所述步骤S2.3中应用非极大值抑制,以消除边缘检测带来的杂散响应具体为:4. The method according to claim 1, characterized in that the non-maximum suppression is applied in step S2.3 to eliminate the spurious response caused by edge detection, specifically: 在非极大值抑制过程中,使用3×3的移动窗口对图像进行处理,中心像素梯度值与领域内的其他像素梯度值进行比较,如果中心像素值不是领域像素的极大值,则把该像素点赋值为0,反之则把该像素点视为图像的边缘;对梯度图像中每个像素进行非极大值抑制的步骤是:In the process of non-maximum suppression, a 3×3 moving window is used to process the image, and the central pixel gradient value is compared with the gradient values of other pixels in the domain. If the central pixel value is not the maximum value of the domain pixel, the pixel point is assigned a value of 0, otherwise the pixel point is regarded as the edge of the image; the steps for non-maximum suppression of each pixel in the gradient image are: a)将其梯度方向近似为以下值中的一个(0,45,90,135,180,225,270,315),即上下左右和45°方向;a) Its gradient direction is approximated to one of the following values (0, 45, 90, 135, 180, 225, 270, 315), i.e. up, down, left, right and 45° directions; b)比较该像素点,和其梯度方向正负方向的像素点的梯度强度;b) Compare the gradient strength of the pixel point with the pixel points in the positive and negative directions of its gradient direction; c)如果该像素点梯度强度最大则保留,否则抑制,删除,即置为0;c) If the pixel has the largest gradient strength, it is retained; otherwise, it is suppressed and deleted, i.e., set to 0; 在跨越梯度方向的两个相邻像素之间使用线性插值来得到要比较的像素梯度;其具体的数学表达式如式(7)所示:Linear interpolation is used between two adjacent pixels that cross the gradient direction to obtain the pixel gradient to be compared; its specific mathematical expression is shown in formula (7):
Figure FDA0003823280390000031
Figure FDA0003823280390000031
其中,i、j表示图像的像素,maxgrade代表图像的最大像素梯度。Among them, i and j represent the pixels of the image, and maxgrade represents the maximum pixel gradient of the image.
5.根据权利要求1所述的方法,其特征在于,所述步骤S3中对分割后的舌图像利用小波分解得到高频和低频舌图像分量图,具体为:5. The method according to claim 1, characterized in that in step S3, the segmented tongue image is decomposed by wavelet to obtain high-frequency and low-frequency tongue image component images, specifically: 采用Daubechies-4型小波,对指纹图像进行i层小波分解;Using Daubechies-4 wavelet, the fingerprint image is decomposed by i-layer wavelet; 一幅图像信号为正方形图像,分为左右两个相同的区域,其中左侧区域为L,右侧区域为H;L是低频,H是高频;An image signal is a square image, divided into two identical left and right areas, where the left area is L and the right area is H; L is low frequency and H is high frequency; 将该图像信号进行i次小波分解,得到一组小波系数,其尺寸与形状均与原图像相同;其中,左上方区域分解为4各区域,其中,左上方区域为LLi,左下方区域为LHi;右上方区域为HLi,右下方区域为HHi;其余区域与一层分解相同。The image signal is subjected to i-time wavelet decomposition to obtain a set of wavelet coefficients, whose size and shape are the same as the original image; among them, the upper left area is decomposed into 4 areas, among which the upper left area is LLi, the lower left area is LHi; the upper right area is HLi, and the lower right area is HHi; the remaining areas are the same as the decomposition of one layer.
CN201910169550.9A 2019-03-06 2019-03-06 Tongue crack feature extraction method based on wavelet transformation Active CN109919929B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910169550.9A CN109919929B (en) 2019-03-06 2019-03-06 Tongue crack feature extraction method based on wavelet transformation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910169550.9A CN109919929B (en) 2019-03-06 2019-03-06 Tongue crack feature extraction method based on wavelet transformation

Publications (2)

Publication Number Publication Date
CN109919929A CN109919929A (en) 2019-06-21
CN109919929B true CN109919929B (en) 2023-03-24

Family

ID=66963572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910169550.9A Active CN109919929B (en) 2019-03-06 2019-03-06 Tongue crack feature extraction method based on wavelet transformation

Country Status (1)

Country Link
CN (1) CN109919929B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110599410B (en) * 2019-08-07 2022-06-10 北京达佳互联信息技术有限公司 Image processing method, device, terminal and storage medium
CN113239790A (en) * 2021-05-11 2021-08-10 上海道生医疗科技有限公司 Tongue crack feature identification and length measurement method and system
CN113870197B (en) * 2021-09-10 2025-04-29 贵州大学 A gear crack detection method based on wavelet multi-layer decomposition
CN114187209B (en) * 2022-02-16 2022-05-24 深圳清瑞博源智能科技有限公司 Image defogging method, device, equipment and storage medium
CN114693682B (en) * 2022-06-01 2022-08-26 青岛大学附属医院 A method of spine feature recognition based on image processing
CN115641455B (en) * 2022-09-16 2024-01-09 杭州视图智航科技有限公司 Image matching method based on multi-feature fusion
CN115567691A (en) * 2022-09-22 2023-01-03 中国第一汽车股份有限公司 Method and device for real-time display of front-view camera video stream by back-row entertainment system
CN116399379B (en) * 2023-06-07 2023-11-03 山东省科学院激光研究所 Distributed optical fiber acoustic wave sensing system and its measurement method
CN117252794B (en) * 2023-09-25 2024-04-16 徐州医科大学 A multi-wavelength transmission image fusion device in frequency domain
CN117670877B (en) * 2024-01-31 2024-05-10 陕西雷诺贝尔铝业有限公司 Surface treatment method and system applied to aluminum veneer processing
CN119444821A (en) * 2024-07-12 2025-02-14 电子科技大学 A texture direction detection method based on texture detection technology fusion
CN119850976B (en) * 2024-12-20 2025-08-05 格星微电子科技成都有限公司 A grayscale image feature extraction system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106910179A (en) * 2017-01-22 2017-06-30 南京觅踪电子科技有限公司 Multimode medical image fusion method based on wavelet transformation
CN107133952A (en) * 2017-05-26 2017-09-05 浙江工业大学 A kind of alligatoring recognition methods for merging time-frequency characteristics

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006017233A1 (en) * 2004-07-12 2006-02-16 Lehigh University Image fusion methods and apparatus
US8538189B2 (en) * 2008-11-14 2013-09-17 Ati Technologies Ulc Image noise filter and method
CN104504740A (en) * 2015-01-23 2015-04-08 天津大学 Image fusion method of compressed sensing framework
CN106446905B (en) * 2016-07-25 2019-05-28 广东省智能制造研究所 The extracting method for the face crack texture that percolation algorithm and adaptive Canny algorithm blend
CN107169979A (en) * 2017-05-11 2017-09-15 南宁市正祥科技有限公司 A kind of method for detecting image edge of improvement Canny operators

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106910179A (en) * 2017-01-22 2017-06-30 南京觅踪电子科技有限公司 Multimode medical image fusion method based on wavelet transformation
CN107133952A (en) * 2017-05-26 2017-09-05 浙江工业大学 A kind of alligatoring recognition methods for merging time-frequency characteristics

Also Published As

Publication number Publication date
CN109919929A (en) 2019-06-21

Similar Documents

Publication Publication Date Title
CN109919929B (en) Tongue crack feature extraction method based on wavelet transformation
Schilham et al. Local noise weighted filtering for emphysema scoring of low-dose CT images
Yu et al. Fast vessel segmentation in retinal images using multi-scale enhancement and second-order local entropy
CN107705260B (en) The denoising system and calculation method of medical X-ray image
Dash et al. Curvelet Transform Based on Edge Preserving Filter for Retinal Blood Vessel Segmentation.
El-Shafai et al. Deep cnn model for multimodal medical image denoising
Yadav et al. Despeckling filters applied to thyroid ultrasound images: a comparative analysis
Bhateja et al. Speckle reduction in ultrasound images using an improved conductance function based on anisotropic diffusion
Kaur et al. Review on medical image denoising techniques
Chithra et al. Hybrid denoising technique for suppressing Gaussian noise in medical images
CN109389567A (en) A kind of sparseness filtering method of fast optical imaging data
Beheshti et al. Classification of abnormalities in mammograms by new asymmetric fractal features
Li et al. A multiscale approach to retinal vessel segmentation using Gabor filters and scale multiplication
CN115496687B (en) A method for edge extraction image denoising based on convolutional neural network
Amutha et al. Mammographic image enhancement using modified mathematical morphology and Bi-orthogonal wavelet
Naik et al. Effect of despeckling filters on the segmentation of ultrasound common carotid artery images
Singh et al. Feature enhancement in medical ultrasound videos using multifractal and contrast adaptive histogram equalization techniques
Wu et al. A general framework for vessel segmentation in retinal images
Shanmugavadivu et al. Wavelet transformation-based detection of masses in digital mammograms
Yu et al. Generative adversarial networks with dense connection for optical coherence tomography images denoising
Rezatofighi et al. An enhanced segmentation of blood vessels in retinal images using contourlet
Ashour et al. Advanced optimization-based neutrosophic sets for medical image denoising
Muthu et al. Morphological operations in medical image pre-processing
Miri et al. A comparison study to evaluate retinal image enhancement techniques
Lazrag et al. Wavelet filters analysis for speckle reduction in intravascular ultrasound images

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant