CN1169079C - Computer Segmentation Method of TCM Tongue Image Based on Spline Snakes Model - Google Patents

Computer Segmentation Method of TCM Tongue Image Based on Spline Snakes Model Download PDF

Info

Publication number
CN1169079C
CN1169079C CNB021037973A CN02103797A CN1169079C CN 1169079 C CN1169079 C CN 1169079C CN B021037973 A CNB021037973 A CN B021037973A CN 02103797 A CN02103797 A CN 02103797A CN 1169079 C CN1169079 C CN 1169079C
Authority
CN
China
Prior art keywords
tongue
image
snakes
value
tongue body
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
Application number
CNB021037973A
Other languages
Chinese (zh)
Other versions
CN1367455A (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.)
Beijing University of Technology
Original Assignee
Beijing University of Technology
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 Beijing University of Technology filed Critical Beijing University of Technology
Priority to CNB021037973A priority Critical patent/CN1169079C/en
Publication of CN1367455A publication Critical patent/CN1367455A/en
Application granted granted Critical
Publication of CN1169079C publication Critical patent/CN1169079C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The present invention relates to a computer cutting method based on a sample strip Snakes model for a tongue picture of Chinese medicine. The present invention cuts a tongue body in the tongue picture of the Chinese medicine from the background to be convenient for the following characteristic analysis. The present invention adopts a digital camera to collect the tongue picture and input the picture to a computer to be processed, transmitted, etc. The method is characterized in that according to the statistical analysis of the shape of the tongue body, a mould plate of a tongue body contour which takes a rectangular region as an outer boundary is defined; with an analysis method of greyscale projection, a rectangular region is obtained to determine the approximate position and size of the tongue body; the present invention provides an initialization method for the tongue body contour, which is based on the greyscale projection and a rigid mould plate; prior knowledge relating to the tongue body contour is added into the energy function of a Snakes model; a Catmull-Rom sample strip Snakes model is used for representing the tongue body contour which is optimized by the greedy method; a tongue body contour is obtained from a colored tongue picture; a tongue body region is cut from the tongue body contour. The cutting method has accuracy and practicality.

Description

Traditional Chinese medical science tongue picture computing machine dividing method based on batten Snakes (Snakes) model
Technical field
The present invention relates to computing machine Medical image Processing field, designed a kind of tongue body dividing method, the tongue body in the traditional Chinese medical science tongue image is split from background, so that signature analysis subsequently based on batten Snakes (Snakes) model.
Background technology
Being commonly used in image processing field and tongue picture, to cut apart correlation technique as follows:
It is tongue image tongue body Region Segmentation that tongue picture is cut apart, and is a kind of concrete application of image partitioning method.Traditional image Segmentation adopts rim detection, region clustering scheduling algorithm, these methods all are to utilize the low-level feature of image, be the homogeneity or the mutability of pictorial data, and do not have to utilize the relevant priori of cutting apart target, as the position of target, size, shape etc.These methods need be carried out the integrity profile that complicated aftertreatment could be determined tongue body.And, often be difficult to obtain gratifying segmentation result owing to the reasons such as difference of contour feature and image quality.
Snakes (Snakes) model claims active contour model (active contour model) again, is proposed in 1987 by people such as Kass.Snakes (Snakes) is a kind of method that the skeleton pattern and the image feature of target are complementary, it utilizes the polygon of object to represent, target is formulated as a suitable energy function E, E is minimized obtain desired outline line then, thereby be partitioned into the target in the image.Snakes (Snakes) is a kind of batten of energy minimization, under the effect of various power and constraint condition elastic deformation takes place, up to the profile that obtains expecting.Its energy is generally become by three kinds of Lik-Sangs: its shape of internal force constraint, and its behavior of external force guiding, visual power drags it to significant image feature; The outline line of Snakes is locked near the image feature, exactly with its minimization.Like this, when seeking significant image feature, higher layer mechanism may be carried out with model by image feature being pushed to a suitable Local Extremum alternately.The maximum characteristics of Snakes (Snakes) are low-level feature and the high-rise knowledge that combines image, when being used for image Segmentation, all are better than classic method at aspects such as robustness, degree of accuracy, practicality.
Usually, Snakes is controlled simultaneously by several different acting forces, and each power produces an energy term.Can be expressed as
E snake ( V ) = Σ i = 1 n E snake ( v i ) = Σ i = 1 n [ E internal ( v i ) + E image ( v i ) + E extrnal ( v i ) ]
E wherein InternalBe called internal energy, do not rely on pictorial data, only relevant with the shape facility of profile, be used for calculating the characteristic that some we are paid close attention to of contour shape, for example continuity and flatness; E ImageBeing called picture power, is that the interaction of geometric model and pictorial data produces, at interested characterizing definition in the image, for example: edge, line, zone, texture etc.; E ExternalBe external energy, represent the constraint condition of various artificial definition.
Batten Snakes as the reference mark, defines a SPL with this with one group of discrete coordinates point, and these points have provided the general shape of curve.Batten is a SPL, be with a series of polynomial curve sections form continuously, the curve of fairing.On mathematics, batten is a set of segmentation smooth function, is used for being similar to or the interpolative data point set.The represented curve of batten Snakes be resolve, can be little, and local detail can be described.Can resolve how much derivative characteristics of finding the solution it, be convenient to the calculating of energy function.
The whole process that adopts Snakes (Snakes) model to carry out image Segmentation is that an iteration optimization is up to the convergent process.In this process, need to solve three problems:
A) initialization of profile, b) design of energy function, c) optimisation strategy.
The initialization of profile will be determined the initial position of point and the original shape and the size of target, adopts the interactive means manual drawing usually.
Optimisation strategy has determined the speed of iteration convergence.Optimize is exactly by calculating the internal energy and the external energy of initial estimation profile, constantly attributes such as the position of this estimation profile, shape are upgraded according to certain rule, till profile satisfied some predetermined constraint conditions, this was the process of an iteration.Here, can be at a certain size search window of one of the definition of each reference mark on the profile, the point of selecting to have minimum Snakes energy in each search window replaces original reference mark as new profile reference mark, and the rest may be inferred, up to satisfying stopping criterion for iteration.
Optimization is the important step that Snakes finds the solution.The initial estimation profile approaches to profile to be measured in optimizing process gradually, optimizes when finishing, and estimates that profile converges on the desired destination profile.Optimized Algorithm commonly used has: the variational method, dynamic programming, Greedy algorithm, simulated annealing etc., wherein the Greedy algorithm is most widely used method.
The Greedy method is a kind of improved dynamic programming method.It realizes the locally optimal solution of energy function, and time complexity only has O (nm).Therefore computing velocity is fast, and storage demand is less.To each some v i, its iterative step is as follows:
1) calculates E Snake(v i);
2) with v iOther p in some m * m neighborhood Jk, j, k ∈ [1, m] replaces v iPoint calculates E respectively Snake(p Jk), j, k ∈ [1, m];
3) note E Min=min (E Snake(p Jk), j, k ∈ [1, m]), if E Snake(v i)<E Min, v then iPoint is constant; Otherwise with v iPoint moves to corresponding to E MinThe neighborhood point.
The stop criterion of iteration is: the mobile or iterations that no longer produces the reference mark surpasses default maximal value.Fig. 6 is the synoptic diagram of Greedy algorithm, v among the figure iBe initial point, v i' be corresponding to E MinThe neighborhood point.Adopt 9 neighborhoods among the figure.
In image processing, because the condition difference of picture-taking, the parameter in the disposal route may be according to the actual conditions adjustment.The method of adjusting is, from the image that the same terms is taken, takes out a width of cloth or a few width of cloth, by experiment or trial method determine the occurrence of parameter.It also is like this adopting Snakes (Snakes) model to carry out image Segmentation.
Summary of the invention
The present invention just is based on above-mentioned Study on Technology, and the tongue body profile auto-initiation method based on Gray Projection and rigid template has realized cutting apart automatically of tongue image.
For with the tongue body zone automatically, split accurately and rapidly, the present invention has designed a kind of tongue body region segmentation method based on Snakes (Snakes) model.This method has been considered the characteristics such as color distortion of the shape, position, size of tongue body and tongue body zone and background area, and the design energy function carries out the profile initialization, and adopt easy, Local Optimization Algorithm to be to reach practical fast.Technical thought of the present invention is characterised in that:
1, according to the statistical study to the tongue body shape, defining one is the tongue body profile template of outer boundary with the rectangular area.By introducing this tongue body template, when cutting apart, added priori, as close as possible real tongue body profile in the time of can making the contour curve initialization about the tongue body shape.
2, adopt the Gray Projection analytic approach, obtain a rectangular area, the approximate location and the size of tongue body determined in this zone.
3, a kind of tongue body profile initial method based on Gray Projection and rigid template is proposed.
4, the priori that in the energy function of Snakes (Snakes) model, has added relevant tongue body profile.
5, through after tongue body profile initialization and having defined energy function, adopt Catmull-Rom batten Snakes (Snakes) model representation tongue body profile, and adopt existing Greedy method to be optimized, thus in colored tongue image, obtain the tongue body profile, be partitioned into the tongue body zone.
Technical scheme of the present invention is referring to Fig. 1, Fig. 2.The computing machine dividing method of this traditional Chinese medical science tongue picture based on batten Snakes (Snakes) model, be to finish the collection tongue image by digital camera, and the optical signalling of tongue body and colour code is converted to the electric signal image is input to computing machine and handles, operations such as transmission, it is characterized in that Computer Processing mainly is by USB interface software, on batten Snakes (Snakes) model based, tongue image is carried out read/write process, tongue image after the processing or tongue image carried out outputing to buffer after the dividing processing, through the display display result, it comprises the steps: successively
1) computing machine reads in the tongue image signal from USB interface, and is kept in the internal memory.The weighting parameter γ that energy in the Snakes model is calculated simultaneously 1, γ 2, α, β and iteration optimization algorithms maximum iteration time carry out initialization, the value of four parameters is obtained by trial method.
2) tongue image is carried out conversion, strengthening tongue body and the contrast between the background on every side, and color image is become gray scale image, conversion is carried out at each pixel, and transformation for mula is:
I ( x , y ) = R ( x , y ) - G ( x , y ) | G ( x , y ) - B ( x , y ) | + 1
R in the formula (x, y), G (x, y) and B (x y) is the original red, green, blue tristimulus values of pixel, and (x y) is the gray-scale value after the conversion to I.
Because we find that three chroma color value R, G, the B of tongue image pixel have following rule: the G value on the skin is greater than the G value at tongue edge, the G value on the tongue edge usually and the B value difference seldom or bigger, the G value on skin is then all greater than the B value; The R value of tongue and skin is all greater than G value and B value.According to these color component values relative nature to each other, for strengthening the gray difference of tongue body profile and background, we adopt the intensity transformation function of above tongue image.Through such conversion, the gray-scale value of tongue body part is higher, and the part gray-scale value beyond the tongue body is relatively low.
3) enter based on Gray Projection and rigid template, initialized profile initialization subroutine is carried out at batten Snakes (Snakes) model silhouette reference mark: promptly adopt the Gray Projection analytic approach, obtain a rectangular area, the approximate location and the size of tongue body determined in this zone.Earlier according to strengthening visual level and the gray scale of vertical direction or the feature of brightness projection, determine the border of a rectangular area, obtain 4 borders up and down of rectangular area thus, thereby the position and the size in tongue body zone have been determined, after having determined tongue body zone square boundary, calculating tongue body profile template is the rigidity deformation parameter λ on border at home and abroad, and then definite initial control point and profile, thereby finishes the auto-initiation of batten Snakes (Snakes) model.
4) be outstanding tongue body, make things convenient for the picture power of successive iterations process to calculate,, be divided into following a few step the line nonlinearity conversion of going forward side by side of tongue image thresholding:
1. to 2) in the enhancing image ask the maximal value maxI of gray-scale value, mean value meanI, and calculate maximum difference dI=maxI-meanI;
2. be threshold value with meanI,, will be changed to 0 less than the gray-scale value of meanI strengthening image thresholdingization;
3. the image behind the thresholding is carried out nonlinear transformation, transformation for mula is:
U ( x , y ) = ( I ( x , y ) - meanI dI ) γ
Exponent gamma in the formula is the nonlinear transformation parameter.
5) with the Greedy iteration optimization algorithms batten Snakes (Snakes) model is found the solution, solution procedure as previously mentioned, up to satisfying end condition: the position at an iteration rear profile reference mark no longer changes, or iterations reaches certain default maximal value, the iteration optimization subroutine call of profile reference mark finishes, obtain the final position at tongue body profile reference mark, adopt general Catmull-Rom spline interpolation formula to carry out spline interpolation, can obtain continuous tongue body contour curve.
6) adopt general Catmull-Rom spline interpolation formula to carry out spline interpolation, obtain continuous profile; The energy minimization of Snakes (Snakes) is to carry out on sparse discrete point, in order to obtain the continuous profile of target, need carry out interpolation and obtain accurate, continuous outline line.
7) will be positioned at by usual method that three chroma color values of pixel are changed to (255,255,255) (white) on the tongue body contour curve, save as destination file and output.
In addition according to the computing machine dividing method of above-described traditional Chinese medical science tongue picture based on batten Snakes (Snakes) model, wherein initialized profile initialization subroutine is carried out at batten Snakes (Snakes) model silhouette reference mark and is characterised in that, divide five stepping road wheels wide initialization:
1) on the basis that strengthens image, carry out the Gray Projection of horizontal direction, the characteristics of utilizing tongue body area grayscale projection value obviously to increase are from the middle part of projection, search for the position that first projection value reduces suddenly respectively left, to the right, obtain the border, the left and right sides of rectangular area;
2) center on border, the left and right sides is decided to be horizontal central line, and near the regional area the center line is defined as the center;
3) center is carried out the Gray Projection of vertical direction, because significant change often takes place near the enhancing gray-scale value the tongue body district lower boundary, so lower boundary is corresponding to the first order derivative maximal value of projection value;
4) center is carried out raw image brightness value (i.e. (R+G+B)/3) projection of vertical direction, owing to there is shade under the lip, the coboundary in tongue body zone is corresponding to the minimum value of projection value;
5) after above step is determined square boundary, according to the rigidity deformation parameter on border, tongue body profile template China and foreign countries, determine the initial position at profile reference mark, the computing method of deformation parameter are: the long L of being of outer boundary rectangle that establishes rigid template 0, wide is W 0, be respectively by above four positions in tongue image that go on foot the rectangle left and right sides up-and-down boundary that obtains: l 1, r 1, t 1, b 1, then the rectangular area is long is L=r-l, and wide is W=b-t, and deformation parameter is so: λ=(λ l, λ w), λ l=L/L 0, λ w=W/W 0, because the position, reference mark of profile template is that promptly the top left corner apex with this rectangle is coordinate center (0,0) with respect to the definition of outer boundary rectangle, so be (x if establish the coordinate position at i profile reference mark in the template 0i, y 0i), the coordinate at the initialization profile reference mark that then obtains is:
x i=l+λ lx 0i
y i=t+λ wy 0i
In addition the computing machine dividing method according to above-described traditional Chinese medical science tongue picture based on batten Snakes (Snakes) model is characterised in that: internal energy adopts common version, when the computational picture energy, at first the raw image thresholding is gone forward side by side the line nonlinearity conversion with outstanding tongue body, according to image intensity behind the thresholding and gradient calculation picture power, internal energy and picture power sum are the gross energy of Snakes (Snakes) model then.
For a certain profile reference mark v i, consider that tongue body profile in the tongue image meets the hypothesis of continuity and flatness, internal energy adopts common version, that is:
E internal(v i)=α(v i)E elas(v i)+β(v i)E bend(v i)
E elas ( v i ) = | ∂ V ∂ s | 2 ≈ | v i - v i - 1 | 2 d s 2 = ( x i - x i - 1 ) 2 + ( y i - y i - 1 ) 2 d s 2
E bend ( v i ) = | ∂ 2 V ∂ s 2 | 2 ≈ | v i - 1 - 2 v i + v i + 1 | 2 d s 4 = ( x i - 1 - 2 x i + x i + 1 ) 2 + ( y i - 1 - 2 y i + y i + 1 ) 2 d s 4
Wherein weighting parameter α, β control the degree of restraint to continuity and flatness respectively.
Picture power is
E image(v i)=γ 1U(v i)+γ 2|U(v i))| 2
Weighting parameter γ wherein 1, γ 2Control is to I (x, y) strength constraint and the gradient constraint of profile region; γ 1, γ 2Be made as negative value, make the maximum value that energy-minimum levels off to and the maximum value of gradient response,
External energy E External=0,
Total energy function is expressed as
E ( v i ) = α ( x i - x i - 1 ) 2 + ( y i - y i - 1 ) 2 d s 2 + β ( x i - 1 - 2 x i + x i + 1 ) 2 + ( y i - 1 - 2 y i + y i + 1 ) 2 d s 4
+ γ 1 U ( v i ) + γ 2 | ▿ U ( v i ) ) |
Other illustrates 2 points:
1, in the image processing, for some feature of outstanding concrete image, usually will do some conversion to image, promptly chromatic value or the gray-scale value to visual pixel carries out computing, claims such image enhancement that is transformed to again.For example, three chroma color value R of tongue image pixel, G, B have following rule: the G value on the skin is greater than the G value at tongue edge, the G value on the tongue edge usually and the B value difference seldom or bigger, the G value on skin is then all greater than the B value; The R value of tongue and skin is all greater than G value and B value.According to these color component values relative nature to each other, be to strengthen the gray difference of tongue body profile and background, we adopt tongue image intensity transformation function I (x, y):
I ( x , y ) = R ( x , y ) - G ( x , y ) | G ( x , y ) - B ( x , y ) | + 1
The nonlinear transformation of being carried out when the calculating energy function also is based on same reason, and introducing exponential transform is in order to give prominence to the contrast of tongue body and skin more.
2, the initialization of profile will be determined the initial position of point and the original shape and the size of target, adopts the interactive means manual drawing usually.Owing to the tongue body that will cut apart at native system in the tongue image, if can determine approximate location, size and the shape of tongue body automatically, then the profile initialization can be carried out automatically.The present invention just is based on such consideration, and the tongue body profile auto-initiation method based on Gray Projection and rigid template has realized cutting apart automatically of tongue image.Energy function will design according to image and the characteristics of cutting apart target.
Effect of the present invention is seen Fig. 7, Fig. 8.Adopt as can be seen based on batten Snakes (Snakes) model, and, can obtain tongue body profile accurately automatically in conjunction with the characteristics of tongue image.Do not need manual initialization, thereby created condition for subsequently accurate tongue picture analysis.
Description of drawings
Fig. 1 is a traditional Chinese medical science tongue picture segmenting system block diagram.
1, digital camera, 2, USB interface, 3, computer processor, 4, output buffers, 5, tongue body cuts apart, 6, display, 7, segmentation result;
Fig. 2 is the inventive method main program flow chart;
Fig. 3 is a profile initialization subroutine process flow diagram in the inventive method;
Fig. 4 is an iteration optimization subroutine flow chart in the inventive method;
Fig. 6 is a Greedy iteration optimization synoptic diagram among the present invention;
Fig. 7 is the initialization procedure example of profile
(a) horizontal Gray Projection, center line and center signal among the figure; (b) horizontal Gray Projection and left and right border signal; (c) first order derivative of vertical Gray Projection and lower boundary signal; (d) vertical color brightness projection and coboundary signal; (e) initialization result;
Fig. 8 is colored tongue image of a width of cloth and a segmentation result (white line is represented outline line) thereof among the present invention;
Fig. 9 is system's main program flow chart that the inventive method is moved on computers;
Figure 10 is the profile initialization subroutine process flow diagram that the inventive method is moved on computers;
Figure 11 is the iteration optimization subroutine flow chart that the inventive method is moved on computers.
Embodiment
In the traditional Chinese medical science tongue picture segmenting system block diagram of Fig. 1, digital camera and USB interface all are commercially available, mainly finish the collection tongue image, the optical signalling of tongue body and colour code is converted to visual electric signal is input to computing machine, are convenient to operations such as Computer Processing, transmission; Computer Processing mainly is by USB interface software tongue image to be carried out read/write process; Tongue image after the processing outputs to buffer, is convenient to show; Display is the output device of image, and human eye is watched raw image by display and cut apart the back image; It is that tongue image to computing machine reads in carries out dividing processing that tongue body is cut apart, the output result.Original tongue image can be the image that collects in real time by digital camera, also can be to realize by being kept at the image in the hard disc of computer after the digital camera collection.The tongue body segmenting system is finished following master routine in computing machine, referring to Fig. 8, Fig. 9:
1, under coloured target situation: initiation parameter l, r, t, b, δ, γ, α, β, γ 1, γ 2, w, N and tongue body template.Three color lump bars of Fig. 8 periphery) and the part more than the upper lip wherein l, r, t, b are default value, are in order to remove color scale space 9 colour codes:.Their value can be determined according to a width of cloth tongue image in advance.δ is a threshold value of asking border, the left and right sides used.Set in advance according to trial method.δ among the present invention=0.2.γ is the parameter that nonlinear transformation adopted, and establishes γ=0.15 herein.α, β, γ 1, γ 2Be the energy calculated weighting coefficient of Snakes (Snakes), the value of four parameters is obtained by trial method.Can be made as respectively in the present invention: α=0.5, β=3.0, γ 1=-0.2, γ 2=-1.0.The width of window was established w=3 when w was Snakes (Snakes) iteration optimization among the present invention.The maximum iterations of setting when N is iteration optimization, N=200 among the present invention.The tongue body template is represented with an array of representing a relative coordinate.Under colourless target situation: initiation parameter l=0, t=0, b are that image is high, and r is the figure image width.
2, tongue image is carried out conversion.The conversion individual element carries out.Transformation for mula is:
I ( x , y ) = R ( x , y ) - G ( x , y ) | G ( x , y ) - B ( x , y ) | + 1 .
3, tongue body profile initialization.Be divided into following each step:
The first step: calculate the horizontal direction projection that strengthens image.As previously mentioned, (x y) has the capable w row of h to strengthen visual I.Be listed as row since l, calculate the gray-scale value sum S that each lists all pixels (r-l+1 pixel altogether) up to r i, S i = Σ i = t b - 1 I ( i , j ) Obtain an array S, S=[S 1, S 2... S i... S r], this array promptly represents to strengthen the horizontal direction Gray Projection of image.Wherein l, r, t, b are default value, are in order to remove color scale space and the part more than the upper lip, to simplify the color characteristics of calculating and making full use of aforementioned tongue body, and are not subjected to the influence of color scale space.Their value can be determined according to a width of cloth tongue image in advance.
Second step: the characteristics of utilizing the projection of tongue body area grayscale obviously to increase, the border, the left and right sides of acquisition rectangular area.Method is:
From half j=[n/2 of projection array] beginning, first is less than δ to left search (promptly making j reduce 1) at every turn lS jWherein [n/2] expression rounds n/2.If promptly
S j<δ l (0<j<[n/2])
Straight line x=l then 1, l 1=j+l is decided to be the left margin of rectangular area.
From half j=[n/2 of projection array] beginning, first reaches in δ to right-hand search (promptly making j increase 1) at every turn rS jIf promptly
S j<δ l ([n/2]+1<j<r-l+1)
Straight line x=r then 1, r 1=j+l is decided to be the left margin of rectangular area.
The border promptly stops at the search in this zone after determining.In the formula, δ l, δ rBe preset threshold value, establish δ at this lr=δ (maxS-minS)+minS.MaxS, minS are respectively maximum, the minimum value of horizontal projection.δ sets in advance.δ among the present invention=0.2.
The 3rd step: with the center line x=[(l on border, the left and right sides 1+ r 1)/2] be decided to be horizontal central line, near the regional area the center line is defined as the center.If the width of central area is w 1, promptly from [(l 1+ r 1)/2]-w 1To [(l 1+ r 1)/2]+w 1Be the center.The width of central area can be decided to be half of border, left and right sides difference.
The 4th step: determine the rectangular area lower boundary.As previously mentioned, the Gray Projection of vertical direction is carried out in the center, because significant change often takes place near the enhancing gray-scale value the tongue body district lower boundary, so lower boundary is corresponding to the first order derivative maximal value of projection value.Method computing center district vertical direction projection by the above-mentioned first step.If the vertical projection array is P, P=[P 1, P 2... P i... P r], then the computing method of first order derivative are:
P i′=P i-P i-1,0<i<h
Ask the maximal value of first order derivative, according to aforementioned, the pairing position of first order derivative maximal value is lower boundary b 1
The 5th step: raw image brightness value (i.e. (R+G+B)/3) the projection V of vertical direction is carried out in the center, and the pairing position of the minimum value of V is the coboundary t in tongue body zone 1
The 6th step: calculate the deformation parameter of profile template,
λ=(λ l,λ w),λ l=L/L 0,λ w=W/W 0
Be calculated as follows the initial position at profile reference mark:
x i=l+λ lx 0i
y i=t+λ wy 0i
(x 0i, y 0i) be the coordinate position at i profile reference mark in the template.In the present invention, have 32 profile reference mark.These group data are kept in the array.
The profile initialization subroutine process flow diagram that Figure 10 moves on computers for the inventive method, Fig. 7 are the initialization procedure exemplary plot of profile.
4, to the line nonlinearity conversion of going forward side by side of tongue image thresholding.Be divided into following a few step:
1) the enhancing image that obtains in 2 is asked the maximal value maxI of gray-scale value, mean value meanI, and calculate maximum difference dI=maxI-meanI;
2) meanI is a threshold value, to strengthening image thresholdingization, will be changed to 0 less than the gray-scale value of meanI;
3) image behind the thresholding is carried out nonlinear transformation, transformation for mula is:
U ( x , y ) = ( I ( x , y ) - meanI dI ) γ
Exponent gamma in the formula is the nonlinear transformation parameter, is obtained by trial method.γ=0.15 in the present invention.
5, to tongue body profile iteration optimization.
Iterative process is seen Figure 11, is described below:
1) reads in profile reference mark initial coordinate.I is changed to 0 with iterations, will indicate whether to have the variable bMove of reference mark shift in position to be changed to vacation;
2) read in the coordinate at a profile reference mark;
3) energy of each point (w * w point altogether) in the calculation control vertex neighborhood one by one in size is the search window of w * w, and ask least energy, and write down the coordinate of the pairing point of least energy.Among the present invention, search window adopts 3 neighborhoods, i.e. w=3.Computing formula at energy function:
E ( v i ) = α ( x i - x i - 1 ) 2 + ( y i - y i - 1 ) 2 d s 2 + β ( x i - 1 - 2 x i + x i + 1 ) 2 + ( y i - 1 - 2 y i + y i + 1 ) 2 d s 4
+ γ 1 U ( v i ) + γ 2 | ▿ U ( v i ) ) |
In, ds=1, the value of four parameters is obtained by trial method, is respectively:
α=0.5,β=3.0,γ 1=-0.2,γ 2=-1.0。
4) this profile reference mark is moved to the energy smallest point.The coordinate that is about to this reference mark is revised as the coordinate of the pairing point of least energy.If the coordinate that reads in amended coordinate and the original coordinate (step 2)) different, make then that bMove is very, otherwise do not change the value of bMove;
5), then make iterations i increase by 1 if the profile reference mark disposes; Otherwise change two), handle next profile reference mark;
6) the true and false coordinate at reference mark that judges whether according to bMove changes.If no, then iteration finishes, return, otherwise;
7) judge that whether iterations i is less than default maximum iteration time N, if i<N then changes two), carry out the next round iteration, otherwise the iteration end is returned.
6, carry out spline interpolation according to the reference mark coordinate and obtain continuous contour curve, can adopt different battens.
Adopt Catmull-Rom batten spline interpolation method among the present invention.
For example the Catmull-Rom batten is a kind of local interpolation batten, and its i section Catmull-Rom batten can be expressed as:
Q i ( τ ) = ω i 1 ( τ ) Q i 1 ( τ ) + ω i 2 ( τ ) Q i 2 ( τ )
ω wherein i 1(τ), ω i 2Be the linear bending function of batten (τ), be defined as:
Figure C0210379700164
Q i 1(τ) be interpolation v I-1, v i, v I+1Second order polynomial, Q i 2(τ) be interpolation v I-1, v i, v I+1Second order polynomial, be defined as respectively:
Q i 1 ( τ ) = v i - 1 + ( τ - τ i - 1 ) ( - v i - 1 + v i - τ i - 1 + τ i + ( τ - τ i ) ( - - v i - 1 + v i - τ i - 1 + τ i + - v i + v i + 1 - τ i + τ i + 1 ) - τ i - 1 + τ i + 1 )
Q i 2 ( τ ) = v i + ( τ - τ i ) ( - v i + v i + 1 - τ i + τ i + 1 + ( τ - τ i + 1 ) ( - - v i + v i + 1 - τ i + τ i + 1 + - v i + 1 + v i + 2 - τ i + 1 + τ i + 2 ) - τ i + τ i + 2 )
Non-homogeneous parametric method is adopted in the definition of the parameter τ of batten model, makes it be proportional to Euclidean distance between the reference mark, and recursion formula is:
τ i - τ i - 1 τ i + 1 - τ i = | | v i - v i - 1 v i + 1 - v i | |
Optional τ 1=0 and τ n=1.
And the outline line that will finally obtain is represented (tristimulus values that are about to this pixel are changed to (255,255,255)) with white line.
7, output segmentation result
Fig. 8 is a width of cloth tongue image segmentation result.

Claims (3)

1、基于样条思内克斯(Snakes)模型的中医舌象计算机分割方法,是由数码相机完成采集舌图象,并将舌体及色标的光学信号转换为图象电信号输入到计算机进行处理、传输等操作,该方法特征在于计算机处理主要是通过USB接口软件对舌图像进行读/写处理,对处理后的舌图像在样条思内克斯(Snakes)模型的基础上进行分割处理后输出到缓存器,经显示器显示结果,它依次包括下述步骤:1. The computerized tongue image segmentation method based on the spline Snakes model is to collect the tongue image by a digital camera, and convert the optical signal of the tongue body and the color code into an image electrical signal and input it to the computer for further processing. Processing, transmission and other operations, the method is characterized in that the computer processing is mainly to read/write the tongue image through the USB interface software, and the processed tongue image is segmented on the basis of the spline Snakes (Snakes) model After output to the register, the result is displayed on the monitor, which includes the following steps in turn: 1)计算机从USB接口读入舌图象信号,并保存在内存中;同时对思内克斯模型中能量计算的权值参数γ1、γ2、α、β和迭代优化算法的最大迭代次数进行初始化,四个参数的取值由试探法获得,1) The computer reads the tongue image signal from the USB interface and saves it in the memory; at the same time, the weight parameters γ 1 , γ 2 , α, β and the maximum iteration number of the iterative optimization algorithm in the Sinex model are calculated Initialize, the values of the four parameters are obtained by heuristics, 2)对舌图象进行变换,以增强舌体与周围背景之间的对比度,并将彩色图象变为灰度图象,变换针对各像素进行,变换公式为:2) Transform the tongue image to enhance the contrast between the tongue body and the surrounding background, and change the color image into a grayscale image. The transformation is carried out for each pixel. The transformation formula is: II (( xx ,, ythe y )) == RR (( xx ,, ythe y )) -- GG (( xx ,, ythe y )) || GG (( xx ,, ythe y )) -- BB (( xx ,, ythe y )) || ++ 11 式中R(x,y)、G(x,y)和B(x,y)为像素的原始红、绿、蓝三色值,I(x,y)为变换后的灰度值;In the formula, R(x, y), G(x, y) and B(x, y) are the original red, green and blue color values of the pixel, and I(x, y) is the transformed gray value; 3)进入基于灰度投影与刚性模板,对样条思内克斯(Snakes)模型轮廓控制点进行初始化的轮廓初始化子程序:即采用灰度投影分析法,获得一个矩形区域,该区域确定了舌体的大致位置和大小,先根据增强图象水平和垂直方向的灰度或亮度投影的特征,确定一矩形区域的边界,由此获得矩形区域的上下左右4个边界,从而确定了舌体区域的位置和大小,在确定了舌体区域矩形边界后,计算舌体轮廓模板中外边界的刚性形变参数入,进而确定初始控制点和轮廓,从而完成样条思内克斯(Snakes)模型的自动初始化;3) Enter the outline initialization subroutine based on grayscale projection and rigid template to initialize the outline control points of the spline Snakes model: that is, use the grayscale projection analysis method to obtain a rectangular area, which determines the For the approximate position and size of the tongue body, first determine the boundary of a rectangular area according to the characteristics of the grayscale or brightness projection in the horizontal and vertical directions of the enhanced image, and thus obtain the four boundaries of the upper, lower, left, and right sides of the rectangular area, thereby determining the tongue body The position and size of the area, after determining the rectangular boundary of the tongue area, calculate the rigid deformation parameters of the outer boundary in the tongue outline template, and then determine the initial control points and outline, so as to complete the spline Snakes (Snakes) model automatic initialization; 4)对舌图象阈值化并进行非线性变换,分为以下几步:4) Thresholding the tongue image and performing nonlinear transformation is divided into the following steps: ①对2)中的增强图象求灰度值的最大值maxI,平均值meanI,并计算最大差值dI=maxI-meanI;1. the enhanced image in 2) is asked for the maximum value maxI of the gray value, the average value meanI, and calculates the maximum difference dI=maxI-meanI; ②以meanI为阈值,对增强图象阈值化,将小于meanI的灰度值置为0;2. take meanI as the threshold value, thresholding the enhanced image, and setting the gray value less than meanI to 0; ③对阈值化后的图象进行非线性变换,变换公式为:③ Perform nonlinear transformation on the thresholded image, the transformation formula is: Uu (( xx ,, ythe y )) == (( II (( xx ,, ythe y )) -- meanImeanI dIiGO )) γγ 式中的指数γ为非线性变换参数;The exponent γ in the formula is a nonlinear transformation parameter; 5)用Greedy迭代优化算法对样条思内克斯(Snakes)模型进行求解,求解步骤采用通用方法,直到满足终止条件,一次迭代后轮廓控制点的位置不再发生变化,或迭代次数达到某个预设的最大值,轮廓控制点迭代优化子程序调用结束,得到舌体轮廓控制点的最终位置,采用通用Catmull-Rom样条内插公式进行样条内插,即可得到连续的舌体轮廓曲线;5) Use the Greedy iterative optimization algorithm to solve the spline Snakes model. The general method is used for the solution step until the termination condition is met, and the position of the contour control point does not change after one iteration, or the number of iterations reaches a certain value. A preset maximum value, the contour control point iterative optimization subroutine is called, and the final position of the tongue contour control point is obtained, and the general Catmull-Rom spline interpolation formula is used for spline interpolation to obtain a continuous tongue body contour curve; 6)采用通用Catmull-Rom样条内插公式进行样条内插,得到连续轮廓;6) The general Catmull-Rom spline interpolation formula is used for spline interpolation to obtain continuous contours; 7)按通常方法将位于舌体轮廓曲线上像素的三色色度值置为(255,255,255)(白色),保存为结果文件并输出。7) Set the three-color chromaticity value of the pixel on the tongue contour curve to (255, 255, 255) (white) according to the usual method, save it as a result file and output it. 2、根据权利要求1所述的基于样条思内克斯(Snakes)模型的中医舌象计算机分割方法,其中对样条思内克斯(Snakes)模型轮廓控制点进行初始化的轮廓初始化子程序的特征在于,分五步进行轮廓初始化:2, the traditional Chinese medical science tongue image computer segmentation method based on spline Si Nikes (Snakes) model according to claim 1, wherein the contour initialization subroutine that spline Si Nex (Snakes) model contour control point is initialized is characterized by contour initialization in five steps: 1)在增强图象的基础上,进行水平方向的灰度投影,利用舌体区域灰度投影明显增高的特点,从投影的中部开始,分别向左、向右搜索第一个投影突然减小的位置,获得矩形区域的左右边界;1) On the basis of enhancing the image, carry out horizontal grayscale projection, using the characteristics of the tongue body area grayscale projection being significantly higher, starting from the middle of the projection, search for the first projection to the left and right and suddenly decrease , get the left and right boundaries of the rectangular area; 2)左右边界的中心定为水平中线,将中线附近的局部区域定义为中心区;2) The center of the left and right boundaries is defined as the horizontal midline, and the local area near the midline is defined as the central area; 3)将中心区进行垂直方向的灰度投影,由于舌体区下边界附近的增强灰度值常发生明显变化,因此下边界对应于投影值的一阶导数最大值;3) The central area is grayscale projected in the vertical direction. Since the enhanced grayscale value near the lower boundary of the tongue body often changes significantly, the lower boundary corresponds to the maximum value of the first derivative of the projection value; 4)将中心区进行垂直方向的原始图象亮度值(即(R+G+B)/3)投影,由于存在唇下阴影,舌体区域的上边界对应于投影值的最小值;4) Project the original image luminance value (i.e. (R+G+B)/3) in the vertical direction to the center area, because there is a shadow under the lip, the upper boundary of the tongue body area corresponds to the minimum value of the projection value; 5)以上步骤确定矩形边界后,根据舌体轮廓模板中外边界的刚性形变参数,确定轮廓控制点的初始位置,形变参数的计算方法为:设刚性模板的外边界矩形长为L0,宽为W0,由以上四步得到的矩形左右上下边界的在舌图象中的位置分别为:l1、r1、t1、b1,则矩形区域长为L=r-l,宽为W=b-t,那么形变参数为:λ=(λl,λw),λl=L/L0,λw=W/W0,由于轮廓模板的控制点位置是相对于外边界矩形定义,即以该矩形的左上角顶点为坐标中心(0,0),所以若设模板中第i个轮廓控制点的坐标位置为(x0i,y0i),则得到的初始化轮廓控制点的坐标为:5) After determining the rectangular boundary in the above steps, determine the initial position of the contour control point according to the rigid deformation parameters of the outer boundary in the tongue contour template. W 0 , the positions of the left and right upper and lower boundaries of the rectangle obtained in the above four steps in the tongue image are: l 1 , r 1 , t 1 , b 1 , then the length of the rectangular area is L=rl, and the width is W=bt , then the deformation parameters are: λ=(λ l , λ w ), λ l =L/L 0 , λ w =W/W 0 , since the position of the control point of the contour template is defined relative to the outer boundary rectangle, that is, the The upper-left vertex of the rectangle is the coordinate center (0, 0), so if the coordinate position of the i-th contour control point in the template is set to (x 0i , y 0i ), the coordinates of the initialized contour control point obtained are:             xi=l+λlx0i x i =l+λ l x 0i             yi=t+λwy0iy i =t+λ w y 0i . 3、根据权利要求1所述的基于样条思内克斯(Snakes)模型的中医舌象计算机分割方法,其特征在于:内部能量采用通用形式,在计算图象能量时,首先对原始图象阈值化并进行非线性变换以突出舌体,然后根据阈值化后的图象强度和梯度计算图象能量,内部能量与图象能量之和为思内克斯(Snakes)模型的总能量;3. The computerized method for segmenting tongue images in traditional Chinese medicine based on the spline Snakes (Snakes) model according to claim 1 is characterized in that: the internal energy adopts a general form, and when calculating the image energy, at first the original image Thresholding and performing nonlinear transformation to highlight the tongue, then calculating the image energy based on the thresholded image intensity and gradient, the sum of internal energy and image energy is the total energy of the Snakes model; 对于某一轮廓控制点vi,内部能量采用通用形式,即:Einternal(vi)=α(vi)Eelas(vi)+β(vi)Ebend(vi)For a contour control point v i , the internal energy adopts a general form, namely: E internal (v i )=α(v i )E elas (v i )+β(v i )E bend (vi) EE. elaselas (( vv ii )) == || ∂∂ VV ∂∂ sthe s || 22 ≈≈ || vv ii -- vv ii -- 11 || 22 dsds 22 == (( xx ii -- xx ii -- 11 )) 22 ++ (( ythe y ii -- ythe y ii -- 11 )) 22 dsds 22 EE. bendbend (( vv ii )) == || ∂∂ 22 VV ∂∂ sthe s 22 || 22 ≈≈ || vv ii -- 11 -- 22 vv ii ++ vv ii ++ 11 || 22 dsds 22 == (( xx ii -- 11 -- 22 xx ii ++ xx ii ++ 11 )) 22 ++ (( ythe y ii -- 11 -- 22 ythe y ii ++ ythe y ii ++ 11 )) 22 dsds 44 其中权值参数α、β分别控制对连续性和平滑性的约束程度,Among them, the weight parameters α and β respectively control the degree of constraint on continuity and smoothness, 图象能量为:The image energy is:         Eimage(vi)=γ1U(vi)+γ2|U(vi))|2 E image (v i )=γ 1 U(v i )+γ 2 |U(v i ))| 2 其中权值参数γ1、γ2控制对轮廓所在区域的I(x,y)强度约束和梯度约束,γ1、γ2设为负值,使能量最小值趋近于的极大值以及梯度响应的极大值,Among them, the weight parameters γ 1 and γ 2 control the I(x, y) intensity constraint and gradient constraint on the area where the contour is located, and γ 1 and γ 2 are set to negative values, so that the energy minimum value approaches the maximum value and the gradient The maximum value of the response, 外部能量Eexternal=0External energy E external =0 总能量函数表示为:The total energy function is expressed as: EE. (( vv ii )) == αα (( xx ii -- xx ii -- 11 )) 22 ++ (( ythe y ii -- ythe y ii -- 11 )) 22 dsds 22 ++ ββ (( xx ii -- 11 -- 22 xx ii ++ xx ii ++ 11 )) 22 ++ (( ythe y ii -- 11 -- 22 ythe y ii ++ ythe y ii -- 11 )) 22 dsds 44 + γ 1 U ( v i ) + γ 2 | ▿ U ( v i ) ) | + γ 1 u ( v i ) + γ 2 | ▿ u ( v i ) ) | .
CNB021037973A 2002-03-25 2002-03-25 Computer Segmentation Method of TCM Tongue Image Based on Spline Snakes Model Expired - Fee Related CN1169079C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB021037973A CN1169079C (en) 2002-03-25 2002-03-25 Computer Segmentation Method of TCM Tongue Image Based on Spline Snakes Model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB021037973A CN1169079C (en) 2002-03-25 2002-03-25 Computer Segmentation Method of TCM Tongue Image Based on Spline Snakes Model

Publications (2)

Publication Number Publication Date
CN1367455A CN1367455A (en) 2002-09-04
CN1169079C true CN1169079C (en) 2004-09-29

Family

ID=4739903

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB021037973A Expired - Fee Related CN1169079C (en) 2002-03-25 2002-03-25 Computer Segmentation Method of TCM Tongue Image Based on Spline Snakes Model

Country Status (1)

Country Link
CN (1) CN1169079C (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100375979C (en) * 2006-09-15 2008-03-19 清华大学 Tongue Segmentation and Extraction Method of Color Digital Photos of Tongue Used in TCM Tongue Diagnosis
CN101673345B (en) * 2009-07-01 2012-05-09 北京交通大学 Method for extracting target closed contour based on shape prior

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100506085B1 (en) * 2002-12-28 2005-08-05 삼성전자주식회사 Apparatus for processing tongue image and health care service apparatus using tongue image
CN1766929B (en) * 2004-10-29 2010-05-12 中国科学院计算技术研究所 A Motion Reconstruction Method for Moving Objects Based on 3D Database
CN100405402C (en) * 2006-08-18 2008-07-23 清华大学 Segmentation and Extraction of Tongue Coating in Color Digital Photos of Tongue
CN101576913B (en) * 2009-06-12 2011-09-21 中国科学技术大学 Tongue Image Automatic Clustering, Visualization and Retrieval Method Based on Self-Organizing Map Neural Network
WO2011004640A1 (en) * 2009-07-09 2011-01-13 コニカミノルタエムジー株式会社 Contour extraction device and program
CN102781305B (en) 2010-03-09 2015-06-03 奥林巴斯株式会社 Fluorescent endoscope device
JP5816486B2 (en) * 2011-08-18 2015-11-18 オリンパス株式会社 Fluorescence observation apparatus, fluorescence observation system, and fluorescence image processing method of fluorescence observation apparatus
JP5926909B2 (en) 2011-09-07 2016-05-25 オリンパス株式会社 Fluorescence observation equipment
CN102509312B (en) * 2011-09-20 2013-10-02 哈尔滨工业大学 Color range space of human body digital tongue image color and extraction method thereof
CN102509279B (en) * 2011-11-02 2013-11-06 北京工业大学 Self-adapting shaded-area detail reproduction method for tongue image with sufficient root-part illumination
CN104537379A (en) * 2014-12-26 2015-04-22 上海大学 High-precision automatic tongue partition method
CN108629780B (en) * 2018-04-23 2020-01-03 闽江学院 Tongue image segmentation method based on color decomposition and threshold technology
CN108615239B (en) * 2018-05-10 2020-03-27 福建中医药大学 Tongue Image Segmentation Method Based on Thresholding Technique and Grayscale Projection

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100375979C (en) * 2006-09-15 2008-03-19 清华大学 Tongue Segmentation and Extraction Method of Color Digital Photos of Tongue Used in TCM Tongue Diagnosis
CN101673345B (en) * 2009-07-01 2012-05-09 北京交通大学 Method for extracting target closed contour based on shape prior

Also Published As

Publication number Publication date
CN1367455A (en) 2002-09-04

Similar Documents

Publication Publication Date Title
CN1169079C (en) Computer Segmentation Method of TCM Tongue Image Based on Spline Snakes Model
CN1203453C (en) Automatic coloring of exposed pixels during zone processing of image
CN107516319B (en) High-precision simple interactive matting method, storage device and terminal
CN1245033C (en) Apparatus and method for adjusting color saturation of color image
CN1475969A (en) Method and system for intensify human image pattern
US7557812B2 (en) Multilevel texture processing method for mapping multiple images onto 3D models
CN101079952A (en) Image processing method and image processing apparatus
CN1676104A (en) Apparatus and method for forming a 3D ultrasound image
CN1825974A (en) Color conversion apparatus and method for selectively adjusting input image colors
CN1714372A (en) Image signal processing
CN1932847A (en) Method for detecting colour image human face under complex background
CN108182671B (en) Single image defogging method based on sky area identification
CN110853064B (en) An Image Cooperative Segmentation Method Based on Minimum Fuzzy Divergence
CN1343421A (en) Image interpolation system and image interpolocation method
CN102609909A (en) Method and device for defogging single image
CN1837853A (en) A seam elimination method in remote sensing image mosaic
CN1920854A (en) Tongue division and extracting method for tongue diagnosis used colored digital photo of tongue in Chinese traditional medicine
CN100345160C (en) Histogram equalizing method for controlling average brightness
CN1224242C (en) Method for fast picking up picture with any image as background in digital image process
CN1908984A (en) Coated tongue division and extracting method for colored digital photo of tongue
CN110610491B (en) Liver tumor region segmentation method of abdominal CT image
CN1269347C (en) Photographic device, photographic method and recording medium
CN1466737A (en) Image conversion and encoding techniques
CN1260682C (en) Natural image scratching method in digital image treatment based on HVS precessing
CN113436206A (en) Pathological tissue section scanning area positioning method based on cluster segmentation

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C19 Lapse of patent right due to non-payment of the annual fee
CF01 Termination of patent right due to non-payment of annual fee