a realistic digitization model of straight lineslatecki/papers/cviu97.pdf · a realistic...

12
COMPUTER VISION AND IMAGE UNDERSTANDING Vol. 67, No. 2, August, pp. 131–142, 1997 ARTICLE NO. IV970530 A Realistic Digitization Model of Straight Lines Ari Gross* Department of Computer Science, Graduate Center and Queens College, CUNY, Flushing, New York 11367 and Longin Jan Latecki² Department of Computer Science, University of Hamburg, Vogt-Ko ¨ lln-Str. 30, 22527 Hamburg, Germany Received November 2, 1995; accepted May 29, 1996 to these problems (e.g., Debled and Reveilles [1], Dorst and Smeulders [2, 11], Koplowitz and Sundar Raj [7], Koplowitz Understanding digital lines comprises two components: (i) determining whether a given digital set is a digital line segment, and Bruckstein [8], Rosenfeld and Kim [10], and Veelaert i.e., whether there exists a real straight line in R 2 that digitizes [12]). However, mainly digital lines obtained using object to it; and (ii) recovering the space of straight lines which digitize boundary quantization have gained attention in the litera- to a given digital line segment. Although these problems have ture and, as a result, have been the most thoroughly studied. been extensively studied by researchers in computer vision and Yet, it is well known that this model, although adequate for digital geometry, the primary digitization model that has been computer graphics, is not an adequate model for the digitiza- used is object boundary quantization which is not a realistic tion process for computer vision. sensor model in computer vision. In this paper, we present a In this paper, we show that these results and algorithms realistic mathematical model of a digitized edge which handles are also valid if we assume a much more realistic digitization both blurring and arbitrary thresholding. We show that a model which handles both blurring and arbitrary thresh- thresholded digital image of a blurred half-plane obtained for some unknown threshold value is equal to the image of a per- olding. We show that a digital image of a half-plane obtained fectly focused half-plane with the same slope obtained by object by thresholding a gray-level image gives us the same slope boundary quantization. This result implies that recovering the information about the underlying real line as object bound- slope of a blurred half-plane, given its image obtained for some ary quantization. This follows from the fact that thresh- unknown threshold value, reduces to recovering the slope of a olding a gray-level image of a half-plane is equivalent to first perfectly focused half-plane under object boundary quantiza- translating this half-plane and then applying object bound- tion. Therefore, the previous results and algorithms for the ary quantization. Moreover, we show that the image of a recovery of straight lines, which mainly assumed object bound- blurred half-plane contains the same slope information as ary quantization, are also valid if we assume this more realistic an ideal image with perfectly focused edges. digitization model. 1997 Academic Press Based on this mathematical model, it is possible to design an algorithm to detect linear parts of contours directly from intensity images (without applying edge detection 1. INTRODUCTION before). Since for most digitized objects the boundary is There are many tasks in digital image processing that re- locally indistinguishable from a digital linear boundary, we quire the identification of linear parts of contours in digital can assume the object boundary is piecewise linear so that, images, like the analysis of technical drawings and the iden- in effect, the boundary can be locally modeled by digital tification of manmade objects in satellite images. Some tasks half-planes. Therefore, we can regard our model of a digital additionally require recovering or constraining the space of sensor half-plane under blurring and arbitrary thresholding real straight lines (i.e., slope and translation) which can digi- as a model of a real sensor edge. This model can be used tize to a given digital linear segment. There are many algo- as the basis of an edge detection algorithm. rithms and theoretical considerations which give solutions In Section 2 we formally define the digitization schemes called v-digitization and intersection digitization. Based on results in Section 3, we show in Section 5 that a digital * E-mail: [email protected]. ² E-mail: [email protected]. image of a blurred half-plane obtained by v-digitization 131 1077-3142/97 $25.00 Copyright 1997 by Academic Press All rights of reproduction in any form reserved.

Upload: tranthu

Post on 14-Jul-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

COMPUTER VISION AND IMAGE UNDERSTANDING

Vol. 67, No. 2, August, pp. 131–142, 1997ARTICLE NO. IV970530

A Realistic Digitization Model of Straight LinesAri Gross*

Department of Computer Science, Graduate Center and Queens College, CUNY, Flushing, New York 11367

and

Longin Jan Latecki†

Department of Computer Science, University of Hamburg, Vogt-Kolln-Str. 30, 22527 Hamburg, Germany

Received November 2, 1995; accepted May 29, 1996

to these problems (e.g., Debled and Reveilles [1], Dorst andSmeulders [2, 11], Koplowitz and Sundar Raj [7], KoplowitzUnderstanding digital lines comprises two components: (i)

determining whether a given digital set is a digital line segment, and Bruckstein [8], Rosenfeld and Kim [10], and Veelaerti.e., whether there exists a real straight line in R2 that digitizes [12]). However, mainly digital lines obtained using objectto it; and (ii) recovering the space of straight lines which digitize boundary quantization have gained attention in the litera-to a given digital line segment. Although these problems have ture and, as a result, have been the most thoroughly studied.been extensively studied by researchers in computer vision and Yet, it is well known that this model, although adequate fordigital geometry, the primary digitization model that has been

computergraphics, isnotan adequatemodel for thedigitiza-used is object boundary quantization which is not a realistiction process for computer vision.sensor model in computer vision. In this paper, we present a

In this paper, we show that these results and algorithmsrealistic mathematical model of a digitized edge which handlesare also valid if we assume a much more realistic digitizationboth blurring and arbitrary thresholding. We show that amodel which handles both blurring and arbitrary thresh-thresholded digital image of a blurred half-plane obtained for

some unknown threshold value is equal to the image of a per- olding. We show that a digital image of a half-plane obtainedfectly focused half-plane with the same slope obtained by object by thresholding a gray-level image gives us the same slopeboundary quantization. This result implies that recovering the information about the underlying real line as object bound-slope of a blurred half-plane, given its image obtained for some ary quantization. This follows from the fact that thresh-unknown threshold value, reduces to recovering the slope of a olding a gray-level image of a half-plane is equivalent to firstperfectly focused half-plane under object boundary quantiza- translating this half-plane and then applying object bound-tion. Therefore, the previous results and algorithms for the

ary quantization. Moreover, we show that the image of arecovery of straight lines, which mainly assumed object bound-blurred half-plane contains the same slope information asary quantization, are also valid if we assume this more realistican ideal image with perfectly focused edges.digitization model. 1997 Academic Press

Based on this mathematical model, it is possible to designan algorithm to detect linear parts of contours directlyfrom intensity images (without applying edge detection1. INTRODUCTIONbefore). Since for most digitized objects the boundary is

There are many tasks in digital image processing that re- locally indistinguishable from a digital linear boundary, wequire the identification of linear parts of contours in digital can assume the object boundary is piecewise linear so that,images, like the analysis of technical drawings and the iden- in effect, the boundary can be locally modeled by digitaltification of manmade objects in satellite images. Some tasks half-planes. Therefore, we can regard our model of a digitaladditionally require recovering or constraining the space of sensor half-plane under blurring and arbitrary thresholdingreal straight lines (i.e., slope and translation) which can digi- as a model of a real sensor edge. This model can be usedtize to a given digital linear segment. There are many algo- as the basis of an edge detection algorithm.rithms and theoretical considerations which give solutions In Section 2 we formally define the digitization schemes

called v-digitization and intersection digitization. Based onresults in Section 3, we show in Section 5 that a digital* E-mail: [email protected].

† E-mail: [email protected]. image of a blurred half-plane obtained by v-digitization

1311077-3142/97 $25.00

Copyright 1997 by Academic PressAll rights of reproduction in any form reserved.

132 GROSS AND LATECKI

for some unknown threshold value v is equal to the imageof some translation of the half-plane obtained by intersec-tion digitization. In Section 4 we determine the degreeof accuracy within which one can recover the space ofcontinuous straight lines which digitize to a given digital FIG. 1. (a) The two squares represent a digitization of the ellipse in

which the ratio of the area is equal to 1. (b) The eight squares representline segment. In Section 6 we show that intersection digiti-a digitization of an ellipse with the area ratio equal to 1/5. (c) The unionzation completely determines object boundary quantiza-of all squares represents an intersection digitization of the ellipse.tion and vice versa. Therefore, all results obtained for

recovering straight lines resulting from the digitizationbased on the object boundary quantization model (e.g.,Dorst and Smeulders [2, 11]) can be used to recover straight tions to black and white 2D continuous images, whichlines in digital images even if the threshold v used to seg- represent either a 2D object or the projection of a 3Dment the object boundary is unknown. object; i.e., an object is represented by a subset of the plane

which is black and its background is white. Now we extendour model to be able to digitize intensity (gray-level or

2. DEFINITIONS OF DIGITIZATION SCHEMES multicolor) continuous images.A digitization is a function Dig which assigns a digital

In this paper we use a digitization scheme in which image D 5 Dig(C) to a given continuous image C. Ifthe sensor value depends on the area and the gray-level the value of each square s in a digital image is given byvalue of the object in the square at which the sensor is the formulacentered. Consistent with real sensor output, a digitizationis defined with respect to a grid of squares Q. A square Dig(C)(s) 5 E

sC,

is a black pixel (i.e., belongs to the image of a givenobject) iff the ratio of the area of the object to the area

then we will call v-digitization a binary digital imageof the field ‘‘seen’’ by the corresponding sensor is greaterDigv(C) obtained from Dig(C) by thresholding with v [than some constant threshold value. This scheme corres-[0, 1), i.e.,ponds to the thresholding of a gray value image at

some threshold.Digv(C)(s) 5 1 if Dig(C)(s) . v;An (intensity) continuous image is a function C : R2 RDigv(C)(s) 5 0 otherwise.I and an (intensity) digital image is a function D : Z2 R I,

where I is some intensity space. To be consistent with ourFor v 5 1, Digv(C)(s) 5 1 if Dig(C)(s) 5 1 andprevious notation in [4], we assume that I 5 [0, 1], but theDigv(C)(s) 5 0 otherwise.intensity space I could be any bounded subset of non-

Observe that Dig(C)(s) 5 area(C > s) for every binarynegative real numbers (e.g., I 5 h0, 1, . . . , 255j) or anycontinuous image C, since then es C 5 area(C > s) forproduct of such subsets.every square s. In this case, a square p [ Digv(C) iffIf the function C (D) obtains only two values, zero orarea(p > C)/area(p) . v, where 0 # v , 1 is a constant.one, we speak of a binary continuous (digital) image. AThus, digitization Digv(C) corresponds to a procedure inbinary continuous (digital) image C (D) can be identifiedwhich a pixel is colored black iff the ratio of the area ofwith the set C (D) of points obtaining value 1, e.g., C 5the object ‘‘seen’’ by the sensor to the area of the entireh(x, y) [ R2 : C(x, y) 5 1j. In this terminology, a half-planefield ‘‘seen’’ by the same sensor is greater than some con-P , R2 is identified with its characteristic function P :stant threshold value v. An example is given in Fig. 1b,R2 R I, P(x) 5 1 if x [ P and P(x) 5 0 otherwise.where the eight squares represent a digitization of theThe domain of a digital image D is identified with theellipse with the ratio equal to Ag. For a binary continuousset of grid points Z2, which is a subset of the real planeimage C, Dig1(C) denotes the digitization in which theR2. There are two ways to assign to the grid points a setratio of the area is equal to 1 (see Fig. 1a).of unit squares which form a cover Q of the plane R2: The

Now we define an intersection digitization which corre-squares in Q are centered at points with integer coordinatessponds to the procedure of coloring a pixel black iff thereor the points with integer coordinates determine the corneris a part of the object X in the field ‘‘seen’’ by the corre-points of the squares. We assume for the v-digitization andsponding sensor:intersection digitization, defined below, that the squares

in Q are centered at points with integer coordinates. Thus,A square p [ Q is black iff p > X ? B, and white otherwise.Z2 is identified with Q by identifying a square with its

center point.In Gross and Latecki [4], we applied digitization func- We will call such a set of black squares in Q an intersec-

DIGITIZATION OF STRAIGHT LINES 133

tion digitization of X and denote it by Dig>(X), namelyDig>(X) 5 < hp : p > X ? Bj. See Fig. 1c, for example,where the union of all gray squares represents the intersec-tion digitization of the ellipse. If we treat the squares ofDig>(X) as points in Z 2, then we will call Dig>(X) a digitalimage of X. Thus, Dig>(X) either denotes a digital picture(a subset of Z2) or the union of black squares (a subset ofR2). When digital straight line models were first studiedby Freeman and Rosenfeld, the digitization models thatwere assumed were based on the intersection digitization,which is called square-box quantization by Freeman [3].

FIG. 2. Translating a half-plane by a vector pointing toward its insideWe have the following inclusions Dig1(C) # Digv(C) #preserves the monotonicity of the area function on image squares.Dig>(C) for every v [ [0, 1] (see Fig. 1) and Digv(C) #

Digw(C) if w # v for every v, w [ [0, 1].Since we model real images, without loss of generality, vector of length t perpendicular to the line L pointing

we can assume that for every continuous image function towards the outside of P (see Fig. 2). If t , 0, then Tt(P)C there exists a rectangle that is a union of squares of denotes the translation of P by a vector of length t perpen-cover Q such that C is equal to zero outside of this rectangle dicular to the line L pointing towards the inside of P. Thus,and that, for every digital image function D, there exists Tt(P) , P for t , 0.a digital rectangle h0, . . . , nj 3 h0, . . . , mj such that D is The proof of the following lemma is based on elementaryequal to zero outside of this rectangle. For a digital image properties of areas of triangles and squares.function D, this assumption means that there is only a

LEMMA 3.1. Let A be the area function and let s, s1 , s2finite number of digital points on which the function isbe squares of the square grid Q. The translation T preservesnonzero, which is the case for real digital images. We alsothe monotonicity of the area function in the following senseassume that, for a given object, the rectangles are large(see Fig. 2):enough to include the relevant details of the object.

(1) A(P > s1) , A(P > s2) ⇒ A(Tt(P) > s1) , A(Tt(P) >s2) if A(Tt(P) > s2) ? 0 and A(Tt(P) > s1) ? 1;3. DIGITIZATIONS OF HALF-PLANES

(2) t , 0 ⇒ A(Tt(P) > s) , A(P > s) if 0 , A(P >Digital objects which are images of some real objects s) , 1.

are obtained by a segmentation process that is mostly basedTheorem 3.1 shows that the set of digital lines obtainedon some kind of edge detection and thresholding. Each

as a digitization of some real straight line is the same,such process can be described as locally thresholding theregardless of the v chosen to threshold.value of every pixel to decide whether it belongs to the

THEOREM 3.1. For every half-plane P and every 0 #object or not. Therefore, the threshold value is either un-w , v # 1 there exists t , 0 such thatknown or it varies for local groups of pixels. At first glance

it appears that this fact will rapidly complicate the recoveryDigv(P) 5 Digw(Tt(P)).process. As we will see in Theorem 3.1, however, this

is not the case for half-planes. This theorem states thatBefore we prove this theorem, we illustrate it in the casesegmenting a digital image of a half-plane with different

where w 5 0. By Theorem 3.1, we obtain that for everythresholds will not introduce any new patterns on the0 , v # 1 there exists t , 0 such that Digv(P) 5 Dig0(Tt(P)).boundary of the digital half-plane, since changing a thresh-If we take v 5 As as illustrated in Fig. 3, then there existsold is equivalent to translating the real half-plane and thent , 0 such that Dig1/2(P) 5 Dig0(Tt(P)).digitizing it. Therefore, all results obtained for recovering

straight lines resulting from the digitization based on theobject boundary quantization model (e.g., Dorst andSmeulders [2, 11]) can be used to recover straight lines indigital images even if the threshold v used to segment theobject boundary is unknown (see Corollary 3.1).

In this section we assume that L is a straight line givenby equation y 5 ax 1 b, 0 # a # 1, and P is the lowerclosed half-plane determined by L, i.e., P 5 h(x, y) [R2 : y # ax 1 bj. FIG. 3. For every half-plane P and every 0 # w , v # 1 there exists

t , 0 such that Digv(P) 5 Digw(Tt(P)).If t $ 0, then Tt(P) denotes the translation of P by a

134 GROSS AND LATECKI

Proof of Theorem 3.1. The characteristic function ofthe half-plane P is zero except for some rectangle. Hence,we have only a finite number of squares s [ Q for whichDig(P)(s) 5 A(P > s) ? 0, where A is the area function.Therefore, all squares in grid Q can be grouped into a finitenumber of classes S1 , . . . , Sl with respect to the area oftheir intersection with the plane P, i.e.,

s1 , s2 [ Si iff A(P > s1) 5 A(P > s2) for i 5 1, . . . , l.

We extend the area function to the classes Si for i 51, . . . , l:

FIGURE 4A(P, Si) 5 A(P > s) for some s [ Si .

Observe that the rules (1) and (2) in Lemma 3.1 alsohold for A extended to the classes. The following inequality v-threshold reduces to recovering the slope under objectchain illustrates the order of the classes with respect to boundary quantization. Therefore, we can use the well-the area of the intersection of their members with the plane established techniques for slope recovery of straight lineP and the digitization constants v, w: segments obtained by object boundary quantization.

4. DEGREE OF ACCURACY0 5 A(P, S1) , ? ? ? , A(P, Si) # w , A(P, Si11) , ? ? ? , A(P, Sj)# v , A(P, Sj11) , ? ? ? , A(P, Sk) , ? ? ? , A(P, Sl) 5 1.

Now we consider the degree of accuracy within whichone can recover the space of continuous straight lines whichBy the definition of the digitization, we obtaindigitize to a given digital line segment. In many practicalapplications, the v-threshold used in segmentation is un-Digw(P)\Digv(P) 5 Si11 < ? ? ? < Sj .known. Even if the absolute gray-level or color thresholdis known, we often cannot translate this threshold intoBy the monotonicity of the area function with respectthe normalized [0, 1] v-threshold, since such normalizationto translation T stated in Lemma 3.1, there exists t , 0requires knowing the absolute color/gray-level values ofsuch thatthe bounding surfaces. Therefore, we assume in this analy-sis that the threshold v used to segment the object bound-A(Tt(P) > Sj) # w , A(Tt(P) > Sj11),ary containing the digital line segment is unknown.

According to Corollary 3.1, recovering the slope underwhich implies that Digv(P) 5 Digw(Tt(P)). nthese conditions is not harder than recovering the slope

As a simple consequence of Theorem 3.1, we obtain the under object boundary quantization. Therefore, in the lim-following corollary. iting case, as the window size gets large or, alternatively,

for a fixed window size, as the grid resolution increases,COROLLARY 3.1. For every half-plane P and every 0 ,the slope interval tends to zero. This can be easily seen byv # 1 there exists t , 0 such thatconsidering the diagram in Fig. 4. The slope interval mustbe contained in the interval determined by the acute angleDigv(P) 5 Dig>(Tt(P)).in-between the diagonals of the depicted parallelogram. Ifthe window size increases, then so does the length of theProof. By Theorem 3.1, we obtain that for every 0 ,diagonals of the parallelogram, although the width remainsv # 1 there exists d , 0 such that Digv(P) 5 Dig0(Td(P)).constant. If the window size is fixed but the grid resolutionDig0(Td(P)) can differ from Dig>(Td(P)) by squares s suchincreases, then the width of the parallelogram tends tothat Td(P) > s ? B and A(Td(P) > s) 5 0, where A is thezero while its height remains constant. Thus, in both casesarea function.the angle goes to zero. Therefore, in the limit, the slopeSince there exist only a finite number of squares s [ Qestimation becomes exact.for which Dig(P)(s) 5 A(P > s) ? 0, there exists d #

The situation with recovering the translation interval oft # 0 such that Dig0(Td(P)) 5 Dig>(Tt(P)). na half-plane given its digital image obtained by an unknownv-threshold is not as simple as for recovering the slope.According to Corollary 3.1, recovering the slope of a

half-plane given its digital image obtained by an unknown The unknown threshold value introduces additional ambi-

DIGITIZATION OF STRAIGHT LINES 135

two half-planes parallel to P is less than e(a), then theycan have the same digital image under the intersectiondigitization. Now we define the translation interval assum-ing that the digitization scheme which yields a given digitalimage is unknown, which means that the threshold v canbe any value between zero and one.

A translation interval t(a) of a half plane P with slopea is the maximal distance of two planes parallel to P whichhave exactly the same digital images as P for some 0 # v,w # 1, i.e.,

t(a) 5 suphuq 2 ru : 'v, w 0 # v, w # 1 Digv(Tq(P))5 Digw(Tr(P)) 5 Dig>(P)j.

We show that the length of the translation interval equalst(a) 5 l(a) 1 e(a) and is bounded by

b # l(a) # t(a) # 2l(a) # 2Ï2b,

where b is the length of a side of each square s [ Q.FIG. 5. l(a) denotes the length of the projection fy(s) of a square

s [ Q onto the y-axis. e(a) denotes the maximal distance between twoplanes parallel to P which intersect exactly the same squares as P. Let d(P, s) be the maximal value in projection fy(s) of

a square s, i.e., d(P, s) 5 sup(fy(s)) (see Fig. 6). Noticethat for d(P, s) . 0, d(P, s) is the distance of the furthestpoint of square s to plane P. We have the following equiva-guity in translation interval in comparison to object bound-lences for each square s [ Q:ary quantization. We will now prove that the lower bound

on the translation interval of the digitized half-plane is thelength of the side of the grid square. This strongly indicates d(P, s) # 0 ⇔ Dig(P)(s) 5 1that if greater precision is required in determining the exact

d(P, s) $ l(a) ⇔ Dig(P)(s) 5 0location of an object edge given its digital image, one mustincrease the sensor resolution, i.e. reduce the length of the 0 , d(P, s) , l(a) ⇔ 0 , Dig(P)(s) , 1.side of the grid square.

Let P be the lower half-plane determined by line L withWe recall that Dig(P)(s) 5 A(P > s) for every squareslope a. Let Q be the cover of R2 with unit squares suchs [ Q, where A is the area function.that the sides of the squares intersect line L at an angle

whose tangent is equal to a. Without loss of generality, weimpose a ‘‘new’’ Cartesian xy-coordinate system on R2 suchthat the line L determining P has equation y 5 0 and h(x,y) : y # 0j 5 P. All straight lines parallel to P have anequation y 5 c for c [ R. We will denote a line describedby equation y 5 c as L(c). If c . 0, then c is the distanceto L(c) from L 5 L(0).

By l(a) we will denote the length of the projection fy(s)of a square s [ Q onto the y-axis (see Fig. 5).

Let e(a) be the maximal distance between two planesparallel to P which intersect exactly the same squares asP (see Fig. 5), i.e.,

e(a) 5 suphuq 2 ru : Dig>(Tq(P)) 5 Dig>(Tr(P)) 5 Dig>(P)j.

e(a) is the translation interval of half-plane P for the inter-FIG. 6. d(P, s) denotes the maximal value in projection fy(s).section digitization in the sense that if the distance between

136 GROSS AND LATECKI

THEOREM 4.1. The translation interval of a half-planeP with the slope a is equal t(a) 5 l(a) 1 e(a) (see Fig. 5).

Proof. Without loss of generality, we can assume thatP is in such a position with respect to the square grid Q

that Dig>(P) ? Dig>(Tt(P)) for any t , 0; thus, Tt(P) is atranslation of P towards the inside of P. For example, thisis the case for P shown in Fig. 5. By definition of e(a),Dig>(Tt(P)) 5 Dig>(P) for every 0 , t , e(a); here Tt(P)is a translation of P towards the outside of P.

Since, the characteristic function of the half-plane P iszero except for some rectangle, there is only a finite set ofsquares Q9 with the property s [ Q9 iff A(P > s) ? 0.Therefore, all squares in grid Q9 can be grouped into a

FIG. 7. length(s, L(y)) denotes the length of the intersection finite number of classes S1 , . . . , Sl with respect to functionL(y) > s, where L(y) is a line parallel to L(0) and square s [ Q. d, i.e.,

s1 , s2 [ Si iff d(P, s1) 5 d(P, s2) for i 5 1, . . . , l.LEMMA 4.1. Dig(P) is monotone decreasing with respect

to function d: We extend function d to the classes Si for i 5 1, . . . , l:d(P, Si) 5 d(P, s) for some s [ Si .

d(P, s1) # d(P, s2) ⇔ Dig(P)(s1) $ Dig(P)(s2) The following inequality chain illustrates the order offor any two squares s1 , s2 . the classes with respect to function d and constant l(a):

If 0 , Dig(P)(s1), Dig(P)(s2) , 0, then we additionally (1) d(P, S1) , ? ? ? , d(P, Sj) # l(a) , d(P, Sj11) , ? ? ? , d(P, Sl).have

Since a square s [ Dig>(P) iff d(P, s) # l(a), we obtaind(P, s1) , d(P, s2) ⇔ Dig(P)(s1) . Dig(P)(s2). Dig>(P) 5 S1 < ? ? ? < Sj .

Let P9 5 Tr1e(a)(P) for some 0 # r , l(a). We show thatProof. We first show that Dig(P) is monotone decreas- there exists 0 # v # 1 such that Digv(P9) 5 Dig>(P). Since

ing with respect to d, i.e., for any two squares s1 , s2 we have translation Tr1e(a)(P) preserves the order of squares withrespect to d, the order for P9 is the same as in (1):

d(P, s1) # d(P, s2) ⇔ Dig(P)(s1) $ Dig(P)(s2).

(2) d(P9, S1) , ? ? ? , d(P9, Sj) , d(P9, Sj11) , ? ? ? , d(P9, Sl).Let length(s, L(y)) be the length of the intersection L(y) >s, where L(y) is a line parallel to L(0) and square s [ Q

Since s1 , s2 [ Si means d(P, s1) 5 d(P, s2), we have A(P9 >(see Fig. 7). We have for the characteristic function of the

s1) 5 A(P9 > s2) for i 5 1, . . . , l. Hence, we can extendhalf-plane P:

function A to the classes Si for i 5 1, . . . , l:

Dig(P)(s)A(P9, Si) 5 A(P9 > s) for some s [ Si .

5 EsP 5 El

u50length(s, L(d(P, s) 2 u)) P(L(d(P, s) 2 u))­u.

We show now that A(P9, Sj11) , 1. Let s [ Sj11 . SinceDig>(Tt(P)) 5 Dig>(P) for every 0 , t , e(a) and s ÓIf d(P, s1) # d(P, s2), then for every 0 # u # l we haveDig>(P), we obtain that Te(a)(P) > s is either the empty(see Fig. 7)set or a vertex point of s. Since r , l(a) and P9 5 Tr1e(a)(P),we have A(P9, Sj11) , 1.

P(L(d(P, s1) 2 u)) $ P(L(d(P, s2) 2 u)), and By the inequalities in Lemma 4.1, (2) implies the follow-ing reverse order of squares with respect to the arealength(s1 , L(d(P, s1) 2 u)) 5 length(s2 , L(d(P, s2) 2 u)).function:

Therefore, Dig(P)(s1) $ Dig(P)(s2). The inverse implica-1 5 A(P9, S1) 5 ? ? ? 5 A(P9, Si) . ? ? ? A(P9, Sj)tion as well as the second part of this lemma follow from

the same arguments. n . A(P9, Sj11) . ? ? ? A(P9, Sk) 5 ? ? ? 5 A(P9, Sl) 5 0.

DIGITIZATION OF STRAIGHT LINES 137

We have A(P9, Sj) . A(P9, Sj11), since A(P9, Sj11) , 1. the same digital image under object boundary quantiza-tion. From Kronecker’s theorem we have that ( f (x) modTherefore, there always exists v such that A(P9, Sj) . v .

A(P9, Sj11) and we obtain that Digv(P9) 5 Dig>(P) 5 1) is dense in [0, 1]. Therefore, there exists n [ N such thatS1 < ? ? ? < Sj .

We showed that for every r, 0 # r , l(a), there exists 1 . ( f (n) mod 1) . 1 2 c.0 # v # 1 such that Digv(Tr1e(a)(P)) 5 Dig>(P). Sincesuphr : 0 # r , l(a)j 5 l(a), we obtain t(a) $ l(a) 1 e(a). Hence, f (n) ? g(n) 5 f (n) 1 1.

To show that t(a) cannot be greater than l(a) 1 e(a), it We obtain that for a digital line that is the digitizationis enough to observe that if r . l(a), then Tr1e(a)(P) will of a real line in R2 with irrational slope a, the translationinterest some square s Ó Dig>(P). n interval e(a) goes to zero as the line goes to infinity. The

slope interval, as we already know, also goes to zero inCOROLLARY 4.1. The translation interval t(a) of a half- the limit. Thus, the underlying line is fully determined if

plane P with the slope a is bounded by the threshold value is known.

b # l(a) # t(a) # 2l(a) # 2Ï2b, 5. DIGITIZATIONS OF BLURRED HALF-PLANES

A blurring function is any function B which, applied towhere b is the length of a side of each square s [ Q.a half-plane P, produces the output B(P) : R2 R I such that

By Corollary 4.1, the accuracy of estimation of the the following conditions all hold (see Fig. 8):translation interval of a half-plane cannot be increased

(a) B(P) is monotone decreasing in the direction per-by increasing the window size if its digital image obtainedpendicular to P pointing toward the outside of Pby an unknown v-threshold is given. However, we can

(b) for every line L parallel to P we have B(P)(a) 5increase the accuracy if we increase the grid resolution,B(P)(b) if a, b [ Lwhich means we reduce the length of the side of the

(c) h(x, y) [ R2 : B(P)(x, y) 5 1j ? B and h(x, y) [grid square. As we have above, in the limiting case, asR2 : B(P)(x, y) 5 1j # Pthe window size gets large or, alternatively, for a fixed

(d) h(x, y) [ R2 : B(P)(x, y) 5 0j ? B and h(x, y) [window size, as the grid resolution increases, the slopeR2 : B(P)(x, y) 5 0j > P 5 B.interval tends to zero.

One can ask now a question whether we can improve For example, Gaussian blurring, and generally everythe accuracy of estimation of the translation interval of a rotationally symmetric blurring function, satisfies thesehalf-plane P by increasing the window size if the threshold conditions. Hence, the following theorem applies to thesevalue v is known. Assuming that the half-plane P has slope blurring functions.a, to answer this question it is enough to estimate e(a), One of the most significant results is that the slope ambi-which is defined for object boundary quantization. We guity for a blurred digital line is no greater than for ashow that for planes with irrational slope, as the window perfectly focused digital line. This follows from Theoremsize gets large the translation interval e(a) tends to zero, 5.1, which states that given a thresholded digital image ofand that this is not the case for planes with rational slope. a blurred half-plane, the same image can be obtained by

Each straight line with a rational slope is periodic with digitizing some translation of the perfectly focused, originalperiod q if a line is given by the equation l(x) 5 (p/q)x 1 half-plane. As an example consider the three digital half-b/q, where q, p, b are natural numbers with q, p being planes shown in Fig. 12D. They are obtained by thresh-relatively prime. It is enough to observe that (x1 5 x2 mod olding the intensity digital image of a blurred half-planeq) implies hl(x1)j 5 hl(x2)j, where haj 5 a 2 a and a is shown in Fig. 12B with three different threshold values.a floor function. Therefore, increasing the window size to Now these digital half-planes can also be obtained by dig-infinity will not cause the translation interval e(a) to tend itizing translations of the perfectly focused, original half-to zero. For continuous straight lines with an irrational plane. Thus, for a given digital half-plane, it is impossibleslope, however, the translation interval e(a) tends to zero, to distinguish whether the original continuous half-planeas the window size gets infinitely large. To show this, we was perfectly focused or not.use the following theorem. By Theorem 5.1 and Corollary 3.1, recovering the slope

of a blurred half-plane given it digital image obtained byKRONECKER’S THEOREM (Verkov [13, pp. 34–37]). Ifan unknown v-threshold reduces to recovering the slopea is irrational, then the set of points (na mod 1) for n [ Nunder object boundary quantization of a perfectly focusedis dense in the interval [0, 1].half-plane. Therefore, we can use the well-established tech-niques for slope recovery of straight line segments devel-We show that an irrationally sloped line f (x) 5 ax and

its translation g(x) 5 ax 1 c with 0 , a, c , 1 cannot have oped for object boundary quantization.

138 GROSS AND LATECKI

FIG. 8. A blurred half-plane.

THEOREM 5.1. For every half-plane P, every 0 # For a line L(y) parallel to L(0) and a square s [ Q, length(s,L(y)) denotes the length of the intersection L(y) > s (seev # 1, and every blurring function B, there exists r [ R

such that Fig. 9), as defined in Section 4. We obtain

Digv(B(P)) 5 Digv(Tr(P)). Dig(B(P))(s) 5 EsB(P)

5 El

u50length(s, L(d(P, s) 2 u))B(P)(L(d(P, s) 2 u))­u.Proof. The characteristic function of the half-plane P

is zero, except for some rectangle. Hence, we have only afinite number of squares s [ Q for which Dig(P)(s) 5 If d(P, s1) # d(P, s2), then for every 0 # u # l we haveA(P > s) ? 0, where A is the area function. (see Fig. 9):

Let P be a half-plane with slope a and let B(P) :R2 R I be a blurred half-plane. Let L(0) be some straight

B(P)(L(d(P, s1) 2 u)) $ B(P)(L(d(P, s2) 2 u)),line L parallel to P for which B(P)(L) 5 1. For the illustra-tion see Fig. 8. length(s1 , L(d(P, s1) 2 u)) 5 length(s2 , L(d(P, s2) 2 u)).

Without loss of generality, we impose a Cartesian xy-coordinate system on R2 such that line L(0) has equation

Therefore, Dig(B(P))(s1) $ Dig(B(P))(s2). The inverse im-y 5 0 and h(x, y) : y # 0j # P. All straight lines parallel toplication follows from the same arguments.P have an equation y 5 c for c [ R. We will denote a line

Since there is a finite number of squares for whichdescribed by equation y 5 c as L(c). If c . 0, then c is theB(P) ? 0, all squares in a grid can be grouped into a finitedistance to L(c) from L(0). B(P) as a function on straight

lines is monotone decreasing:

y1 # y2 ⇔ B(P)(L(y1)) $ B(P)(L(y2)).

Let Q be the cover of R2 with unit squares. Of course,the sides of the squares are not necessarily aligned withthe coordinate axes. Let l(a) be, as defined in Section 4,the length of the projection fy(s) of any square s [ Q ontothe y-axis. Let d(P, s) be, as defined in Section 4, themaximal value in projection fy(s), i.e., d(P, s) 5 sup(fy(s))(see Fig. 8). Notice that if d(P, s) . 0, then d(P, s) is thedistance of the furthest point of square s to line L(0). Weshow that Dig(B(P)) is monotone decreasing with respectto d, i.e., for any two squares s1 , s2 ,

FIG. 9. length(s, L(y)) denotes the length of the intersectionL(y) > s for a line L(y) parallel to L(0) and s [ Q.d(P, s1) # d(P, s2) ⇔ Dig(B(P))(s1) $ Dig(B(P))(s2).

DIGITIZATION OF STRAIGHT LINES 139

number of classes S1 , . . . , Sn with respect to the value ofthe function Dig(B(P)), i.e.,

s1 , s2 [ Si iff Dig(B(P))(s1)5 Dig(B(P))(s2) for i 5 1, . . . , n.

FIG. 10. The black points represent the digitization DOBQ(L) of astraight line L.We extend function Dig(B(P)) to the classes Si for i 5

1, . . . , n:

Dig(B(P))(Si) 5 Dig(B(P))(s) for any s [ Si . such that

Digv(B(P)) 5 Dig>(Tl(P)).Since there is only a finite number of classes for 0 #v # 1, we obtain

Proof. It is enough to take l 5 t 1 r, where t, r are asstated in Corollary 3.1 and Theorem 5.1. n

0 5 Dig(B(P))(S1) , ? ? ? , Dig(B(P))(Sk) # v, Dig(B(P))(Sk11) , ? ? ? , Dig(B(P))(Sn) 5 1.

6. OBJECT BOUNDARY QUANTIZATION

In this section, we show that intersection digitization ofThus, Digv(B(P))(s) 5 1 iff s [ Sk11 < ? ? ? < Sn .a straight line L and object boundary quantization, definedObserve that if 0 , Dig(B(P))(Si) , 1, then s1 , s2 [ Si

below, completely determine each other. This observationiff d(P, s1) 5 d(P, s2) for i 5 1, . . . , n. Let t be a constantallows us to substitute in the above results intersectionsuch that d(P, sk) , t , d(P, sk11) for sk [ Sk and sk11 [digitization with object boundary quantization which isSk11 , where Dig(B(P))(Sk) # v , Dig(B(P))(Sk11). Since,described by the equation given in Proposition 6.1.Dig(B(P)) is monotone decreasing with respect to d, we

A digitization schema that is commonly used in visionobtain Digv(B(P))(s) 5 1 iff t . d(P, s) and Digv(B(P))geometry literature is subset digitization, where the subset(s) 5 0 iff d(P, s) . t. Let P(L(t)) be the lower half-planedigitization of a planar set X is defined as the set of griddetermined by line L(t): P(L(t)) 5 hL(y) : t $ yj. Thenpoints that are contained in X:Digv(B(P)) 5 Dig1(P(L(t))), since

SD(X) 5 hs [ Z2 : s [ Xj.t . d(P, s) ⇔ s , P(L(t)) ⇔ A(s > (P(L(t))) 5 1;t , d(P, s) ⇔ A(s > (P(L(t)))c . 0.

In order to use this schema for a straight line, functionSD is first applied to a half-plane determined by the

It is now enough to translate half-plane P by a vector line. The boundary of the digital half-plane obtained inperpendicular to P of length a such that Ta(P) 5 P(L(t)). this way constitutes the digitization of the line. The resultThen we obtain Digv(B(P)) 5 Dig1(Ta(P)). By Theorem is referred to as object boundary quantization and is3.1, there exists b , 0 such that Dig1(Ta(P)) 5 defined asDigv(Tb(Ta(P)). If we take r 5 b 1 a, then we obtainDigv(B(P)) 5 Digv(Tr(P)). n DOBQ(X) 5 bd4SD(X),

By Theorem 5.1 and Corollary 3.1, recovering the slopewhere bd4A 5 ha [ A : N4(a) > Ac ? Bj for a digital setof a blurred half-plane given its digital image obtained byA (Ac denotes the complement of A). The motivation foran unknown v-threshold reduces to recovering the slopeobject boundary quantization is that in computer visionunder intersection digitization of a perfectly focused half-digital curves generally occur as object boundaries. There-plane. As will be shown in Section 6, intersection digitiza-fore, digital lines are considered to be the boundaries oftion completely determines object boundary quantization.digitized half-planes.Therefore, we can apply the well-established techniques

Without loss of generality, we assume that the slope offor slope recovery of sraight line segments developed forall lines considered is in the interval [0, 458] and that aobject boundary quantization to recover the slope of astraight line L determines its lower half-plane, which weblurred half-plane given its digital image obtained by anwill denote by P(L). If a line L is given by the equationunknown v-threshold.y 5 ax 1 b (0 # a # 1), then the

COROLLARY 5.1. For every half-plane P, every 0 #v # 1, and every blurring function B there exists l [ R DOBQ(P(L)) 5 h(x, ax 1 b) : x [ Zj,

140 GROSS AND LATECKI

vertices at points in Z2, where each square in S does notcontain its left and top sides; i.e., if s [ S has vertices (x,y), (x 1 1, y), (x, y 1 1), (x 1 1, y 1 1), then s 5 (x, x 11] 3 [y, y 1 1), where (x, x 1 1], [y, y 1 1) are half-openand half-closed intervals.

Observe that a line L always goes between a blackFIG. 11. The gray squares represent the intersection digitization of point (x, y) [ DOBQ(L) and its white north neighbor

a straight line. (x, y 1 1), which we denote North(x, y) (see Fig. 10,for example). We denote by Sq(DOBQ(L)) the set of allsquares s [ S such that the pair of points (x, y) [

holds, where . is the floor function. Since we associate with DOBQ(L) and North(x, y) determines the left or righteach line L the lower half-plane P(L) determined by L, i.e., side of s (see Fig. 11). Observe that line L intersectsP(L) 5 h(x, y) [ R2 : y # ax 1 bj, we will write DOBQ(L) all squares in Sq(DOBQ(L)).for DOBQ(P(L)). For example, in Fig. 10 the black points On the other hand, if a line L with the slope in the

interval [0, 458] intersects a square s [ S, then L intersectsrepresent the digitization DOBQ(L) of the depicted line L.Let S be a cover of the plane by unit squares with either the left or right side of s in such a way that the

FIG. 12. (A) and (B) show two images of a blurred black half-plane on a white background forming the angle 134.718 with the horizontal line:(A) a real image taken by a CCD camera and (B) an intensity digital image generated following precisely our model of blurring and digitization.(C) shows the image in (A) and (D) shows the image in (B) when they are respectively thresholded with three different threshold values.

DIGITIZATION OF STRAIGHT LINES 141

bottom point of this side belongs to DOBQ(L) and the top regular structure of the lines in image D can still be foundin C. The dominating diagonal [21, 1] move in image Dpoint is white (see Fig. 11).

From the above considerations, it follows that the object is still dominating in C. (For a, b integers [a, b] denotes aplanar vector in the standard Cartesian coordinate system.)boundary quantization DOBQ(L)) of a straight line L and

the intersection digitization Dig>(L) completely determine Of course, the lines in C are not as regular as in D; forexample, we can have singular [21, 2] or [22, 1] moves,each other.but these moves mostly cancel each other out and occur sin-

PROPOSITION 6.1. Let L be a straight line with the slope gularly.in the interval [0, 458]. Then Dig>(L) 5 Sq(DOBQ(L)).

8. CONCLUSIONS AND FUTURE WORK7. EXPERIMENTAL RESULTS SUPPORTING OUR

In this paper, we considered a realistic model of the realDIGITIZATION MODELsensor digitization process that handles both blurring andarbitrary thresholding and presented experimental resultsWe model a digitization and segmentation process aswhich justify the accuracy of our model. By Corollary 5.1,a relation between a continous subset C of R2 (represent-recovering the slope of a blurred half-plane given its digitaling a 2D object or a 2D projection of a 3D object) andimage obtained by an unknown v-threshold reduces to re-its digital image. To make our model realistic, first wecovering the slope under intersection digitization (i.e.,apply a blurring function B to a continuous 2D set C.square-box quantization) of a perfectly focused half-plane.An output is a 2D continuous intensity image B(C).As is shown in Section 6 intersection digitization completelyThis image is then mapped to a digital intensity imagedetermines object boundary quantization. Hence, the re-by the formulasults and algorithms developed for digital lines obtained un-der object boundary quantization are also valid if we assume

Dig(B(C))(s) 5 EsB(C) this more realistic digitization model.

The similarity between idealized digital lines and realsensor digital lines, shown in this paper, indicates that the

for every square s of the cover of the plane R2. Finally, by structure of digital lines in real images is regular enoughthresholding Dig(B(C)) with some v [ [0, 1], we obtain a to allow for both detection and recovery. Based on thisbinary digital image Digv(B(C)). This image can be identi- observation, we are developing an algorithm for edge de-fied with the union of squares representing black pixels, tection in which our edge characterization helps to signifi-which is a subset of R2. We use this model to compare cantly reduce the number of wrong edge responses. At thegeometric properties of a continuous 2D object C and its same time, this algorithm performs boundary detection,binary digital image Digv(B(C)). tracking, thinning, and filling gaps in the boundary. It will

Now we describe an experiment demonstrating the accu- be presented in a forthcoming paper.racy of our digitization and segmentation model. We con-centrate on continuous objects being half-planes.

REFERENCESHowever, since for most digital objects the boundary islocally indistinguishable from the boundary of a half-plane,

1. Debled and J.-P. Reveilles, A linear algorithm for segmentation ofwe can regard our model of a digital sensor half-planedigital curves, IEEE Int. Journal PRAI, to appear.under blurring and arbitrary digitization threshold as a

2. L. Dorst and A. W. M. Smeulders, Discrete straight line segments:model of a real sensor edge.Parameters, primitives, and properties, in Vision Geometry (R. A.

Figure 12A shows a real image taken by a CCD camera Melter, A. Rosenfeld, and P. Bhattacharya, Eds.), Contemporaryof a black half-plane on a white background forming an Mathematics, Vol. 119, pp. 45–62, Amer. Math. Soc., Providence,

RI, 1991.angle of 134.718 with the horizontal line. Figure 12B shows3. H. Freeman, Boundary encoding and processing, in Picture Processingan intensity digital image which was generated following

and Psychopictures (B. S. Lipkin and A. Rosenfeld, eds.), pp. 241–266,precisely our digitization model. Here we also used a blackAcademic Press, New York, 1970.half-plane on a white background forming angle 134.718

4. A. Gross and L. Latecki, Digitizations preserving topological andwith the horizontal line. Figure 12 (C and D) shows thedifferential geometric properties, Comput. Vision Image Understand-

same images thresholded with three different threshold ing 62, 1995, 381–393.values. The small difference between images in C and D 5. T. Y. Kong and A. Rosenfeld, Digital topology: Introduction andcan be regarded as due to noise produced by the CCD survey, CVGIP 48, 1989, 357–393.camera. These two images differ along the digital lines 6. C. E. Kim and A. Rosenfeld, Digital straight lines and convexity of

digital regions, IEEE Trans. PAMI 4, 1982, 149–153.identified by the boundaries of the digital half-planes withthree different gray level values. Observe that the same 7. J. Koplowitz and A. P. Sundar Raj, A robust filtering algorithm for

142 GROSS AND LATECKI

subpixel reconstruction of chain coded line drawings, IEEE Trans. (R. A. Melter, A. Rosenfeld, and P. Bhattacharya, Eds.), Contempo-PAMI 9, 1987, 451–457. rary Mathematics, Vol. 119, pp. 169–195, Amer. Math. Soc. Provi-

dence, RI, 1991.8. J. Koplowitz and A. M. Bruckstein, Design of perimeter estimators fordigitized planar shapes, IEEE Trans. PAMI 11, 1989, 611–622. 12. P. Veelaert, Digital planarity of rectangular surface segments, IEEE

Trans. PAMI 16, 1994, 647–652.9. L. Latecki, U. Eckhardt, and A. Rosenfeld, Well-composed sets,Comput. Vision Image Understanding 61, 1995, 70–83. 13. B. A. Verkov, Elementary Number Theory, Wolters-Noordhoff,

Groningen, 1970.10. A. Rosenfeld and C. E. Kim, How a digital computer can tell whethera line is straight, Amer. Math. Monthly 89, 1982, 230–235. 14. M. Worring and A. W. M. Smeulders, Digitized circular arcs: Charac-

terization and parameter estimation, IEEE Trans. PAMI 17, 1995,11. A. W. M. Smeulders and L. Dorst, Decomposition of discrete curvesinto piecewise straight segments in linear time, in Vision Geometry 587–598.