CN102737361B - Method for transforming full distance of three-dimensional binary image - Google Patents
Method for transforming full distance of three-dimensional binary image Download PDFInfo
- Publication number
- CN102737361B CN102737361B CN201210205736.3A CN201210205736A CN102737361B CN 102737361 B CN102737361 B CN 102737361B CN 201210205736 A CN201210205736 A CN 201210205736A CN 102737361 B CN102737361 B CN 102737361B
- Authority
- CN
- China
- Prior art keywords
- pixel
- background pixel
- dimentional
- nearest
- distance
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Image Analysis (AREA)
Abstract
The embodiment of the invention provides a method for transforming a full distance of a three-dimensional binary image. The method comprises the following steps of: dividing the three-dimensional binary image into a corresponding number of two-dimensional binary images along with one axis of the three-dimensional binary image; calculating the two-dimensional full distance transformation of each pixel in each divided two-dimensional binary image; determining the first nearest background pixel range of a first pixel; determining the two-dimensional full distance transformation value of a projection pixel of the first pixel in each two-dimensional binary image in the first nearest background pixel range; and according to the determined two-dimensional full distance transformation value of the projection pixel of the first pixel in each two-dimensional binary image in a first background pixel, determining another first background pixel nearest to the first background pixel in the three-dimensional binary image, and calculating a first full distance between the first background pixel and the first pixel. By the method provided by the embodiment of the invention, calculation speeds can be increased, and calculation accuracy can be improved.
Description
Technical field
The present invention relates to image processing field, in particular, relate to the method for the complete range conversion of a kind of three-dimensional bianry image.
Background technology
Range conversion is that the digital picture after range conversion has good rotation, translation and constant rate, thereby it all plays an important role in image processing techniques every field to digital picture important pretreatment operation.
Bianry image is carried out to range conversion to be referred to the pixel value of each pixel in bianry image is transformed into from the process of the distance of its nearest background pixel and this pixel.Pixel in bianry image can be divided into background pixel (pixel value is 0) and object pixel (pixel value is 1) two classes, and the range conversion value of background pixel is zero.
Can utilize approximate distance transform method and complete range conversion method to carry out range conversion to bianry image, the basic thought of approximate distance transform method is: utilize an approximate template computing of commonly using in image processing, calculate the bee-line that moves to certain point in figure from figure, in template the distance value of mark normally Euclidean distance round approximate value, template also can not move along the normal orientation of boundary profile all the time simultaneously, therefore these class methods must be to have error, as city block distance, chessboard distance, chamfering distance etc.
Range conversion is the accurate Euclidean distance of asking for its nearest background pixel of each pixel distance completely.Classic method is calculated respectively the distance of each pixel and all background pixels, causes computing time longer, and range conversion method comprises completely: flank pass broadcasting method and dimension reduction method.
To sum up, the method for existing range conversion has following shortcoming: the first, and there is error and be not suitable for the strict image of accuracy requirement is processed in approximation method, as medical image; The second, range conversion method is longer working time completely for tradition.
Summary of the invention
In view of this, the invention provides method and the device of the complete range conversion of a kind of three-dimensional bianry image, there is error and is not suitable for the problem to the strict image of accuracy requirement is processed and operation time is long in the method for calculating range conversion to overcome in prior art.
For achieving the above object, the invention provides following technical scheme:
A method for the complete range conversion of three-dimensional bianry image, described three-dimensional bianry image is of a size of m × n × s, comprising:
Described three-dimensional bianry image is divided into the two-dimentional two-value picture of corresponding number along an axle wherein;
The complete range conversion of two dimension of each pixel in each two-dimentional two-value picture of computed segmentation respectively;
According to the second object pixel and the complete distance that needs the first pixel of calculating three-dimensional complete range conversion, and the complete range conversion value of the three-dimensional of described the second object pixel in described three-dimensional bianry image, determine the first nearest background pixel scope of described the first pixel;
Determine the complete range conversion value of two dimension of the projected pixel in described the first pixel each two-dimentional two-value picture in the described first nearest background pixel scope;
According to the complete range conversion value of two dimension of described the first definite pixel projected pixel of each two-dimentional bianry image in the described first nearest background pixel scope, determine the first nearest background pixel of the first pixel described in described three-dimensional bianry image middle distance, calculate the first complete distance of described the first background pixel and described the first pixel, and complete in the complete range conversion value of three-dimensional as described the first pixel using described first.
Preferably, the complete range conversion value of the three-dimensional of described the second object pixel in described three-dimensional bianry image is r
1, described according to the complete distance of the second object pixel and the first pixel, and the complete range conversion value of the three-dimensional of described the second object pixel in described three-dimensional bianry image, determine that the first nearest background pixel scope of described the first pixel specifically comprises:
Determine the complete in r of described the first pixel and described the second object pixel
2;
The described first nearest background pixel scope is taking described the first pixel as the centre of sphere, with r
1+ r
2for the ball O of radius
1the region that surrounds of circumscribed square; Or the described first nearest background pixel scope is taking described the second object pixel as the centre of sphere, with r
1for the ball O of radius
2in meet square and described ball O
1the region that surrounds of circumscribed square; Or the described first nearest background pixel scope is taking described the first pixel as the centre of sphere, with | r
1-r
2| be the ball O of radius
3in meet square and described ball O
1the region that surrounds of circumscribed square.
Preferably, described three-dimensional bianry image is divided into s along z axle and opens two-dimentional two-value picture, and the described first nearest background pixel scope is as the centre of sphere, with r taking described the first pixel
1+ r
2for the ball O of radius
1the region that surrounds of circumscribed square, the two-dimentional two-value picture at described the first pixel place is z
0, the described complete range conversion value of two dimension of determining the projected pixel in described the first pixel each two-dimentional two-value picture in the described first nearest background pixel scope specifically comprises:
With described two-dimentional two-value picture z
0for symcenter determines that along z direction of principal axis described the first pixel is at two-dimentional two-value picture z from the inside to surface successively
0+ r
xin square DR of the complete range conversion value of two dimension of projected pixel
x 2, and record the complete range conversion value of definite two dimension square, r
x=0, ± 1, ± 2 ..., ± (r
1+ r
2);
Judge DR
x 2whether meet
if so, stop determining that the first pixel is respectively at two-dimentional two-value picture z
0± (r
x+ 1) until two-dimentional two-value picture z
0± (r
1+ r
2) in the complete range conversion value of two dimension of projected pixel, if not, continue to determine that the first pixel is respectively at two-dimentional two-value picture z
0± (r
x+ 1) the complete range conversion value of two dimension of projected pixel in, until determine described the first pixel at two-dimentional two-value picture z
0± (r
1+ r
2) in the complete range conversion value of two dimension of projected pixel till.
Preferably, described according to the complete range conversion value of two dimension of described the first pixel projected pixel of each two-dimentional bianry image in the described first nearest background pixel scope, determine the first nearest background pixel of the first pixel described in described three-dimensional bianry image middle distance and specifically comprise:
Utilize formula min{DR
x 2+ | z
x-z
0|
2, wherein z
xin the nearest background pixel scope of ∈ first, the span of z, determines first background pixel nearest with the first pixel distance;
Utilize formula
calculate the first complete distance.
The complete range conversion of two dimension of preferably, calculating each two-dimentional two-value picture specifically comprises:
Pre-treatment step, described pre-treatment step is for determining the first function or determining the second function, described the first function is for determining the position of the nearest background pixel of the capable middle distance of two-dimentional two-value picture i the 4th pixel, described the second function is for the position of the nearest background pixel of the 4th pixel described in definite two-dimentional two-value picture j row middle distance, wherein, 1≤i≤m, 1≤j≤n, i and j are integer;
According to the 3rd object pixel and the complete distance that needs described the 4th pixel of calculating the complete distance of two dimension, and the two dimension complete distance of described the 3rd object pixel in two-dimentional two-value picture, the second nearest background pixel scope of determining described the 4th pixel, described the 4th pixel and described the 3rd object pixel are all arranged in same two-dimentional two-value picture;
Utilize described the first function nearest background pixel of the 4th pixel described in detection range in every row of the described second nearest background pixel scope respectively, or utilize described the second function nearest background pixel of the 4th pixel described in detection range in every row of the described second nearest background pixel scope respectively;
From the nearest background pixel of the 4th pixel described in the distance searching out, determine second background pixel nearest with described the 4th pixel distance, calculate the second two dimension distance completely of described the second background pixel and described the 4th pixel, and using complete in the complete range conversion value of two dimension in the two-dimentional two-value picture at its place as described the 4th pixel described the second two dimension.
The complete range conversion of two dimension of preferably, calculating each two-dimentional two-value picture specifically comprises:
Pre-treatment step, described pre-treatment step is for determining the first function or determining the second function, described the first function is for determining the position of the nearest background pixel of the capable middle distance of two-dimentional two-value picture i the 4th pixel, described the second function is for the position of the nearest background pixel of the 4th pixel described in definite two-dimentional two-value picture j row middle distance, wherein, 1≤i≤m, 1≤j≤n, i and j are integer;
According to the complete distance of the 3rd object pixel and described the 4th pixel, and the 3rd object pixel with from the distance of its nearest background pixel, determine the second nearest background pixel scope of the 4th pixel, and the second nearest background pixel scope is divided into the first son background pixel range set and the second son background pixel range set recently recently according to preset rules, the first son recently background pixel range set comprises at least one the first son background pixel scope recently, line number in the nearest background pixel scope of described at least one height is not more than columns, the second son recently background pixel range set comprises at least one the second son background pixel scope recently, line number in the nearest background pixel scope of described at least one the second son is greater than columns,
Utilize the first function nearest background pixel of detection range the 4th pixel in every row of the nearest background pixel range set of the first son, utilize the second function nearest background pixel of detection range the 4th pixel in every row of the nearest background pixel range set of the second son;
From the nearest background pixel of distance the 4th pixel that searches out, determine second background pixel nearest with the 4th pixel distance, calculate the second complete distance of the second background pixel and the 4th pixel, and using this second completely distance as the complete range conversion value of two dimension of the 4th pixel.
Preferably, described the second nearest background pixel scope of determining described the 4th pixel specifically comprises:
Calculate the two dimension of described the 3rd object pixel in two-dimentional two-value picture completely apart from r
3;
Determine the complete in r of described the 4th pixel and described the 3rd object pixel
4;
The described second nearest background pixel scope is taking described the 4th pixel as the center of circle, with r
3+ r
4for the round O of radius
4the region that surrounds of circumscribed square;
Or the described second nearest background pixel scope is taking described the 3rd object pixel as the center of circle, with r
3for the round O of radius
5in connect square with described round O
4the annular region that surrounds of circumscribed square;
Or the described second nearest background pixel scope is taking described the 4th pixel as the centre of sphere, with | r
3-r
4| be the round O of radius
6in connect square with described round O
4the annular region that surrounds of circumscribed square.
Preferably, the x that described the 4th pixel is positioned at two-dimentional two-value picture is capable, y row, represent the position of described the 4th pixel in described two-dimentional two-value picture with (x, y), with (x, y) be separation, by capable x left side and the right side of being divided into, y row be divided into above and below;
Described definite the first function specifically comprises:
Be identified for calculating the 4th pixel (x described in the distance of the capable left side of described two-dimentional two-value picture x, y) the first subfunction of nearest background pixel place columns, and for calculating described the 4th pixel (x of described two-dimentional two-value picture x capable right side distance, y) the second subfunction of nearest background pixel place columns, wherein, 1≤x≤m, 1≤y≤n;
According to described the first subfunction and described the second subfunction, determine described the first function;
Described definite the second function specifically comprises:
Be identified for calculating the 3rd subfunction of the nearest background pixel place line number of the described two-dimentional two-value picture y side of listing described the 4th pixel of distance, and for calculating the 4th subfunction of the nearest background pixel place line number of the 4th pixel described in the distance of described two-dimentional two-value picture y row below;
According to described the 3rd subfunction and described the 4th subfunction, determine described the second function.
Preferably, described the first subfunction is specially L[x, y]:
If I (x, y)=1 and y=1, L (x, y) so=-Maxlable;
Described the second subfunction is specially R[x, y]:
If I (x, y)=1 and y=n, R[x so, y]=Maxlable;
Be specially SZ[x, y according to described the first subfunction and definite described the first function of described the second subfunction]:
Described the 3rd subfunction is specially T[x, y]:
If I (x, y)=1 and x=1, T[x so, y]=-Maxlable;
Described the 4th subfunction is specially D[x, y]:
If I (x, y)=1 and x=m, D[x so, y]=Maxlable;
Be specially ZS[x, y according to described the 3rd subfunction and definite described the second function of described the 4th subfunction]:
Wherein, I (x, y)=1 is expressed as object pixel, and I (x, y)=0 is expressed as background pixel, and described Maxlable is default maximum mark value.
Wherein, described in
Known via above-mentioned technical scheme, the method of the complete range conversion of quick three-dimensional bianry image that the employing embodiment of the present invention provides, first in the case of the complete range conversion of three-dimensional of known the second object pixel, can be according to the complete range conversion value of the three-dimensional of the second target phase pixel in three-dimensional bianry image, determine the first nearest background pixel scope of the first pixel, again when the nearest background pixel of detection range the first pixel, to search within the scope of the first nearest background pixel, instead of search in whole bianry image, thereby improve the speed of searching for nearest background pixel, secondly, after the first nearest background pixel of distance the first pixel searching out, calculate again the first complete distance of the first background pixel and the first pixel, be not to search out the distance of just calculating this background pixel and the first pixel after a background pixel, thereby reduce calculated amount, improve computing velocity, and all do not carried out approximate processing in whole search procedure and computation process, so the distance accuracy calculating is high.
Brief description of the drawings
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only embodiments of the invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, other accompanying drawing can also be provided according to the accompanying drawing providing.
Fig. 1 is the process flow diagram of the method for the complete range conversion of the three-dimensional bianry image of the disclosed the first of the embodiment of the present invention;
Fig. 2 be the nearest background pixel of the capable middle distance O of i (x, y) in the first Selecting Function System two dimension two-value picture actual be the bright procedure chart of the nearest background pixel card of detection range (i, y);
Fig. 3 is the nearest background pixel scope schematic diagram of the first second;
Fig. 4 is the nearest background pixel scope schematic diagram of the second second;
Fig. 5 is the third second nearest background pixel scope schematic diagram;
Fig. 6 is at the actual proof figure for the nearest background pixel of the projected pixel of distance the first pixel in this two dimension two-value picture of the nearest background pixel of two-dimentional two-value picture middle distance the first pixel;
Fig. 7 is the schematic diagram of the first nearest background pixel scope;
The schematic flow sheet of the complete range conversion method of two dimension of each pixel in each two-dimentional two-value picture of a kind of respectively computed segmentation that Fig. 8 provides for the embodiment of the present invention;
Figure 9 shows that the division schematic diagram of the second nearest background pixel;
The schematic flow sheet of the complete range conversion method of two dimension of each pixel in each two-dimentional two-value picture of a kind of respectively computed segmentation that Figure 10 provides for the embodiment of the present invention;
Figure 11 is for using function LR[x, y] and TD[x, y] search for the schematic diagram of nearest background pixel;
Figure 12 adopts contour searching method to search for the schematic diagram of nearest background pixel.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
X in (x, y) in all embodiment of the present invention and [x, y] represents the row in two-dimentional two-value picture, does not represent horizontal ordinate, and the y in (x, y) and [x, y] represents the row in two-value picture, does not represent ordinate.For example pixel (x
0, y
0) represent the x of this pixel in two-value picture
0oK, y
0row.
Embodiment mono-
Referring to accompanying drawing 1, is the process flow diagram of the method for the complete range conversion of the three-dimensional bianry image of the disclosed the first of the embodiment of the present invention, and the method can comprise:
Step S101: the two-dimentional two-value picture that three-dimensional bianry image is divided into corresponding number along an axle wherein;
Concrete, along x axle, three-dimensional binary image segmentation can be become m open two-dimentional two-value picture, along y axle, three-dimensional binary image segmentation can be become n open two-dimentional two-value picture, along z axle, three-dimensional binary image segmentation can be become s open two-dimentional two-value picture.
Step S101 is that therefore not to repeat here for prior art.
Step S102: the complete range conversion of two dimension of each pixel in each two-dimentional two-value picture of computed segmentation respectively;
Can utilize complete range conversion method of the prior art to calculate the complete range conversion of each pixel in each two-dimentional two-value picture.
Preferably, calculate the range conversion of a two-dimentional two-value picture and (suppose that two-dimentional two-value picture is of a size of m × n, and m >=1, n >=1), first calculate in the first row (1,1) complete range conversion, the complete range conversion of then calculating (1,2), is calculated to (1 successively according to order from left to right, n), the complete range conversion of calculating again (2,1) in the second row, is calculated to (2 from left to right successively, n), namely according to the complete range conversion of each pixel in order computation two-value picture from top to bottom from left to right.
Step S102 can comprise:
S1021: determine the first function or the second function;
Step S1021 is a pre-treatment step, needn't all carry out at every turn.
The first function is for determining the position of the nearest background pixel of the capable middle distance of two-dimentional two-value picture i the 4th pixel, the second function is used for determining the position of the nearest background pixel of two-dimentional two-value picture j row middle distance the 4th pixel, wherein, and 1≤i≤m, 1≤j≤n, i and j are integer.
Suppose that the 4th pixel is positioned at the x of two-dimentional two-value picture capable, y row, with (x, y) represent that the 4th pixel is in the position of two-dimentional two-value picture, taking (x, y) as separation, by capable x left side and the right side of being divided into, y row are divided into above and below.
The method of determining the first function specifically comprises:
Be identified for calculating the capable left side of described two-dimentional two-value picture x distance the 4th pixel (x, y) the first subfunction of nearest background pixel place columns, and for calculating the second subfunction of the nearest background pixel place columns of the capable right side of described two-dimentional two-value picture x distance the 4th pixel (x, y).Wherein, 1≤x≤m, 1≤y≤n.
According to the first subfunction and the second subfunction, determine the first function.
Determine that the second function specifically comprises: be identified for calculating the described two-dimentional two-value picture y side of listing distance the 4th pixel (x, y) the 3rd subfunction of nearest background pixel place line number, and for calculating the 4th subfunction of the nearest background pixel place line number of described two-dimentional two-value picture y row below distance the 4th pixel (x, y).
According to the 3rd subfunction and the 4th subfunction, determine the second function.
Concrete, determine that the first method of the first function and the second function is specially:
Described the first subfunction is specially L[x, y]:
If I (x, y)=1 and y=1, L (x, y) so=-Maxlable;
Described the second subfunction is specially R[x, y]:
If I (x, y)=1 and y=n, R[x so, y]=Maxlable;
Be specially SZ[x, y according to described the first subfunction and definite described the first function of described the second subfunction]:
Described the 3rd subfunction is specially T[x, y]:
If I (x, y)=1 and x=1, T[x so, y]=-Maxlable;
Described the 4th subfunction is specially D[x, y]:
If I (x, y)=1 and x=m, D[x so, y]=Maxlable;
Be specially ZS[x, y according to described the 3rd subfunction and definite described the second function of described the 4th subfunction]:
The second method of determining the first function and the second function is specially:
Described the first subfunction is specially L[x, y]:
If I (x, y)=1 and y=1, L (x, y) so=-Maxlable;
Described the second subfunction is specially R[x, y]:
If I (x, y)=1 and y=n, R[x so, y]=Maxlable;
Be specially LR[x, y according to described the first subfunction and definite described the first function of described the second subfunction]:
Described the 3rd subfunction is specially T[x, y]:
If I (x, y)=1 and x=1, T[x so, y]=-Maxlable;
Described the 4th subfunction is specially D[x, y]:
If I (x, y)=1 and x=m, D[x so, y]=Maxlable;
Be specially TD[x, y according to described the 3rd subfunction and definite described the second function of described the 4th subfunction]:
Wherein, I (x, y)=1 is expressed as object pixel, and I (x, y)=0 is expressed as background pixel, and Maxlable is default maximum mark value, wherein,
S1022: according to the complete distance of the 3rd object pixel and the 4th pixel, and the 3rd object pixel with from the complete distance of two dimension of its nearest background pixel, determine the second nearest background pixel scope of the 4th pixel.
Wherein, the 4th pixel and the 3rd object pixel are all arranged in same two-dimentional two-value picture;
In order to improve computing velocity, before determining the second background pixel scope, can also comprise:
Calculate LR[x, y]; At LR[x, y] be not more than in 1 situation, described first completely distance be LR[x, y], at LR[x, y] be greater than in 1 situation, carry out definite the second nearest background pixel scope step.
Or, calculate TD[x, y]; At TD[x, y] be not more than in 1 situation, second completely distance be TD[x, y], at TD[x, y] be greater than in 1 situation, carry out definite the second nearest background pixel scope step.
If LR (x, y)=0 or TD[x, y]=0 explanation the 4th pixel (x, y) is background pixel.If there is background pixel in level 2 neighborhoods of LR (x, y)=1 explanation the 4th pixel (x, y), the second complete distance is 1, if TD[x, y]=1 explanation the 4th pixel (x, y) in vertical 2 neighborhoods, have background pixel, the second complete distance is 1.
Before determining the second background pixel scope, can also comprise:
Calculate (y-SZ[x, y])
2; (y-SZ[x, y])
2be not more than in 1 situation, second completely distance be (y-SZ[x, y])
2, (y-SZ[x, y])
2be greater than in 1 situation, carry out and determine the second nearest background pixel scope step.
Or, calculate (x-ZS[x, y])
2; (x-ZS[x, y])
2be not more than in 1 situation, second completely distance be (x-ZS[x, y])
2, (x-ZS[x, y])
2be greater than in 1 situation, carry out and determine the second nearest background pixel scope step.
Utilize the first function nearest background pixel of detection range the 4th pixel in every row of the second nearest background pixel scope respectively, or utilize the second function nearest background pixel of detection range the 4th pixel in every row of the second nearest background pixel scope respectively;
From the nearest background pixel of distance the 4th pixel that searches out, determine second background pixel nearest with the 4th pixel distance, calculate the second complete distance of the second background pixel and the 4th pixel, and complete in the complete range conversion value of two dimension in the two-dimentional two-value picture at its place as the 4th pixel using second.
The 4th pixel can be the arbitrary pixel that is arranged in two-dimentional two-value picture, just just claim that in order to narrate conveniently arbitrary pixel is the 4th pixel.
In the time that the 4th pixel is background pixel, the nearest background pixel of distance the 4th pixel is exactly itself.
Suppose that the position of above-mentioned the 4th pixel in two-dimentional two-value picture is for (x, y), because the first subfunction is for calculating the arbitrary pixel of two-dimentional two-value picture x capable left side distance (x, y) columns at nearest background pixel place, the second subfunction is used for calculating the arbitrary pixel of two-dimentional two-value picture x capable right side distance (x, y) columns at nearest background pixel place, so SZ[x obtaining according to the first subfunction and the second subfunction, y] be also for determine x capable on the columns at the nearest background pixel place of the arbitrary pixel of distance (x, y).
With O (x, y) represent above-mentioned the 4th pixel, utilize the capable (i ≠ x) middle distance O (x of the first Selecting Function System i, y) nearest background pixel, be exactly to utilize the capable middle distance of the first Selecting Function System i (i in fact, y) nearest background pixel, so in the time of execution step S102, be actually the first function SZ[x, y] in x replace to the function SZ[i of i, y] search for, function SZ[i, y] be actually search at the capable middle distance of i (i, y) nearest background pixel, due at the capable middle distance of i (i, y) nearest background pixel is exactly apart from O (x, y) nearest background pixel, so function SZ[i, y] in essence still for searching for each row middle distance O (x, y) nearest background pixel.
As shown in Figure 2, proof procedure is as follows: suppose L
1, L
2, R
1, R
2be four background pixels of i on capable, the distance of they and O (x, y) is respectively | OL
1|, | OL
2|, | OR
1|, | OR
2|, known by geometric knowledge is exactly obviously distance (i, y) nearest background pixel apart from the nearest background pixel of O (x, y), and the position of the nearest background pixel of the capable middle distance O of i (x, y) is (i, SZ[i, y]).
In like manner, utilize the second Selecting Function System j row (in j ≠ y) apart from the nearest background pixel of O (x, y), be exactly to utilize the second Selecting Function System j row middle distance (x in fact, j) nearest background pixel, so in the time of execution step S102, be actually the second function ZS[x, y] in y replace to the function ZS[x of j, j] to search for, the position of the nearest background pixel of j row middle distance O (x, y) is (ZS[x, j], j).Wherein, 1≤i≤m, 1≤j≤n, i and j are positive integer.
Determine that the second nearest background pixel scope specifically comprises:
First, calculate the 3rd object pixel O
3with from its nearest background pixel B
0two dimension completely apart from r
3;
Secondly, determine the 4th pixel O
4with the 3rd object pixel O
3complete in r
4;
Calculate completely apart from r
3can calculate by method of the prior art.Distance the 3rd object pixel O
3nearest background pixel may have multiple, only gets one of them background pixel B according to actual conditions
0.
Preferably, the 4th pixel O
4be positioned at the 3rd object pixel O
3neighbours territory in, such the 4th pixel O
4with the 3rd object pixel O
3complete in r
4=1.Certainly the 4th pixel O,
4position be not restricted to the 3rd object pixel O
3four fields in, the 4th pixel O
4particular location do not affect the realization of the embodiment of the present invention, so not to the 4th pixel O
4particular location be specifically limited.
Finally, according to complete apart from r
3and completely apart from r
4determine the 4th pixel O
4the second nearest background pixel scope.
Referring to Fig. 3, be the nearest background pixel scope schematic diagram of the first second, the round O in figure
4for taking the 4th pixel as the center of circle, with r
3+ r
4for the round O of radius
4, because digital picture has discreteness, it is very consuming time determining the accurate border circular areas taking circular arc as border, so the second nearest background pixel scope is circle O
4the region that surrounds of circumscribed square.
Referring to Fig. 4, be the nearest background pixel scope schematic diagram of the second second, the second nearest background pixel scope is with described the 3rd object pixel O
3for the center of circle, with r
3for the round O of radius
5in connect square with circle O
4the region that surrounds of circumscribed square;
Referring to Fig. 5, be the third the second nearest background pixel scope schematic diagram, the second nearest background pixel scope is circle O
6circumscribed square with circle O
4in connect the annular region that surrounds of square.
Circle O
6taking described the 4th pixel as the center of circle, with | r
3-r
4| be the circle of radius.
If the 4th pixel is positioned at the marginal position of two-dimentional two-value picture, in the time determining the second nearest background pixel scope, initial the second nearest background pixel scope of determining may some exceed two-dimentional two-value picture, now can get the common factor of the initial second definite nearest background pixel scope and two-dimentional two-value picture as the second nearest background pixel scope.
Step S103: according to the complete distance of the second object pixel and the first pixel, and the complete range conversion value of the three-dimensional of described the second object pixel in three-dimensional bianry image, determine the first nearest background pixel scope of the first pixel;
The second object pixel is arbitrary object pixel in three-dimensional bianry image.
Determine that the first nearest background pixel scope can comprise:
Determine that the complete range conversion value of the three-dimensional of the second object pixel in three-dimensional bianry image is r
1;
Determine the first pixel O
1with the second object pixel O
2complete in r
2;
The first nearest background pixel scope is with the first pixel O
1for the centre of sphere, with r
1+ r
2for the ball O of radius
1the region that surrounds of circumscribed square;
Or the first nearest background pixel scope is with the second object pixel O
2for the centre of sphere, with r
1for the ball O of radius
2in meet square and ball O
1the region that surrounds of circumscribed square;
Or the first nearest background pixel scope is with described the first pixel O
1for the centre of sphere, with | r
1-r
2| be the ball O of radius
3in meet square and described ball O
1the region that surrounds of circumscribed square.
If the first pixel is positioned at the marginal position of three-dimensional bianry image, in the time determining the first nearest background pixel scope, initial the first nearest background pixel scope of determining may some exceed three-dimensional bianry image, now can get the common factor of the initial first definite nearest background pixel scope and three-dimensional bianry image as the first nearest background pixel scope.
Step S104: determine the first pixel complete range conversion value of two dimension of the projected pixel in each the two-dimentional two-value picture in the first nearest background pixel scope respectively;
Refer to Fig. 6, suppose that pixel O (x, y, z) is an object pixel on two-dimentional two-value picture z, pixel O
0(x, y, z
0) be that O (x, y, z) is at two-dimentional two-value picture z
0on projected pixel, be located at two-dimentional two-value picture z
0upper apart from pixel O
0(x, y, z
0) nearest background pixel B
0with pixel O
0(x, y, z
0) the complete range conversion value of two dimension square be | O
0b
0|
2, so two-dimentional two-value picture z
0upper is also obviously B apart from the nearest background pixel of pixel O (x, y, z)
0, and
Suppose that three-dimensional bianry image is divided into s along z axle and opens two-dimentional two-value picture, the first nearest background pixel scope is with the first pixel O
1for the centre of sphere, with r
1+ r
2for the ball O of radius
1the region that surrounds of circumscribed square, refer to Fig. 7, be the schematic diagram of the first nearest background pixel scope, the r=r in Fig. 7
1+ r
2, B is ball O
1on a pixel, in figure, represent O with O
1, the first nearest background pixel scope can be regarded as by 2 (r as seen from Figure 7
1+ r
2)+1 pictures is formed by stacking along z axle, supposes the first pixel O
1the two-dimentional two-value picture at place is z
0, preferred, first determine two-dimentional two-value picture z
0in the complete range conversion value of two dimension of the first pixel (now the first pixel is at two-dimentional two-value picture z
0on projected pixel be exactly itself), secondly determine that first pixel is respectively at two-dimentional two-value picture z
0the complete range conversion value of the two dimension of projected pixel in ± 1, then determine that the first pixel is respectively at two-dimentional two-value picture z
0the complete range conversion value of the two dimension of projected pixel in ± 2, until two-dimentional two-value picture z
0± (r
1+ r
2).With two-dimentional two-value picture z
0determine respectively successively from the inside to surface the complete range conversion value of two dimension of the projected pixel of the first pixel in each two-dimentional two-value picture along z direction of principal axis for symcenter, suppose at two-dimentional two-value picture z
0+ r
xon determine the first pixel at two-dimentional two-value picture z
0+ r
xin projected pixel the complete change of distance value of two dimension square be DR
x 2, r
x∈ [(r
1+ r
2), r
1+ r
2], due at two-dimentional two-value picture z
0± (r
x+ 1) minimum value of the square distance of the nearest background pixel of middle distance the first pixel and the first pixel is (r
x+ 1)
2so, work as DR
x 2+ r
x 2≤ (r
x+ 1)
2time, stop determining that the first pixel is respectively at two-dimentional two-value picture z
0± (r
x+ 2) until two-dimentional two-value picture z
0± (r
1+ r
2) in the complete range conversion value of two dimension of projected pixel, if DR
x 2+ r
x 2> (r
x+ 1)
2, continue to determine that the first pixel is respectively at two-value picture z
0± (r
x+ 2) the complete range conversion value of two dimension of the projected pixel in, until to two-dimentional two-value picture z
0± (r
1+ r
2).
The first nearest background pixel scope can be regarded as by 2 (r
1+ r
2)+1 pictures is formed by stacking along z axle, and probably the nearest background pixel of the projected pixel of certain Zhang Erwei two-value picture middle distance the first pixel not within the scope of the first nearest background pixel, but this does not affect the realization of the embodiment of the present invention, so do not distinguish at this.
Step S105: according to the first pixel complete range conversion value of the two dimension of the projected pixel of each two-dimentional bianry image in the first background pixel respectively of determining, determine at the first nearest background pixel of three-dimensional bianry image middle distance the first pixel, calculate the first complete distance of the first background pixel and the first pixel, and using this first completely distance as the complete range conversion value of three-dimensional of the first pixel.
Suppose that the position of the first pixel in three-dimensional bianry image is for (x, y, z), because the complete distance of two dimension of each pixel in each two-dimentional two-value picture has all calculated, suppose DR
xrepresent from two-dimentional bianry image z
xmiddle distance the first pixel is at two-dimentional bianry image z
xthe square value of the nearest background pixel of middle projected pixel, the projected pixel that wherein footmark x represents the first pixel is at two-dimentional bianry image z
xupper, step S105 specifically comprises so:
Utilize formula min{DR
x 2+ | z
x-z|
2, wherein z
xin the nearest background pixel scope of ∈ first, the span of z axle, determines first background pixel nearest with the first pixel distance, recycling formula
obtain the first complete distance.
Preferably, while calculating the complete range conversion of three-dimensional of each pixel in each two-dimentional two-value picture, suppose that three-dimensional bianry image is divided into s along z axle and opens two-dimentional two-value picture, it is [1 that this s opens the scope of two-dimentional two-value picture in z axle, s], first calculate the complete range conversion of three-dimensional of each pixel each two-dimentional two-value picture from two-dimentional two-value picture z=1, secondly, calculate the complete range conversion of three-dimensional of each pixel in two-dimentional two-value picture z=2, calculate again the complete range conversion of three-dimensional of each pixel in two-dimentional two-value picture z=3, the like until calculated the complete range conversion of three-dimensional of each pixel in two-dimentional two-value picture z=s, be calculated to the maximal value of z by the minimum value of z in two-dimentional two-value picture.
The method of the complete range conversion of quick three-dimensional bianry image that the employing embodiment of the present invention provides, first in the case of the complete range conversion of three-dimensional of known the second object pixel, can be according to the complete range conversion value of the three-dimensional of the second target phase pixel in three-dimensional bianry image, determine the first nearest background pixel scope of the first pixel, again when the nearest background pixel of detection range the first pixel, to search within the scope of the first nearest background pixel, instead of search for, thereby improved the speed of searching for nearest background pixel in whole bianry image; Secondly, after the first nearest background pixel of distance the first pixel searching out, calculate again the first complete distance of the first background pixel and the first pixel, be not to search out the distance of just calculating this background pixel and the first pixel after a background pixel, thereby reduce calculated amount, improve computing velocity, and all do not carried out approximate processing in whole search procedure and computation process, so the distance accuracy calculating is high.
Embodiment bis-
Refer to Fig. 8, the schematic flow sheet of the complete range conversion method of two dimension of each pixel in each two-dimentional two-value picture of a kind of respectively computed segmentation providing for the embodiment of the present invention, i.e. the implementation method of step S102 in embodiment mono-, the method can comprise:
Step S801: according to the complete distance of the 3rd object pixel and the 4th pixel, and the 3rd object pixel with from the distance of its nearest background pixel, determine the second nearest background pixel scope of the 4th pixel, and the second nearest background pixel scope is divided into the first son background pixel range set and the second son background pixel range set recently recently according to preset rules, the first son recently background pixel range set comprises at least one the first son background pixel scope recently, line number in the nearest background pixel scope of described at least one height is not more than columns, the second son recently background pixel range set comprises at least one the second son background pixel scope recently, line number in the nearest background pixel scope of described at least one the second son is greater than columns,
Before step S801, also comprise: calculate LR[x, y] and TD[x, y]; At LR[x, y] or TD[x, y]
Be not more than in 1 situation, described second completely distance be min{LR[x, y], TD[x, y], at LR[x, y]
And TD[x, y] be all greater than in 1 situation, enter step S802.
If LR (x, y)=0 or TD[x, y]=0 explanation the 4th pixel (x, y) is background pixel.If there is background pixel in level 2 neighborhoods of LR (x, y)=1 explanation the 4th pixel (x, y), the second complete distance is 1, if TD[x, y]=1 explanation the 4th pixel (x, y) in vertical 2 neighborhoods, have background pixel, the second complete distance is 1.
The second nearest background pixel scope of the second nearest background pixel scope as shown in Fig. 4 or Fig. 5, the interior line segment that connects a foursquare opposite side is extended to crossing with the border of circumscribed square, here divide as an example of the nearest background pixel scope of the second second example, as shown in Figure 9, be the division schematic diagram of the second nearest background pixel, dot-and-dash line is circle O
3inside connect the extended line of a square opposite side, the second nearest background pixel scope is divided into four nearest background pixel scopes of son up and down by this opposite side, be referred to as upper area, lower zone, left region and right-hand region, obviously line number is less than columns in region and lower zone up, is less than line number in left region and right-hand region midrange.Certainly, also can use circle O
3the extended line that inside connects another opposite side of square, is divided into four regions up and down by nearest background pixel scope.
Preset rules refers to circle O
3the line segment that inside connects a foursquare opposite side extends to crossing with the border of circumscribed square, and the second nearest background pixel scope is divided into four nearest background pixel scopes of son up and down by this opposite side.
The first son recently background pixel range set comprises: upper area and lower zone; The second son recently background pixel range set comprises: left region and right-hand region.
Step S802: utilize the first function nearest background pixel of detection range the 4th pixel in every row of the nearest background pixel range set of the first son, utilize the second function nearest background pixel of detection range the 4th pixel in every row of the nearest background pixel range set of the second son;
In the time that the line number of the nearest background pixel range set of the first son is not more than columns, utilize the first function to search for, search time used is few, in the time that the line number of the nearest background pixel range set of the second son is greater than columns, utilize the second function to search for, search time used is few.
Step S803: determine second background pixel nearest with the 4th pixel distance from the nearest background pixel of distance the 4th pixel that searches out, calculate the second complete distance of the second background pixel and the 4th pixel, and using this second completely distance as the complete range conversion value of two dimension of the 4th pixel.
Adopt the embodiment of the present invention, due to the second nearest background pixel scope is divided according to pre-defined rule, because the line number of the nearest background pixel range set of the first son is not more than columns, utilize the first function nearest background pixel of detection range the 4th pixel in every row of the nearest background pixel range set of the first son, because the line number of the nearest background pixel range set of the second son is greater than columns, utilize the second function nearest background pixel of detection range the 4th pixel in every row of the nearest background pixel range set of the second son, more accelerate search speed, thereby improve computing velocity.
Embodiment tri-
Refer to Figure 10, the schematic flow sheet of the complete range conversion method of two dimension of each pixel in each two-dimentional two-value picture of a kind of respectively computed segmentation providing for the embodiment of the present invention, i.e. step S102 implementation method in embodiment mono-, the method can comprise:
Step S1001: according to the complete distance of the 3rd object pixel and the 4th pixel, and the 3rd object pixel with from the complete distance of two dimension of its nearest background pixel, determine the second nearest background pixel scope of the 4th pixel;
Step S1002: utilize the first function and the second function nearest background pixel of detection range the 4th pixel in every layer of the second nearest background pixel scope respectively;
Every layer of foursquare border referring to centered by described the 4th pixel or described the 3rd object pixel of the second nearest background pixel scope.
Concrete, utilize the first function and the second function from r
xlayer starts search until at r
x+ k layer searches the nearest background pixel of distance the 4th pixel, r
xlayer is nearest one deck of distance the 4th pixel within the scope of nearest background pixel, k=0,1,2 ... q-1, a total q layer within the scope of the second nearest background pixel;
From at r
xin the nearest background pixel of the distance that+k layer searches out the 4th pixel, determine r
xthe background pixel that+k layer middle distance the 4th pixel is nearest, and record r
xthe complete square distance value of the background pixel that the pixel of distance the 4th described in+k layer is nearest and the 4th pixel
Relatively
with (r
x+ k+1)
2+ (r
x+ k)
2, when
time, stop search, when
time, continue the lower one deck of search, until search for complete r
x+ q-1 layer finishes.
Taking the second nearest background pixel scope as shown in Figure 5 as example, to step, S1002 describes, and every one deck of the second nearest background pixel is all with O
4centered by foursquare border, the half of this square length of side is exactly the number of plies of this layer, the method that the thought that adopts contour search is searched within the scope of background pixel recently for from
layer (half of the inscribed square length of side) starts, and successively scanning is until r
1+ r
2layer (half of the circle circumscribed square length of side) finishes, and supposes scanning r
xlayer, wherein
referring to Figure 11, be to use function LR[x, y] and TD[x, y] search for the schematic diagram of nearest background pixel, for r
xpixel on layer is divided into R along x, y direction respectively
1(using in the drawings the region of dotted line), R
2(region surrounding with dot-and-dash line in the drawings), R
3(region surrounding is realized in left side in the drawings) and R
4(region surrounding is realized on right side in the drawings) four groups, easily knows that the element in these four groups is respectively (x-r
x) OK, (x+r
x) OK, (y-r
x) row, (y+r
x) list the part of pixel.At (x-r
x) the nearest background pixel of row mid-range objectives pixel O (is designated as B
x1) coordinate be
or
if
show B
x1∈ R
1, i.e. R
1in there is background pixel, if LR[x+r in like manner
x, y] and <r
x 2, TD[x, y-r
x] <r
x 2tD[x
x, y+r] and <r
x 2, show respectively R
2, R
3, R
4in there is background pixel, establish tD=min{LR[x-r
x, y], LR[x+r
x, y], TD[x, y-r
x], TD[x
x, y+r] }, note r
xon layer, the distance of the nearest background pixel of distance the 4th pixel and the 4th pixel square is DT
x 2=tD+r
x 2, due at r
xin+1 layer, the minimum value of tD is (r
x+ 1)
2so, as tD≤(r
x+ 1)
2time, stop search, or judgement
when
in time, stops search.
Referring to Figure 12, search for the schematic diagram of nearest background pixel for adopting contour searching method, the 4th pixel of supposing to calculate range conversion is object pixel A, in figure, numeral 1 represents that ground floor, numeral 2 represent the 2nd layer, digital 3 and represent that the 3rd layer and digital 4 represents the 4th layer, in figure, only draw four layers, but might not be four layers in actual applications, suppose at r
x, search a background pixel B at=2 o'clock
4, obviously background pixel B
4with the distance of object pixel A be
but
square value 18 be greater than (3+1)
2so, need to continue the 3rd layer of search, at r
x, search two background pixel B at=3 o'clock
1with B
3, due to background pixel B
1with the distance of object pixel A be
obvious 13 are less than (4+1)
2so, stopping the search to lower one deck, the nearest background pixel of distance the first pixel that now utilizes the first function and the second function to search in nearest background pixel scope has B
1, B
3and B
4.
Above-mentioned is taking the nearest background pixel scope shown in Fig. 4 as example, the explanation that step S1002 is carried out, if the second nearest background pixel is with shown in Fig. 2, every layer of the second nearest background pixel scope refers to O
4centered by foursquare border, the method that the thought that adopts so contour search is searched within the scope of background pixel is recently: since the 1st layer (from 8 fields in the center of circle), successively scan until r
1+ r
2layer (half of the circle circumscribed square length of side) finishes; If the second nearest background pixel is with shown in Fig. 3, every layer of the second nearest background pixel scope refers to O
3centered by square composition, the method that the thought that adopts so contour search is searched within the scope of background pixel is recently: since the 1st layer 8 fields of the center of circle (from), when being scanned up to r
1(r when layer
1layer is circle O
3the half of the circumscribed square length of side), the left side of the second nearest background pixel scope has been searched for complete, every layer of this second nearest background pixel scope is by with O
3centered by the border of dot-dash wire frame as shown in Figure 3, from r
1search for until r for+1 layer
1+ r
2layer.
Step S1003: determine second background pixel nearest with the 4th pixel distance from the nearest background pixel of distance the 4th pixel that searches out, calculate the second complete distance of the second background pixel and the 4th pixel, and using this second completely distance as the complete range conversion value of two dimension of the 4th pixel.
Distance refers to the bee-line of this second background pixel and the 4th pixel completely, i.e. air line distance, and range conversion value refers to the background pixel nearest with object pixel and the distance value of this object pixel.
Concrete, step S1003 comprises: according to the nearest background pixel of the 4th pixel described in the distance of record and the complete square distance value of described the 4th pixel, determine the second complete square distance value of second background pixel nearest with the 4th pixel distance and the 4th pixel; The described second complete square distance value evolution is obtained to the described second complete distance.
Note r
xon+k layer, the distance of the nearest background pixel of distance the 4th pixel and the 4th pixel square is
only suppose to have found apart from the nearest background pixel of the 4th pixel at the 3rd layer, the 4th layer and layer 5, step S1003 specifically comprises:
Utilize formula
determine second background pixel nearest with the 4th pixel distance, recycling formula:
calculate the second complete distance.
The method that the embodiment of the present invention provides, not only has the beneficial effect of embodiment mono-, and owing to being to utilize the first function and the second function to search in every layer of background pixel recently, so more accelerated search speed.
For those skilled in the art further understand the advantage of the embodiment of the present invention, inventor uses said method to calculate the complete range conversion of each pixel in three-dimensional bianry image, and use prior art to carry out complete range conversion to the three-dimensional bianry image of same pair, and the operation result of the two is compared.
Prior art refers to Euclidean distance transform of digital images in arbitrary dimensions.PCM 2006, LNCS, the method for recording in 2006,4261:72-79.
As shown in table 1, calculate the three-dimensional working time of range conversion completely (unit: second) for prior art and contrast form with the time of utilizing this method to calculate three-dimensional range conversion completely.
Table 1
As can be seen from Table 1, the image of different size is carried out to range conversion, it is long that prior art is carried out time of the method operation that the three-dimensional time of range conversion completely all provides than the embodiment of the present invention, for high this theory of method efficiency of the three-dimensional range conversion completely of carrying out that the expression embodiment of the present invention provides more intuitively, in table 1, give the ratio of the time of " method that prior art/embodiment of the present invention provides " operation.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is and the difference of other embodiment, between each embodiment identical similar part mutually referring to.For the disclosed device of embodiment, because it corresponds to the method disclosed in Example, so description is fairly simple, relevant part illustrates referring to method part.
The software module that the method for describing in conjunction with embodiment disclosed herein or the step of algorithm can directly use hardware, processor to carry out, or the combination of the two is implemented.Software module can be placed in the storage medium of any other form known in random access memory (RAM), internal memory, ROM (read-only memory) (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field.
To the above-mentioned explanation of the disclosed embodiments, make professional and technical personnel in the field can realize or use the present invention.To be apparent for those skilled in the art to the multiple amendment of these embodiment, General Principle as defined herein can, in the situation that not departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention will can not be restricted to these embodiment shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.
Claims (8)
1. a method for the complete range conversion of three-dimensional bianry image, described three-dimensional bianry image is of a size of m × n × s, it is characterized in that, comprising:
Described three-dimensional bianry image is divided into s along z axle and opens two-dimentional two-value picture;
The complete range conversion of two dimension of each pixel in each two-dimentional two-value picture of computed segmentation respectively;
According to the second object pixel and the complete distance that needs the first pixel of calculating three-dimensional complete range conversion, and the complete range conversion value of the three-dimensional of described the second object pixel in described three-dimensional bianry image, determine the first nearest background pixel scope of described the first pixel;
Determine the complete range conversion value of two dimension of the projected pixel in described the first pixel each two-dimentional two-value picture in the described first nearest background pixel scope;
According to the complete range conversion value of two dimension of described the first definite pixel projected pixel of each two-dimentional two-value picture in the described first nearest background pixel scope, determine the first nearest background pixel of the first pixel described in described three-dimensional bianry image middle distance, calculate the first complete distance of described the first background pixel and described the first pixel, and complete in the complete range conversion value of three-dimensional as described the first pixel using described first;
The complete range conversion value of the three-dimensional of described the second object pixel in described three-dimensional bianry image is r
1, described according to the complete distance of the second object pixel and the first pixel, and the complete range conversion value of the three-dimensional of described the second object pixel in described three-dimensional bianry image, determine that the first nearest background pixel scope of described the first pixel specifically comprises:
Determine the complete in r of described the first pixel and described the second object pixel
2;
The described first nearest background pixel scope is taking described the first pixel as the centre of sphere, with r
1+ r
2for the ball O of radius
1the region that surrounds of circumscribed square; Or the described first nearest background pixel scope is taking described the second object pixel as the centre of sphere, with r
1for the ball O of radius
2in meet square and described ball O
1the region that surrounds of circumscribed square; Or the described first nearest background pixel scope is taking described the first pixel as the centre of sphere, with | r
1-r
2| be the ball O of radius
3in meet square and described ball O
1the region that surrounds of circumscribed square;
When the described first nearest background pixel scope is as the centre of sphere, with r taking described the first pixel
1+ r
2for the ball O of radius
1circumscribed square surround region time, the two-dimentional two-value picture at described the first pixel place is z
0, the described complete range conversion value of two dimension of determining the projected pixel in described the first pixel each two-dimentional two-value picture in the described first nearest background pixel scope specifically comprises:
With described two-dimentional two-value picture z
0for symcenter determines that along z direction of principal axis described the first pixel is at two-dimentional two-value picture z from the inside to surface successively
0+ r
xin square DR of the complete range conversion value of two dimension of projected pixel
x 2, and record the complete range conversion value of definite two dimension square, r
x=0, ± 1, ± 2 ..., ± (r
1+ r
2);
Judge DR
x 2whether meet DR
x 2+ r
x 2≤ (r
x+ 1)
2, if so, stop determining that the first pixel is respectively at two-dimentional two-value picture z
0± (r
x+ 1) until two-dimentional two-value picture z
0± (r
1+ r
2) in the complete range conversion value of two dimension of projected pixel, if not, continue to determine that the first pixel is respectively at two-dimentional two-value picture z
0± (r
x+ 1) the complete range conversion value of two dimension of projected pixel in, until determine described the first pixel at two-dimentional two-value picture z
0± (r
1+ r
2) in the complete range conversion value of two dimension of projected pixel till.
2. method according to claim 1, it is characterized in that, described according to the complete range conversion value of two dimension of described the first pixel projected pixel of each two-dimentional two-value picture in the described first nearest background pixel scope, determine the first nearest background pixel of the first pixel described in described three-dimensional bianry image middle distance and specifically comprise:
Utilize formula
wherein z
xin the nearest background pixel scope of ∈ first, the span of z, determines first background pixel nearest with the first pixel distance;
Utilize formula
calculate the first complete distance.
3. method according to claim 1, is characterized in that, the complete range conversion of two dimension of calculating each two-dimentional two-value picture specifically comprises:
Pre-treatment step, described pre-treatment step is for determining the first function or determining the second function, described the first function is for determining the position of the nearest background pixel of the capable middle distance of two-dimentional two-value picture i the 4th pixel, described the second function is for the position of the nearest background pixel of the 4th pixel described in definite two-dimentional two-value picture j row middle distance, wherein, 1≤i≤m, 1≤j≤n, i and j are integer;
According to the 3rd object pixel and the complete distance that needs described the 4th pixel of calculating the complete distance of two dimension, and the two dimension complete distance of described the 3rd object pixel in two-dimentional two-value picture, the second nearest background pixel scope of determining described the 4th pixel, described the 4th pixel and described the 3rd object pixel are all arranged in same two-dimentional two-value picture;
Utilize described the first function nearest background pixel of the 4th pixel described in detection range in every row of the described second nearest background pixel scope respectively, or utilize described the second function nearest background pixel of the 4th pixel described in detection range in every row of the described second nearest background pixel scope respectively;
From the nearest background pixel of the 4th pixel described in the distance searching out, determine second background pixel nearest with described the 4th pixel distance, calculate the second two dimension distance completely of described the second background pixel and described the 4th pixel, and using complete in the complete range conversion value of two dimension in the two-dimentional two-value picture at its place as described the 4th pixel described the second two dimension.
4. method according to claim 1, is characterized in that, the complete range conversion of two dimension of calculating each two-dimentional two-value picture specifically comprises:
Pre-treatment step, described pre-treatment step is for determining the first function or determining the second function, described the first function is for determining the position of the nearest background pixel of the capable middle distance of two-dimentional two-value picture i the 4th pixel, described the second function is for the position of the nearest background pixel of the 4th pixel described in definite two-dimentional two-value picture j row middle distance, wherein, 1≤i≤m, 1≤j≤n, i and j are integer;
According to the complete distance of the 3rd object pixel and described the 4th pixel, and the 3rd object pixel with from the distance of its nearest background pixel, determine the second nearest background pixel scope of the 4th pixel, and the second nearest background pixel scope is divided into the first son background pixel range set and the second son background pixel range set recently recently according to preset rules, the first son recently background pixel range set comprises at least one the first son background pixel scope recently, line number in the nearest background pixel scope of described at least one the first son is not more than columns, the second son recently background pixel range set comprises at least one the second son background pixel scope recently, line number in the nearest background pixel scope of described at least one the second son is greater than columns,
Utilize the first function nearest background pixel of detection range the 4th pixel in every row of the nearest background pixel range set of the first son, utilize the second function nearest background pixel of detection range the 4th pixel in every row of the nearest background pixel range set of the second son;
From the nearest background pixel of distance the 4th pixel that searches out, determine second background pixel nearest with the 4th pixel distance, calculate the second complete distance of the second background pixel and the 4th pixel, and using this second completely distance as the complete range conversion value of two dimension of the 4th pixel.
5. according to the arbitrary described method of claim 3 or 4, it is characterized in that, described the second nearest background pixel scope of determining described the 4th pixel specifically comprises:
Calculate the two dimension of described the 3rd object pixel in two-dimentional two-value picture completely apart from r
3;
Determine the complete in r of described the 4th pixel and described the 3rd object pixel
4;
The described second nearest background pixel scope is taking described the 4th pixel as the center of circle, with r
3+ r
4for the round O of radius
4the region that surrounds of circumscribed square;
Or the described second nearest background pixel scope is taking described the 3rd object pixel as the center of circle, with r
3for the round O of radius
5in connect square with described round O
4the annular region that surrounds of circumscribed square;
Or the described second nearest background pixel scope is taking described the 4th pixel as the centre of sphere, with | r
3-r
4| be the round O of radius
6in connect square with described round O
4the annular region that surrounds of circumscribed square.
6. according to the arbitrary described method of claim 3 or 4, it is characterized in that, the x that described the 4th pixel is positioned at two-dimentional two-value picture is capable, y row, represent the position of described the 4th pixel in described two-dimentional two-value picture with (x, y), with (x, y) be separation, by capable x left side and the right side of being divided into, y row be divided into above and below;
Described definite the first function specifically comprises:
Be identified for calculating the 4th pixel (x described in the distance of the capable left side of described two-dimentional two-value picture x, y) the first subfunction of nearest background pixel place columns, and for calculating described the 4th pixel (x of described two-dimentional two-value picture x capable right side distance, y) the second subfunction of nearest background pixel place columns, wherein, 1≤x≤m, 1≤y≤n;
According to described the first subfunction and described the second subfunction, determine described the first function;
Described definite the second function specifically comprises:
Be identified for calculating the 3rd subfunction of the nearest background pixel place line number of the described two-dimentional two-value picture y side of listing described the 4th pixel of distance, and for calculating the 4th subfunction of the nearest background pixel place line number of the 4th pixel described in the distance of described two-dimentional two-value picture y row below;
According to described the 3rd subfunction and described the 4th subfunction, determine described the second function.
7. method according to claim 6, is characterized in that, described the first subfunction is specially L[x, y]:
If I (x, y)=1 and y=1, L[x so, y]=-Maxlable;
Described the second subfunction is specially R[x, y]:
If I (x, y)=1 and y=n, R[x so, y]=Maxlable;
Be specially SZ[x, y according to described the first subfunction and definite described the first function of described the second subfunction]:
Described the 3rd subfunction is specially T[x, y]:
If I (x, y)=1 and x=1, T[x so, y]=-Maxlable;
Described the 4th subfunction is specially D[x, y]:
If I (x, y)=1 and x=m, D[x so, y]=Maxlable;
Be specially ZS[x, y according to described the 3rd subfunction and definite described the second function of described the 4th subfunction]:
Wherein, I (x, y)=1 is expressed as object pixel, and I (x, y)=0 is expressed as background pixel, and described Maxlable is default maximum mark value.
8. method according to claim 7, is characterized in that, described in
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210205736.3A CN102737361B (en) | 2012-06-20 | 2012-06-20 | Method for transforming full distance of three-dimensional binary image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210205736.3A CN102737361B (en) | 2012-06-20 | 2012-06-20 | Method for transforming full distance of three-dimensional binary image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102737361A CN102737361A (en) | 2012-10-17 |
CN102737361B true CN102737361B (en) | 2014-11-05 |
Family
ID=46992797
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210205736.3A Expired - Fee Related CN102737361B (en) | 2012-06-20 | 2012-06-20 | Method for transforming full distance of three-dimensional binary image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102737361B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1403057A (en) * | 2001-09-13 | 2003-03-19 | 田捷 | 3D Euclidean distance transformation process for soft tissue display in CT image |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7809165B2 (en) * | 2007-01-25 | 2010-10-05 | Mitsubishi Electric Research Laboratories, Inc. | Method for generating distance maps using scan lines |
-
2012
- 2012-06-20 CN CN201210205736.3A patent/CN102737361B/en not_active Expired - Fee Related
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1403057A (en) * | 2001-09-13 | 2003-03-19 | 田捷 | 3D Euclidean distance transformation process for soft tissue display in CT image |
Non-Patent Citations (2)
Title |
---|
基于链码技术的距离变换改进算法;徐达丽等;《计算机工程与应用》;20090901;第45卷(第25期);第176-178页 * |
徐达丽等.基于链码技术的距离变换改进算法.《计算机工程与应用》.2009,第45卷(第25期),第176-178页. * |
Also Published As
Publication number | Publication date |
---|---|
CN102737361A (en) | 2012-10-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Lee et al. | Spherephd: Applying cnns on a spherical polyhedron representation of 360deg images | |
CN106529573A (en) | Real-time object detection method based on combination of three-dimensional point cloud segmentation and local feature matching | |
CN107092871B (en) | Remote sensing image building detection method based on multiple dimensioned multiple features fusion | |
CN107192716A (en) | A kind of workpiece, defect quick determination method based on contour feature | |
CN103679702A (en) | Matching method based on image edge vectors | |
CN104008542B (en) | A kind of Fast Corner matching process for specific plane figure | |
CN1196151A (en) | Method and apparatus for determining position of TV camera for use in virtual studio | |
TWI503760B (en) | Image description and image recognition method | |
CN104517090A (en) | Method and system for detecting QR code detection figures | |
CN103413141B (en) | Ring illuminator and fusion recognition method utilizing ring illuminator illumination based on shape, grain and weight of tool | |
CN104517109A (en) | QR code image correction method and system | |
CN104252711A (en) | Matching method based on image gradient direction code | |
CN105427333A (en) | Real-time registration method of video sequence image, system and shooting terminal | |
JP2017062790A (en) | Object division method, object division device, and object division program | |
CN105374037A (en) | Checkerboard angular point automatic screening method of corner detection | |
TWI497420B (en) | Two-dimentional optical indetification device with same gray level for quickly decoding and method for decoding the same | |
CN110008900A (en) | A kind of visible remote sensing image candidate target extracting method by region to target | |
CN108197531B (en) | Road curve detection method, device and terminal | |
CN108961385A (en) | A kind of SLAM patterning process and device | |
CN117576219A (en) | Camera calibration equipment and calibration method for single shot image of large wide-angle fish-eye lens | |
CN105678791A (en) | Lane line detection and tracking method based on parameter non-uniqueness property | |
US6963664B2 (en) | Segmentation of digital images | |
CN102737360B (en) | Method for fast transforming full distance of binary image | |
CN107480710B (en) | Feature point matching result processing method and device | |
CN102737361B (en) | Method for transforming full distance of three-dimensional binary image |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20141105 Termination date: 20180620 |
|
CF01 | Termination of patent right due to non-payment of annual fee |