(5) embodiment
The below at first illustrates the principles of science of the important step institute foundation in the above-mentioned algorithm:
The two-dimentional match that A, based on data excavate
1) mapping relations of area sampling and point sampling
Pixel value on the CT image is the area sampling value, and supposing has n * n pixel on one deck CT image, and then these pixels are the area sampling values that obtain at n * n unit area from space curved surface.Show that for example, during the scaling conversion, ideal situation is to obtain the curved surface that approaches of luv space curved surface carrying out image, then carry out resampling approaching curved surface, obtain to approach curved surface in the area sampling value of each new region.Therefore, if can obtain according to the area sampling value of CT image the more accurate point sampling value of this regional center point, just can according to these point sampling values construct precision higher approach curved surface.So, need to carry out pre-service to the area sampling value of CT image, obtain more accurate point sampling value.We adopt data mining technology to be asked by given pixel and approach curved surface.
Set up now the mapping relations of area sampling and point sampling, the situation of one dimension be discussed first:
If f (x) was n some P
i(i=0,1,2 ..., curve n-1),
(i=0,1,2 ..., n-1) be from this curve obtain corresponding to the zone [x
i, x
I+1] n area sampling value, then have following relation to set up:
By (1) formula as can be known, by setting up interpolation point P
iWith the area sampling value
(i=0,1,2 ..., relation n-1), can by
Obtain P
j(i=0,1,2 ..., n-1), namely obtain more accurate point sampling value by the area sampling value.
The situation of two dimension is discussed again:
If P (x, y) represents a curved surface, P
Ij(i, j=0,1,2 ..., n-1) be n * n point on this curved surface, obviously, P (x, y) can put approximate representation by this n * n.Again
(i, j=0,1,2 .., n-1) be from curved surface P (x, y) obtain corresponding to regional A
IjN * n area sampling value, then have following relation to set up:
Wherein, S
IjRepresent regional A
IjArea.
By (2) formula as can be known, by setting up some P
IjWith the area sampling value
(i, j=0,1,2 ..., relation n-1), can by
Obtain P
Ij(i, j=0,1,2 ..., n-1), namely obtained the approximate value of point sampling value by the area sampling value.
By the mapping relations of above-mentioned zone sampling and point sampling as can be known, by curve construction/curved surface, can be obtained by the area sampling value of known CT image comparatively accurately point sampling value.
2) calculating of point sampling value
This algorithm utilizes the mapping relations of above-mentioned area sampling and point sampling, on the basis of CT area sampling data, obtains the point sampling value of more accurate CT pixel, adopts secondary Lagrange's interpolation curved surface to approach original curved surface in the mapping process.In addition, the interior pixels point of CT image has been taked different disposal routes with the boundary pixel point, made the sampled value of the pixel that obtains more reasonable and accurate.
If
(i, j=0,1,2 ..., n-1), be n * n pixel value on the tomographic image, A
Ij(i, j=0,1,2 ..., n-1) expression is with (x
j, y
i) centered by unit square, we wish to try to achieve point (x
j, y
i) the more accurate sampled value P that locates
Ij(i, j=0,1,2 ..., n-1).
Calculation level (x
1, y
1) the sampled value P that locates
11Algorithm idea as follows:
1, by summit P
Ij(i, j=0,1,2) obtains a secondary lagrangian fit curved surface P (x, y);
2, according to the mapping relations of (2) formula, with P (x, y) respectively at A
IjCarry out integration on (i, j=0,1,2) zone, integrated value equals the known pixel value on this zone
(i, j=0,1,2) multiply by regional A
IjThe area of (i, j=0,1,2);
3, obtain nine yuan of linear function groups by the 2nd step, find the solution and to get P
IjThe value of (i, j=0,1,2).We only keep P
11Value because it is that relative accuracy is the highest in nine new values, the value of other points can adopt same process to obtain.
Specifically being calculated as follows of its each step:
Step 1: utilize summit P
IjSecondary lagrangian fit curved surface of (i, j=0,1,2) structure, surface equation is:
Step 2: the lagrangian fit curved surface P (x, y) that (3) formula is represented is at regional A
IjCarry out integration on (i, j=0,1,2), and integrated value equals
(i, j=0,1,2) and A
IjThe product of (i, j=0,1,2) area, again A
Ij(i, j=0,1,2) is unit square, so integration satisfies following relational expression:
Step 3: can obtain one with P by (3) and (4)
Ij(i, j=0,1,2) is nine yuan of linear function groups of unknown quantity, separates this system of equations and can obtain P
IjThe value of (i, j=0,1,2).Wherein, we only keep P
11Value.
In the above-mentioned steps, the integral process of (3) formula is actually Lagrangian basis function is carried out integration, is easy to obtain a general expression formula, calculates simple, convenient.In addition, the matrix of coefficients of the system of equations in the step 3 all is identical in all cases, therefore, can obtain first the inverse matrix of matrix of coefficients, then this inverse matrix is used for the solving equation group, thereby has improved the travelling speed of system, has reduced the complexity of system.Inverse matrix is as follows:
The structure of B, Coons curved surface
1) utilize the shape preserving interpolation algorithm carry out each picture element at u to the derivative that makes progress with v.Put P with adjacent image point
I-1, j, P
I, jAnd P
I+1, jThree point estimation P
I, jThe place u to derivative (P '
I, j)
u, use pixel P
I, j-1, P
I, jAnd P
I, j+1Three point estimation P
I, jThe place v to derivative (P '
I, j)
vThe below with (P '
I, j)
uBe example, carry out finding the solution of each picture element derivative.Along u to getting 3 P
I-1, j, P
I, jAnd P
I+1, jThe structure interpolation curve, owing to the step-length such as be between 3, the curve of establishing three point interpolation is P (t), then its first order derivative is calculated as follows:
(P′
i,j)
u=(P
i+1,j-P
i-1,j)/2 (5)
To border data point P
1, jAnd P
N, j, utilize following formula calculate (P '
1, j)
u=2 (P
2, j-P
1, j)-(P '
2, j)
u, (P '
N, j)
u=2 (P
N, j-P
N-1, j)-(P '
N-1, j)
u
Directly estimate that by (5) formula three Hermite curves of derivative structure do not have the shape of data point suggestion sometimes, this is unacceptable to clinical practice.Therefore need to apply to the derivative that (5) formula is estimated certain constraint, make the cubic curve of structure have the shape of data point suggestion.Theoretical analysis is known, constructs three Hermite curves by the derivative of (5) formula definition, if curve has identical monotonicity and convexity with data point, then (P '
I, j)
iNeed satisfy following condition
Wherein, Δ P
I-1, j=P
I, j-P
I-1, j, Δ P
I, j=P
I+1, j-P
I, j
(6) characteristics of the derivative of formula definition be the maximal value of three Hermite curves of constructing less than the maximal value of given data point, minimum value is greater than the minimum value of given data point.In order to improve interpolation precision and to obtain more rational curve shape, we do reduction to the constraint of (6) formula and process, and estimate derivative by (5) formula first, then it are according to circumstances adjusted.Selection mode is as follows:
If 1. for P
I-2, j, P
I-1, j, P
I, jAnd P
I+1, jThe broken line of four some formation is dull non-protruding situations, and we can directly select the derivative of (6) definition to estimate, just can satisfy guarantor's type requirement of Coons interpolation.
If 2. for P
I-2, j, P
I-1, j, P
I, jAnd P
I+1, jFour points couple together and form a plane convex polygon, and we need to do reduction to the constraint of (6) formula and process, and process as follows:
To P
I-1, j, P
I, jValue and (P '
I, j)
uCarrying out interpolation, to get curve as follows:
P=a
1u
2+b
1u+c
1 (7)
Wherein
b
1=(P′
i,j)
u-2a
1u
i,j,
To P
I-1, j, P
I, jValue and (P '
I-1, j)
uCarrying out interpolation, to get curve as follows:
Q=a
2u
2+b
2u+c
2 (8)
By point (P
I-2, j, u
I-2, j) and (P
I-1, j, u
I-1, j) straight line that consists of is:
P1=(P
i-1,j-P
i-2,j)(u-u
i-1,j)+P
i-1,j=A
1u+B
1 (9)
By (P
I, j, u
I, j) and (P
I+1, j, u
I+1, j) straight line that consists of is:
P2=(P
i+1,j-P
i,j)(u-u
i,j)+P
i,j=A
2u+B
2 (10)
Remember that it is (u that two straight lines intersect intersection point
Imid, j, P
Imid, j), following formula is found the solution
P-P1=a
1u
2+b
1u+c
1-(P
i,j-P
i-1,j)(u-u
i-1,j)-P
i-1,j=0 (11)
Then formula (15) has a solution at least, and namely interpolation curve and straight line P1 intersect at the end points place at least, and the end points solution is (P
I-1, j, u
I-1, j).And if have non-end points solution u
p, and satisfy u
I-1, j<u
p<u
Imid, j, prove that then interpolation curve P is not at a P
I-1, j, P
Imid, j, P
I, jIn the convex closure that surrounds, this just need to adjust (P '
I, j)
uAdjust (P '
I, j)
uAfter, as long as make interpolation curve and straight line P
1Tangent, just can make the interpolation curve P of acquisition at three some P
I-1, j, P
Imid, jAnd P
I, jConvex closure within, namely satisfy following condition:
The solving equation group can get after (12) (P '
I, j)
u, then (P '
I, j)
uCan satisfy the requirement of guarantor's type.
In like manner, following formula is found the solution:
Q-P2=a
2u
2+b
2u+c
2-(P
i+1,j-P
i,j)(u-u
i,j)-P
i,j=0 (13)
Then formula (13) is except end points solution (P
I, j, u
I, j), may there be non-end points solution u
qIf satisfy u
Imid, j<u
q<u
I, j, prove that then interpolation curve Q is not at a P
I-1, j, P
Imid, j, P
I, jIn the convex closure that surrounds, this just need to adjust (P '
I-1, j)
uAdjust (P '
I-1, j)
uAfter, as long as so that curve Q and straight line P2 tangent, Q is at a P
I-1, j, P
Imid, j, P
I, jIn the convex closure that surrounds, namely satisfy following condition:
The solving equation group can get after (14) (P '
I-1, j)
u, then (P '
I-1, j)
uCan satisfy the requirement of guarantor's type.
For (P '
I, j)
vFind the solution and adjustment and above-mentioned (P '
I, j)
uFind the solution and adjust similar, do not repeat them here.
2) the second order local derviation is estimated
The calculating of second order local derviation is usually very complicated, and in the present invention, we have selected a kind of fairly simple method of estimation.By finding the solution u to the single order local derviation, find the solution v to the single order local derviation, get it and on average then get P
I, jThe second order local derviation at place is calculated as follows:
(P″
i,j)
uv=(P
i+1,j-P
i-1,j+P
i,j+1+P
i,j-1)/4
3) structure P
I, j, P
I+1, j, P
I, j+1, P
I+1, j+1The bicubic Coons patch P that surrounds
Ij(u, v).
Bicubic Coons patch is the curved surface of being vowed, being led resultant second order local derviation information definition by the point of adjacent 4 corner points, is used for carrying out interpolation between one group of data point.For image, the Coons curved surface is applied to the interpolation of pixel gray-scale value.Get the image of a width of cloth m * n, for its each by adjacent four pixels, such as P
I, j, P
I+1, j, P
I, j+1, P
I+1, j+1Structure bicubic Coons interpolation curved surface is designated as P on the zone that surrounds
Ij(u, v).
Above-mentioned four parameter values corresponding to angle point are respectively (0,0), (1,0), (0,1), (1,1), then to above-mentioned four summit pixel value P (0,0), P (1,0), P (0,1), P (1,1), and four summits cut resultant second order local derviation totally 16 interpolation information carry out the bicubic Coons curved surface P (u, v) of interpolation, u, v ∈ [0,1] * [0,1] is defined as follows:
u,v∈[0,1]×[0,1](15)
Wherein
P is the gray-scale value of given picture element, P
u, P
vRepresent that respectively u is to vowing P with guide v
UvThen represent the second order local derviation.In the practical application, only can obtain the gray-scale value of each pixel of piece image, by 1) and 2) part as can be known, utilize the method for shape preserving interpolation algorithm and simple method of estimation second order local derviation can obtain each picture element at u to the derivative and the second order local derviation that make progress with v, substitution formula (1) bicubic Coons patch P
Ij(u, v).
C, resample according to the scaling ratio
1) according to the scaling ratio Coons patch is resampled
If image needs amplifieroperation, we need to resample to original image according to the scaling ratio.The bicubic Coons interpolation curved surface of above-mentioned structure is applied to the gradation of image interpolation, and new sampled point is taken from this bicubic Coons interpolation curved surface sheet.
Suppose that the image enlargement factor is s, then original image I (u, v) is at u, and the v direction resamples according to the interval of l/s, namely obtains amplifying the image after s times.Digital picture I (u, the v) interpolation that is about to m * n is the image I of m ' * n ' ' (u ', v ').Wherein
m′=m*s;
n′=n*s;
Then resample points I ' (u ', v ') corresponding to the position of the pixel in the original image is:
u=u′/s;
v=v′/s;
The label of this pixel bicubic Coons patch at place in original image is i=int (u), j=int (v), and then according to this interpolation curved surface sheet (1) of hole of structure, the gray-scale value of resample points I ' (u ', v ') is P
Ij(u-i, v-j).
By the process that obtains the CT data as can be known, the CT data value of each pixel in fact is the mean value of the density of its place voxel, is an area sampling value, rather than this an accurate point sampling value.So during resampling, we also adopt area sampling to obtain the gray-scale value of resample points.Here we also adopt area sampling to obtain the gray-scale value of resample points.With the gray-scale value of the mean value on certain zonule, resample points place as resample points:
Wherein A is resample area.If on the border of former Coons patch, then the value of its area sampling should be determined by its two adjacent Coons curved surfaces resample points jointly just.That is:
By choosing different sampling densities, calculate the color value of sampled point by above-mentioned formula, just can obtain the image of any scaling ratio.
2) the quick calculating of image zooming
If integral domain is (x1, x2) ﹠amp; (y1, y2) then according to the expression-form (15) of Coons curved surface, finds the solution (16), gets (17) formula
I=(IntegralF
0(x2)-IntegralF
0(x1))*(P
i,j*(IntegralF
0(y2)-IntegralF
0(y1))+P
i,j+1*(IntegralF1(y2)-IntegralF1(y1))+(P′
i,j)
v*(IntegralG0(y2)-IntegralG0(y1))+(P′
i,j+1)
v*(IntegralG1(y2)-IntegralG1(y1)))+(IntegralF1(x2)-IntegralF1(x1))*(P
i+1,j*(IntegralF0(y2)-IntegralF0(y1))+P
i+1,j+1*(IntegralF1(y2)-IntegralF1(y1))+(P′
i+1,j)
v*(IntegralG0(y2)-IntegralG0(y1))+(P′
i+1,j+1)
v*(IntegralG1(y2)-IntegralG1(y1)))+(IntegralG0(x2)-IntegralG0(x1))*((P′
i,j)
u*(IntegralF0(y2)-IntegralF0(y1))+(P′
i,j+1)
u*(IntegraIF1(y2)-IntegralF1(y1))+(P″
i,j)
uv*(IntegralG0(y2)-IntegralG0(y1))+P″
i,j+1)
uv*(IntegralG1(y2)-IntegralG1(y1)))+(IntegralG1(x2)-IntegralG1(x1))*((P′
i+1,i)
u*(IntegralF0(y2)-IntegralF0(y1))+(P′
i+1,j+1)
u*(IntegralF1(y2)-IntegralF1(y1)+(P″
i+1,j)
uv*(IntegralG0(y2)-IntegralG0(y1))+(P″
i+1,j+1)
uv*(IntegralG1(y2)-IntegralG1(y1)))(17)
Wherein, Integral represents the integration to the function of its back, for F
0(), F
1(), G
0(), G
1The integrated form of (), IntegralF
0(t)=t
4/ 2-t
3+ t, IntegralF1 (t)=-t
4/ 2+t
3, IntegralG0 (t)=t
4/ 4-2t
3/ 3+t
2/ 2, IntegralG1 (t)=t
4/ 4-t
3/ 3
Above-mentioned expression formula is 4 order polynomial forms, and the process of each integration all will be calculated its 4 order polynomial form, and its calculated amount is too large.But according to the form that resamples as can be known, as long as enlargement factor determines, being assumed to be s, is the same for situation about resampling on all Coons patchs that are made of adjacent four pixels.That is to say, for the resample points of parameter identical (being assumed to be (uu, vv)) on the different Coons patchs, its integral domain is identical, and namely u is limited to (uu-1/2s, uu+1/2s) up and down, v is limited to (vv-1/2s, vv+1/2s) up and down.In conjunction with the form of (17) formula, if to the F in (15) formula
0(t), F
1(t), G
0(t), G
1(t) at (uu-1/2s, uu+1/2s) ﹠amp; Integration on (vv-1/2s, vv+1/2s) calculates in advance and stores, then in the process of the area sampling that calculates each resample points, and just need not be at every turn all to F
0(), F
1(), G
0(), G
1() recomputates its integrated form, thereby reduces its time complexity, accelerates computation process.For example image amplifies s doubly, for F
0(), F
1(), G
0(), G
1The integration of () is in the interval
Integration on (s is the scaling multiple)
Calculate in advance and store,
Then can search for corresponding integrated value in record when (17) formula of calculating, (17) formula of bringing into gets final product to get integral result, and experimental result shows that its computing velocity can improve 40%.
We are applied in the present invention in the CT image processing system.The CT image is amplified, can bring great convenience for diagnosis.Its realization can realize by software programming.The false code of given first the present invention programming.
In the CT image processing system, if certain width of cloth CT image is amplified, the multiple that we will need enlarged image and needs to amplify passes to the ZoomBasedCoons method.From the process of amplifying, can see that the present invention selects shape preserving interpolation to calculate the single order local derviation and the second order local derviation is constructed Coons interpolation curved surface sheet, naturally guaranteed continuity and the shape-retaining ability of the image after the amplification, also just guaranteed the flatness of image.According to the ratio of amplifying, resample at the Coons interpolation curved surface sheet of structure, with the mean value of the picture element on the zonule, the resample points place gray-scale value as resample points.Bicubic Coons interpolation curved surface sheet reaches the secondary precision, so can obtain more image detail.So this invention can make the image after the amplification that obtains have higher quality, can effectively overcome mosaic phenomenon, make the image of generation that more clearly image detail be arranged.
As an example, need in the width of cloth diagnosis process to select the image used, respectively it is amplified 2 times and 5 times.Design sketch is seen accompanying drawing Fig. 7, Fig. 8.Can obtain reasonable effect from illustrating as can be known the present invention.