+ All Categories
Home > Documents > Algorithms for Detecting M-Dimensional Objects in N-Dimensional Spaces

Algorithms for Detecting M-Dimensional Objects in N-Dimensional Spaces

Date post: 07-Nov-2016
Category:
Upload: larry-h
View: 217 times
Download: 1 times
Share this document with a friend
12
SHARON- SALVETER IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI^3, NO. 3, MAY 1981 Algorithms for Detecting M-Dimensional Objects in N-Dimensional Spaces VANGALUR S. ALAGAR AND LARRY H. THIEL 245 Abstract-Exact and approximate algorithms for detecting lines in a two-dimensional image space are discussed. For the case of uniformly distributed noise within an image space, transform methods and differ- ent notions of probability measures governing the parameters of the transforms are described. It is shown that different quantization schemes of the transformed space are desirable for different probabi- listic assumptions. The quantization schemes are evaluated and com- pared. For one of the procedures that uses a generalized Duda-Hart procedure and a mixed quantization scheme, the time complexity to find all m-flats in n-space is shown to be bounded by O(ptm(n-m) ), where p is the number of points and t is a user parameter. For this procedure more true flats in a given orientation have been found and the number of spurious flats is small. Index Terms-Beta distribution, generalized Duda-Hart procedure, geometric probability, Hough transform, m-flat detection in n-space, mixed quantization. I. INTRODUCTION IN this paper we discuss exact and approximate algorithms for detecting straight lines in a two - dimensional image space. We also present a unified theory that leads to a systematic pro- cedure for detecting m-flats in an n-dimensional space of noisy feature points. Throughout this paper, by an "exact" algo- rithm we mean an algorithm whose tolerance is limited to that required by the accuracy of the data. In digitized images a pattern may be defined as a collection of points that exhibit a structure; and a structure may be under- stood as a nonrandom distribution of features of a specific kind. As remarked by Moore and Parker [1 ], a uniform distribution of points in an image space by its very nature implies the lack of structure and it is almost axiomatic that lack of uniformity forces the presence of structures. The detection of patterns that can be characterized by a small number of parameters and that can be recognized as geometrical shapes such as lines and circles are of interest, and important in an image processing environment. The structures that are present in an image space get blurred due to the presence of noise. We may define noise as a set of random points that have a uniform probability distribution within the image space. Any procedure that detects structures in a noisy image space must isolate structure points from noise and recognize the recovered structure. We are mainly concerned with recovering structures of known shapes (the parameters may be known or unknown) and "recovering" is to be under- stood as "isolation and reconstruction." We discuss methods Manuscript received June 15, 1978; revised November 1, 1979. The authors are with the Department of Computer Science, Con- cordia University, Montreal, P.Q., Canada. to detect linear structures (m-flats) with m + 1 parameters in n-space. For m = 1 and n = 2, the linear structures are straight lines in a plane. The reader is referred to the survey article of Inani and Shapiro [2] for several line detection methods. Our five-fold aims in this paper are as follows. 1) To examine both exact and approximate line detection algorithms which operate on a two-dimensional image space. 2) To generalize the Duda and Hart transformation to n- dimensional image space in the following sense: given p points in n-space and integers m and k, 1 <m<n, m+ 1 6k6p, then detect and output all m-flats, each containing at least k points. It must be understood here that the image space con- sists of feature points forming m-flats superimposed with noisy points. 3) To discuss quantization schemes consistent with the distribution of the parameters that characterize the generalized Duda-Hart procedure. 4) To give evaluations of the several algorithms. 5) To describe implementation details, operational complex- ity, and test results of our procedure. The exact algorithms discussed in Section III operate on a relatively noise-free image space and thus can be looked upon as reconstruction methods. The approximate algorithms based on exact or approximate hypotheses assume the presence of independent and identically distributed uniform noise points superimposed with feature points in the image space. The algorithms assume that Cartesian coordinates of points in the image space are given. Three questions arise naturally with evaluation of algorithms, namely: why evaluate, what to evaluate, and how to evaluate. We answer the question "why" by simply pointing out the several existing applications and usefulness of a solution to this problem in the area of pattern recognition and image processing. Moreover, evaluation is necessary to gain insight into the problem, as well as to justify a method in a specific context. In response to the question "what" we assert that both the quantitative and qualitative natures of a procedure must be evaluated. These are: 1) the complexity (or cost) measured as a function of the parameters characterizing the input (clearly, this measure depends upon the degree of the flat to be detected, the dimension of the image space, and the number of points in the image space); and 2) the effectiveness (or robustness) of a procedure measures the usefulness of the result. There are three measures of robustness: precision, recall, and what we call goodness (or generality). Finally, the answer to the question "how" revolves around the answer to the previous question. All exact algorithms by 0162-8828/81/0500-0245$00.75 © 1981 IEEE
Transcript

SHARON- SALVETERIEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI^3, NO. 3, MAY 1981

Algorithms for Detecting M-Dimensional Objectsin N-Dimensional Spaces

VANGALUR S. ALAGAR AND LARRY H. THIEL

245

Abstract-Exact and approximate algorithms for detecting lines in atwo-dimensional image space are discussed. For the case of uniformlydistributed noise within an image space, transform methods and differ-ent notions of probability measures governing the parameters of thetransforms are described. It is shown that different quantizationschemes of the transformed space are desirable for different probabi-listic assumptions. The quantization schemes are evaluated and com-pared. For one of the procedures that uses a generalized Duda-Hartprocedure and a mixed quantization scheme, the time complexity tofind all m-flats in n-space is shown to be bounded by O(ptm(n-m) ),where p is the number of points and t is a user parameter. For thisprocedure more true flats in a given orientation have been found andthe number of spurious flats is small.

Index Terms-Beta distribution, generalized Duda-Hart procedure,geometric probability, Hough transform, m-flat detection in n-space,mixed quantization.

I. INTRODUCTIONIN this paper we discuss exact and approximate algorithms

for detecting straight lines in a two - dimensional image space.We also present a unified theory that leads to a systematic pro-cedure for detecting m-flats in an n-dimensional space of noisyfeature points. Throughout this paper, by an "exact" algo-rithm we mean an algorithm whose tolerance is limited to thatrequired by the accuracy of the data.In digitized images a pattern may be defined as a collection

of points that exhibit a structure; and a structure may be under-stood as a nonrandom distribution of features of a specific kind.As remarked by Moore and Parker [1 ], a uniform distributionof points in an image space by its very nature implies the lackof structure and it is almost axiomatic that lack of uniformityforces the presence of structures. The detection of patternsthat can be characterized by a small number of parametersand that can be recognized as geometrical shapes such as linesand circles are of interest, and important in an image processingenvironment.The structures that are present in an image space get blurred

due to the presence of noise. We may define noise as a set ofrandom points that have a uniform probability distributionwithin the image space. Any procedure that detects structuresin a noisy image space must isolate structure points from noiseand recognize the recovered structure. We are mainly concernedwith recovering structures of known shapes (the parametersmay be known or unknown) and "recovering" is to be under-stood as "isolation and reconstruction." We discuss methods

Manuscript received June 15, 1978; revised November 1, 1979.The authors are with the Department of Computer Science, Con-

cordia University, Montreal, P.Q., Canada.

to detect linear structures (m-flats) with m + 1 parameters inn-space. For m = 1 and n = 2, the linear structures are straightlines in a plane. The reader is referred to the survey article ofInani and Shapiro [2] for several line detection methods.Our five-fold aims in this paper are as follows.1) To examine both exact and approximate line detection

algorithms which operate on a two-dimensional image space.2) To generalize the Duda and Hart transformation to n-

dimensional image space in the following sense: given p pointsin n-space and integers m and k, 1 <m<n, m+ 1 6k6p,then detect and output all m-flats, each containing at least kpoints. It must be understood here that the image space con-sists of feature points forming m-flats superimposed with noisypoints.3) To discuss quantization schemes consistent with the

distribution of the parameters that characterize the generalizedDuda-Hart procedure.4) To give evaluations of the several algorithms.5) To describe implementation details, operational complex-

ity, and test results of our procedure.The exact algorithms discussed in Section III operate on a

relatively noise-free image space and thus can be looked uponas reconstruction methods. The approximate algorithms basedon exact or approximate hypotheses assume the presence ofindependent and identically distributed uniform noise pointssuperimposed with feature points in the image space. Thealgorithms assume that Cartesian coordinates of points in theimage space are given.Three questions arise naturally with evaluation of algorithms,

namely: why evaluate, what to evaluate, and how to evaluate.We answer the question "why" by simply pointing out theseveral existing applications and usefulness of a solution tothis problem in the area of pattern recognition and imageprocessing. Moreover, evaluation is necessary to gain insightinto the problem, as well as to justify a method in a specificcontext. In response to the question "what" we assert thatboth the quantitative and qualitative natures of a proceduremust be evaluated. These are: 1) the complexity (or cost)measured as a function of the parameters characterizing theinput (clearly, this measure depends upon the degree of theflat to be detected, the dimension of the image space, and thenumber of points in the image space); and 2) the effectiveness(or robustness) of a procedure measures the usefulness of theresult. There are three measures of robustness: precision,recall, and what we call goodness (or generality).

Finally, the answer to the question "how" revolves aroundthe answer to the previous question. All exact algorithms by

0162-8828/81/0500-0245$00.75 © 1981 IEEE

IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI-3, NO. 3, MAY 1981

their very nature must be robust. Thus, the quantity to bemeasured is the cost, which we will measure in terms of thenumber of passes made over the data, i.e., as a function ofp when there are p points in the image space. This measureis justified since this is the only measure that can discriminatebetween exact algorithms and establish the superiority of oneover the other.Any algorithm to detect m-flats under allowed inaccuracies

may find flats which do not actually exist in the image spaceor may fail to detect flats that really exist. In such situations ameasure of robustness may be defined as follows. Let Mk =MT + mF, where MT is the number of detected m-flats iden-tical with existing flats in the image space, MF is the numberof "false" detected m-flats, and mk is the number of flats de-tected and output by an algorithm. Let Mk denote the actualnumber of m-flats in the image space containing at least kpoints each. We assume that such an information is obtainedby an exact examination of the space. Now we define theratios

P = precision = MTlMkR = recall = MTIMk

G = goodness = (MT - MF)IMk.We may say that a procedure is robust when all these ratiosare close to one, which happens only when almost all the de-tected flats are true flats, i.e., MF 0O and MT CMk- In orderto clearly discriminate between two algorithms it is better toconsider one measurable value whose general form can betaken as (o!P+ OR + yG)l(8E + 1), where ,f, 'y, and 6 are rela-tive weights of importance given to precision, recall, goodness,and expense. The advantage of this single measure is that itcan adapt itself for any additional measure of robustness;moreover, by changing the values of relative weights, say be-tween 0 and 1 after normalization, algorithms of the sameclass can be compared and discriminated.

In Section III, where we discuss exact algorithms, cost mea-sures are compared, and in Section V measures of robustnessare used to evaluate our test results.

II. BASIC DEFINITIONS

The sequence point, line, plane, 3-flat, - -, and n-flat are re-gions determined by one, two, three, four, * - , (n + 1) linearlyindependent points and, respectively, have zero, one, two,three, - - , and n dimensions. Thus, an f-flat is determined by(f + 1) linearly independent points, in the sense that no r ofthese points (r <f) lie in the same (r - 2)-flat. An f-flat andan n - 1 flat (hyperplane),f< n - 1, which are both containedin an n-flat, have in common an f- 1 flat if they intersect.For the present we let Sf denote an f-flat determined by(f + 1) independent points.

Clearly, an f-flat and an fi -flat, where fi = n - f- 1 haveeach (f + 1) (n - f) degrees of freedom in n-dimensions. Thus,there is a 1-1 correspondence between Sf and Sf, . In particu-lar, there exists a 1-1 correspondence between points andSn-1, so that to the line joining two points corresponds theS- 2 of the intersection of the two corresponding S, l.More generally, to a Sf_ 1 determined by findependent points

corresponds the Sn-f common to the fSn-l 's correspondingto the f points. This principle of duality can be set up in severalways and is very useful in devising algorithms employing trans-formation of the image space.

III. DESIGN CRITERIAGiven a hypothesis on the image points we consider the

several possible approaches to detect flats in the space. First,we confine our discussions to line detection in two dimensions;however, these apply with slhght modifications for m-flat de-tection (1 < m < n).Although geometrically a line implies both contiguity and

collinearity of points, in several image processing situationsit is necessary and desirable to exploit the collinearity ofpoints without regard to contiguity. In typical scene analysis,O'Gorman and Clowes [3] remark that the evidence for a linemay be meager at certain spots, although somewhere along thelength of the scene the evidence might be stronger. Thus, inthese situations there is a strong likelihood of failure of anyprocedure that emphasizes contiguity (and hence is contextsensitive) and ignores global collinearity. This implies thatthe line finder of Shirai [4] is weak. We discuss two simplemethods that will find both lines and line segments.Assume that the image space is noise free. Let a1,- - -, ap de-

note the feature points. We may assume that we have a "data-base" of Cartesian coordinates. The simplest strategy to adoptis an exhaustive search of possible solutions. To find all linesexisting in the database, note that the cardinality of the solu-tion space is q = p(p - 1)/2; but only those lines each of whichhas at least k points are of interest. The algorithm that searchesthis largest solution space is given below.

Algorithm E (Exhaustive Search)Let Lij, p >j > i > 1, be the equation of the line joining

ai and a1. Each line has two parameters, say p, 0, where p isthe normal distance to the line and 0 is the angle made by thisnormal with the X-axis. For each of the possible q lines formthe record (p, 0, ai, a1). Sort these records, say first on 0 andthen on p. The points clustered within each p-0 group arecollinear points and any group consisting of k or more pointsis of interest.This algorithm is simple in concept, exact in performance

in the noise-free case, but expensive since the sort time is0(q log2 q) = O(p2 log2 p). Dudani and Luk [5] have givenresults on a similar approach used to detect lines in typicaloutdoor scenes.One possible variation of this approach which still retains

the spirit of exhaustive searching is backtracking. In thisapproach we cut down the storage and computing time tosome extent by systematic deletion of points from successivesolution spaces. We will make a few basic assumptions whichare, however, inherent in the way a digitizer would work.The normal scanning process will be orderly, such as from leftto right in rows across the image and from top to bottom. Theparticular ordering is irrelevant, but a certain order would bepresent which we can effectively use. Let Ci represent the setof points in the ith row from the top of the image. The pointswithin each Ci are ordered, say in increasing x-coordinates.

246

ALAGAR AND THIEL: DETECTING M-DIMENSIONAL OBJECTS

We will distinguish two kinds of lines in the image, i.e., thosethat are entirely contained in some Ci (parallel to the top) andothers. It is simple to detect lines parallel to the top and assuch we describe the following algorithm to detect other lineswith k or more points.The algorithm inspects all lines determined by a point in

row RI and each point in row R2 >R1. Each such line isintersected successively with rows R3 > R2 to see if a pointin R3 lies on the line.

Algorithm B (Backtracking Method)

1) [Initialize] For i := 1 to M set Ci v { the set of pointsin the ith row}, where there are M rows in the picture. SetR1 <-0.

2) [Terminate] IfR1 >M- k, terminate.3) [Advance R1] R 1-eR +1+.4) [Backtrack R1] If CR1 is empty return to step 2).5) [Advance A1] Choose an element from CR . Call this

A1 and delete it from CR,. SetR2 <-R1.6) [Backtrack R2] If R2 M- k + 1 return to step 4).7) [Advance R2] Set R2 v R2 + 1; forj := l to CR2 l set

countj <- 2. Set R3 vR2. Let Pj be the jth point in CR2.8) [Backtrack R3] If R3 =M go to step 14).9) [Advance R3] R3 +-R3 + 1. Set j <- 1. Delete points

from CR2 on the the right.10) [Form line] Compute x, the x-coordinate of the inter-

section of line A1 Pi with CR.311) [Advance CR3 ] If CR3 is empty, delete points from

CR2 on the left and return to step 8); otherwise, select the nextpoint P of CR 3 and call its x-coordinate xp.12) [Compare with x] If xp <x, return to step 11). If

Xp = x, increment countv by 1.13) [Advance along CR2] j *-j + 1; If j> I CR2 I, return to

step 8); otherwise, compute x, the x-coordinate of the inter-section of line A1 P1 with CR3 and return to step 12).14) [Accept or reject] For j = 1 to CR2 1, if county > k

then accept the line A1 Pi. Return to step 6).This algorithm is rather long, but can be broken into four

simple parts: advance R I, advance R2, advance R3 , and finally,accept or reject. To estimate the computing time of this algo-rithm we shall assume that there areMrows in the retinal image,p is the number of points, F is the average number of pointsper row, and k is the threshold. Steps 2) and 3) are executed(M - k + 1) times and for each execution of these steps, steps4)-14) are executed. Steps 4) and 5) are executed r times andfor each execution of these steps, one has to do steps 6)-14).Steps 6), 7), and 14) are executed (M+ k - 2)/2 times, whichis the approximate average size of the range of R2. Similarly,steps 8) and 9) are executed (M + k - 4)/2 times, which is theapproximate average range ofR3. Assume that steps 11), 12),and 13) are executed c11 , c12, and c13 times. Clearly, c1I < r,c12 <2F, and c13 <F and step 10) is executed just once.Thus, the total computing time is

(MM-k+1)(M+k-2)(M+k-4)F[cll+c12c13].

Since p = Mr the above quantity is bounded by 0(M3r2)=O(Mp2) = O(p2).

Several comments are in order regarding this algorithm. Firstwe observe that if there are p points, then any algorithm whichdetects all exact lines in the image must have at least 0(p2)computing time. This is clear from the fact that there can bea maximum of 0(p2) lines in the picture. Thus, the back-tracking version given here is an optimal algorithm. Next wemake several remarks pertaining to the qualitative nature ofthe algorithm.Since this algorithm will find any line more than once, we

suggest three possible ways to avoid duplicate detection oflines. These are the following.

1) Sort the resulting list of lines and discard all duplicateentries.2) Keep an ordered list of lines, the list being empty initially.

Each line accepted in step 14) is checked against the entries inthe list. If it is already in the list reject it; otherwise, enter it.3) Maintain a list of lines found to date and check each line

generated by A1 and CR2 against the list in step 7). If the lineA1 Pi is in the list, delete Pi from CR2.Method 3) would reduce the cost of the inner loop slightly,

but would require a search for each point in each CR2 whichcould be expensive if a large list of lines is encountered. If,however, all lines found (even if they are rejected because theyhave fewer than k points) are inserted in the list of lines, thenumber of points in CR2 might be significantly reduced. Thelarger size of the list of lines would increase search time somuch that this savings could be overwhelmed, but it mightnot. If the lines can be ordered (say in increasing order ofcoefficient after normalization), then we can use a binarysearch tree which will easily accommodate the insertions anddeletions. Some savings in the cost of searching such a list oflines can be realized by deleting lines that are no longer use-ful. This algorithm may be extended to search for lines withallowed inaccuracies by simply changing the comparison instep 12).When there is a significant amount of noise or competing

structures in the image space, a two-stage approach is moresuitable to detect the lines. During the first stage a transforma-tion similar to the one suggested by Hough [6] and describedby Rosenfeld [7] is applied to the image space. In the trans-formed space clusters that form lines are identified and at thisstage an exact algorithm, say like Algorithm B, can be appliedto each cluster of interest. Below, we shall discuss the firststage in some detail.Both Duda and Hart [8] and Griffith [9] have improved

Hough's transformation, mainly in the parameterization of de-tectable lines. In Duda and Hart's procedure, the normalparameters (p, 0) are used to specify a line. By admitting alevel of tolerance, the p-0 space is quantized into a quadruledgrid, thus obtaining a two-dimensional array of accumulatorsof equal size. If p is quantized to n, levels and 0 is quantizedto n2 levels, the cardinality of the set of detectable lines isnI n2. Once the 0 quantization is decided, the orientation ofall detectable lines are fixed, although the orientations of truelines in the image space might be different. By selecting avalue of 0 (one of the quantized values), say O), 1 j <n2,Pi =xi cos O,+yi sin 0i, 1 .i.nl are computed. Each (pi, O)value identifies a cell and the counter in this cell is incremented

247

IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI-3, NO. 3, MAY 1981

to reflect the fact that (xi,yi) lies on the line (pi, 0j). Whenthis procedure exhausts selecting all quantized 0 values, those(pi, 0j) cells which have a count exceeding k represent thedesired clusters and each cluster is a possible line in the imagespace containing at least k points.The main advantage of this procedure is that it requires

n2 passes over the data and hence, the computing time (com-plexity measure) is n2p. Theoretically, we know all lines inhypothesized directions, but in practice they need to be con-structed. Whether we use the least square method or AlgorithmB, the reconstruction stage requires time I' O(p), where Pi isthe number of points in ith cluster and there are c clusters.I'here are, however, some limitations and inaccuracies in this

procedure. The inaccuracies arise due to the quantizationschemes in the transformed space. A finer quantization of 0will give better resolution, but will increase computing time.A coarse quantization of p is more likely to indicate the pres-ence of a true line with few points, but will also find morefalse lines. It may also result in producing a single clusterwhere there ought to have been two. A finer quantization ofp will find fewer false lines, is very unlikely to find a true linewith few points (a short segment), and is likely to find severallines where only one exists (due to the imbalance between thetrue and quantized orientation). There are some conflicting(anomalous) situations as well. For example, consider the casewhen slope estimates of feature points are known (see [3] and[S] ). Given (x,y, a), where (x,y) are estimates of true coor-dinates and a is the estimated gradient, we can compute p intwo different ways; these are p1 = x cos ct + y sin a and P2 =x cos O0 + y sin Oj, 0h 1 < a < Oj. These values give differentgeometrical views of the same situation and will incrementcounters in different cells. In the following sections we willexplain how these anomalies and inaccuracies can be reduced,if not totally eliminated.

IV. PROBABILISTIC APPROACH ANDTRANSFORMATION METHOD

To remedy the inaccuracies in the Duda and Hart procedure,several researchers, notably Shapiro [10], Sklansky [11] , andCohen and Toussaint [12], have considered statistical, geo-metrical, and probabilistic aspects of the parameters governingthe normal transformation. Shapiro [10] estimates the vari-ances of the unknown parameters p, 0 under the assumptionthat these are radially symmetric (mean zero) and suggests theusefulness of the variances in the quantization of the trans-formed space. Sklansky [111 discusses the geometry of theparameters and observes that a uniform quantization of param-eter space results in nonuniform precision of the computedcurves in the image. Cohen and Toussaint [12] comment thatwhen the image space contains noise that cannot be removedby standard techniques, the Duda-Hart procedure yields un-satisfactory results and they have suggested an equiprobablequantization of the p-axis (which they call a maximum entropyquantization). Our contention is the same as that of Cohenand Toussaint and consistent with the remarks of Sklansky;yet we differ from Cohen and Toussaint in the way the distri-bution of p is to be found, and thus in the quantization schemein order to eliminate the anomalies.

The problem of detecting lines in two dimensions is but aparticular case of detecting all flats, each having k or morepoints in an n-dimensional image space. Recall the definitionsfrom Section II. A hyperplane (flat of dimension n - 1) isdetermined by a set of n independent points. If p is the radialdistance to this hyperplane and 0 = (01, - - , On) gives the anglesbetween the normal and the coordinate axes, the equation ofthe hyperplane is c1 xi + - - - + cnxn = p, where ci = cos (Od,c2 + * + C2 = 1. Thus, there are only n - 1 independent com-ponents of 0. Thus, in (p, 0) space we get a point correspond-ing to the hyperplane determined by n linearly independentpoints. An mr-flat 1 < m < n - 1 is determined by n - m suchlinear equations and the (p, 0) determining this flat correspondsto a point in the (p, 0) space.Assuming that the image space is a hypersphere in n-dimen-

sions containing feature points superimposed with uniformnoise, our task is to detect and output all m-flats in the imagespace, each flat containing at least k (>m + 1) points. The fol-lowing theorem gives the distribution of p, the distance to arandom slice determined by m + 1 independent uniform points.Theorem 1: Let M independent uniform points be chosen

from the unit n-sphere with s points from the surface andM - spoints from the interior of the sphere and 2 <M< n, s <M.Then p2, the square of the distance from the origin to the flatdetermined by the M points has the beta (oa, 1) distributionwith

oe=-(n-M+ 1), =(n +1)(M-1)-s+ 1

and density

rF(a+1) 1gF(a +)FG -a~ (1 -y)p~1, o<y<l1-

See [13] for a proof of this result. For our purpose s = 0.For the case n = 2, M = 2 (straight lines in two dimensions),the distribution of p2 has the density function

8 1/2 (1 _ y)3/2, 0<y<1

37T<< (1)

and hence, the density of p is

16 (1 _ y2)3/2,37r

-1 y l< 1. (2)

This result is in agreement with the results reported by Gar-wood and Holroyd in [14] and is different from the one givenin [12]. This difference is due to the different concepts ofrandomness which we shall explain now.We agree with Sklansky's remark that there must be uniform

precision of detected lines in the image space. This is possibleonly when anomalies (that arise due to the 0 quantization andthe computation of p) are eliminated and the inaccuracies arereduced (in the p -quantization). For simplistic discussion weconsider n = 2. In order to obtain uniform precision of lines inthe image space, any transform approach must impose a suit-able measure on the set of random lines formed by the noisepoints of the image space. Assuming a circular retina, we seethat every line within the retina is a segment of a chord of thecircumscribing circle. Now line detection is the task ofisolating

248

ALAGAR AND THIEL: DETECTING M-DIMENSIONAL OBJECTS

random segments from true segments. Thus, the question boilsdown to defining a random chord of a circle.Kendall and Moran [15] discuss the problem of defining

random chords and Alagar [16] shows how different distribu-tions of their lengths result due to different probabilisticassumptions. In order to obtain a uniform precision of lines inthe image space, they must be given a measure that is invariantwith respect to the group of rotations and translations. If(p, 0) are normal coordinates of a line, then the measuredpd0 satisfies this property and thus is independent of thequantizations. These remarks apply to random m-flats in n-dimensions and thus the probability measure given by Theorem1 is applicable independent of 0. We shall refer to this measureas an invariant measure.We remark that the probability measure of p given by Cohen

and Toussaint [12] represents only the conditional distributionof p. This is evident from their discussion in [12,p. 96]. Thus,probabilistically this measure is not an invariant measure, andgeometrically speaking this measure is applicable to the setof chords having the same (predetermined) orientation. Weshall refer to this measure as the conditional measure. Next,we shall place each measure within proper contexts and bringout their relative advantages and limitations.The procedure due to Duda and Hart, strictly speaking, maps

a triple (x,y, Oj) onto (p, Oj). Hence, given that 0 is to bequantized, if the Duda-Hart procedure is to be used then thequantization of p according to the conditional measure willremedy the inaccuracies inherent in the p-quantization. Butthe anomalies existing in the 0 quantization and the computa-tion of p when slope estimates are known will still persist.Since the computation of p based on a quantized value usesonly an approximate hypothesis on the location of lines, in theabsence of a priori knowledge of possible true orientations oflines, the conditional measure used to quantize p cannot forceoptimality, i.e., cannot be a maximum entropy quantization.We feel that a maximum entropy quantization should eliminateinaccuracies as well as anomalies. However, the introductionof conditional measure will give a much more uniform precisionof computed lines in a specific orientation than uniformquantization, while retaining the linear computing time in thepresence of noise.While the conditional measure is applicable only to chords

parallel to a given direction, the invariant measure applies tothe set of all chords. The values p and 0 must be computedfrom independent sets of points that determine a line (or aflat in higher dimensions). For example, to determine hyper-planes in n-space containing p points, one must obtain q =(p/n) different sets of (p, 0) values. The p-axis must be quan-tized according to the invariant measure of Theorem 1 andthe 0 space should be quantized uniformly. We remark thatthe radial distance to an m-flat formed by points a1, ,am + , is given by

IAA'I (3)I BB

where A is the matrix with rows (oi am +~) B is thematrix with rows (aX2 - ai1, ai3 - aX1, asm + 1 -c1 ), and A' is thetranspose of A. Thus, each hyperplane is associated with one

cell in the transformed space. If hyperplanes containing atleast k points are required then each cell with count at least(k/n) is of interest. Note that the quantized values are notused to compute p. This procedure is similar to Algorithm E,except that only approximate p-0 groupings are attempted,Thus, for the first stage of forming clusters of points, witheach cluster representing a line in 2-space, the cost is O(p2).For n-dimensions and m-flats this cost is O(pm"+). Whenthe image space has a pencil (or bundle) of flats, points in theimmediate vicinity of the pencil (or bundle) constitute noiseto some flats (in addition to white noise). In such situationsa procedure that does exhaustive search and uses an invariantmeasure to form approximate groupings seems more suitablethan using the conditional measure. But the complexity ofthe procedure increases as m increases. In practice, if there arefewer flats of higher dimensionality in the image space, thecomplexity of the procedure increases while the number ofdetectable flats decreases. Here arises the question of trade-off between time and robustness of a procedure. We need aprocedure whose time complexity can be made to depend onthe accuracy desired by the user. Toward this we first extendthe concept of conditional measure to n dimensions.Theorem 2: Let t =(xl, , x) be a point uniformly

distributed within the hypersphere center origin and radius 1.If p denotes the radial distance to the hyperplane having apredetermined normal and passing through t, then p2 has thebeta (1/2, (n + 1)/2) distribution.We omit the proof and for n = 2, Theorem 2 gives the re-

sult in [12]. The conditional measure of Theorem 2 is appli-cable to only hyperplanes and not for any m flat, m < n - 1.Thus, one can use Theorem 2 to quantize the p axis to detectclusters of points in 3-space when planes are desired, but notfor lines. In view of this, we remark that mixed quantizationschemes are necessary to detect m-flats in n-dimensions. First,we consider the detection of hyperplanes, next the detectionof m-flats 1 <m < n - 1, and finally give a binary refinementprocedure that reconstructs the flats in the transformed space.

If the complexity of 0(p') is tolerated and good clusters ofpoints that form a hyperplane are required, the computationof p and 0 directly from subsets of points and the quantiza-tion of the p-axis according to the invariant measure are rec-ommended. Either a least square fit or the binary refinementscheme can then be used on each cluster for complete recon-struction of desired planes. However, if approximate orienta-tions of desired hyperplanes are known or if the complexityof O(p) is necessary, a straight generalization of the Duda-Hart procedure combined with the p -quantization accordingto the measure in Theorem 2 is recommended. For eachcluster the binary refinement procedure described later in thesection can be used to reconstruct the hyperplanes.For detecting m-flats 1 .< m < n - 1, the hyperplanes must

be found first. We shall assume that an O(p) algorithm isused to form the clusters, each representing a hyperplane.For the present it is sufficient to assume that hyperplaneshave been approximately located. Since each m-flat is theintersection of n - m hyperplanes, the system of hyperplanesmust be chosen systematically so that all possible m-flats canbe located exactly once.

249

IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI-3, NO. 3, MAY 1981

We first select n - m axes in n-space and call them "baseaxes." The remaining m axes will be called "vacant axes."Each base axis determines a family of hyperplanes normal to it.For the case m < n - 1, we have to find one or more hyper-planes to intersect with the family of flats we have found sofar. Thus4 for each hyperplane containing more than k points,we select another base axis and for each point in the cell inquestion, find the distance of the new hyperplane from theorigin and insert each point in a cell. However, we remark thatthe second (and the successive) time we will have to quantizethe p-axis differently, i.e., according to the distribution ofthe distance to a flat of lower dimensionality.This leads to the problem of determining the distance from

the origin to the new flat, which is the intersection of thealready formed flat and the newly generated hyperplane. Wenote that normals from the origin to the already determinedflat, the newly generated hyperplane, and their intersection(new flat) all lie in the same plane. If P1 is the distance to theoriginal flat, P2 is the distance to the newly generated hyper-plane, and 1 is the angle between them, then the distance p3to the new flat is given by

p3 sin q =(p2 - 2p1 P2 COSk+p2)1.

Thus, p3 can be computed with the knowledge of Pi (knownfrom the previous quantization), P2 (computed as and whenthe hyperplane is determined), and k. We compute cos q fromthe direction cosines of the normal to the original flat and thenewly generated hyperplane.The procedure outlined above will find all m-flats of interest

which are parallel to any one of the vacant axes. To findother m-flats, we will have to choose hyperplanes with otherorientations. More specifically, all n - m hyperplanes (onehyperplane normal to each base axis) must be independentlyrotated toward all vacant axes and the complete analysis donefor all combinations of rotations to find m-flats with differentorientations. We caution here that when several hyperplanesare rotated toward the same vacant axis, they may coincidewhen they reach it. This should not be allowed to happen, forthen we would be finding an (m + 1)-flat instead of an m-flat.The possible rotations are built into the algorithm. See Sec-tion V for details.

Cost AnalysisIt is clear that for m = n - 1 each point in the image space

is processed just once for each orientation. To find m flats,m<n - 1, we need to process points in those cells whichcontain at least k points. If C1, C2, , C, are these cells, then

j k < IC, I + - + iCjl A, p

where Ci is the number of points in the ith cell. In general,with each new flat found the number of cells to be processedin the next level decreases, and accordingly the number ofpoints to be processed also decreases. There are n - m hyper-planes (one normal to each base axis) and each hyperplane isrotated toward m vacant axes independently. If dO is theangle through which a hyperplane is rotated at each iteration,then t = r/dO is the number of rotations made per one hyper-plane towards one vacant axis. This means that the number

of rotations per level is T= tm("-m). If n > r > m + 1, NCrdenotes the number of cells to be analyzed in this level, NPr de-notes the number of points per cell, then the cost in the pro-cessing of level r and setting up information for level r - 1 is

T - NCrNPr + NCr- NPr-lThus, the total cost for an m-flat detection is

ET-NCrNPr+NCr-iNPrIrm+ 1 r.n. (4)

An exact analysis of the flats program is difficult to perform.If the average value of NCr can be computed, then (4) for thisvalue of NCr would give the average cost. This is very difficultto obtain. We shall therefore give the worst case analysis.

Worst Case Analysis

Assume that the image is a uniform gray with a density ofpoints great enough that any m-flat in the picture contains >kpoints for the quantization size (number of cells) QSmn+ l*Then any f-flat, f > m also contains >k points. This is cer-tainly the worst case.At level n we have T orientations of families of planes, each

rotation generating QSn cells. Thus, NCn = T- QSn andeach of these NCn - cells contains >k points and must befurther analyzed if m < n - 1. Each cell is divided into QSn 1cells for each of T orientations yielding T* QSn 1 cells at leveln - 2. Thus, NC.-2 =(T* QS.)(T. QS 1). In general, wehave

NCr = T(n-r) n QSii=r+l

Let us further assume QSi QS, m + 1 < i S n. So NCr(T. QS)(n-r). Moreover, we also have NPr-l = NPrIQS, sinceeach cell at level r is divided up into QS cells at level r - 1.Since NPn = p (the given number of points), we have NPr =p/(QS)(n- r)We substitute for NPr and NCr in (4), rearrange the terms,

and simplify to get

time = O(p * T(n-m)) = o(p . tm(nm)2). (5)

This implies that it is relatively expensive to get moderatelyprecise orientations if the dimensionality of the space is verylarge. We must also bear in mind that this is only the worstcase and in practice we expect much more regularity in theimage space.

Binary RefinementFor n > 3 we can start with a coarse quantization of 0.

Each cell which is found to be of interest can be refined. It isexpected that only a small percentage of cells will need to berefined, especially as the analysis works down the levels andthe average cell size shrinks with each level. We describe abinary refinement search procedure below.Given a cell containing k or more points, which is the inter-

section of m hyperplanes (ki ± '5fi/2, pi ± 6pi/2), i = 1, - - *, m,we want to find more precisely all sets of hyperplanes whoseorientations are close to the given set of hyperplanes (within

250

ALAGAR AND THIEL: DETECTING M-DIMENSIONAL OBJECTS

± 86;/2, = 1,* , in), whose thickness 8p' <6p andwhich contains >k points. The algorithm is a simultaneousbinary search in m dimensions where m is the number of va-cant axes.

1) Let P = {set of points in the cell defined by

oi ± 50ji/2,i= 1, * m;p + p/2}.Let PUSED be empty.2) SetMAXC=O0; =4i,i= l , ,m;

set50j=50j,i=I r,n,m;set flag: first pass.3) Set 80i = 50J/2, i = 1, *- , m. If O0i < "precision" go to

step 9).4) Define 2m sets of hyperplane orientations corresponding

to oj + 0i,i= 1, ,m.5) If this is not the first pass go to step 6). Turn off the

first pass flag; add an additional orientation correspondingto Oi, i = 1 , * * * , m.6) Process all points in P, putting each point in a cell de-

pending on p for each orientation defined in steps 4) and 5).7) For each set of orientations i, find NP1 = the maximum

number of points in any cell. Find max {NP1}. If max {NP1} SMAXC, return to step 3).

8) Set MAXC=max {NPi}. Set Oi, i = 1,**, m to theorientation of the hyperplane corresponding to NP1. Returnto step 3).9) Process the points in PUSED, putting each point in a

cell depending on p for the orientation corresponding to Oi, i =1,* ,m.10) Record the description of all cells with >k points. For

each cell recorded, remove from P those points which fall in itand move them to PUSED.

11) If no hyperplane contains >k points, stop; otherwise,return to step 2).The above algorithm has not been implemented, but we feel

that it may be an important key to resolving the conflict be-tween the need for precise orientations and the problems ofcost and fragmentation associated with such precision.

V. IMPLEMENTATION AND PROGRAM DESCRIPTION

Initially the entire space is treated as an n-flat. By "level" ofa flat we mean its dimensionality. At any time let F be thelevel of a flat. Starting with an F-flat we intersect a series ofparallel hyperplanes with the F-flat to form a series of parallelF - 1 flats. The treatment is entirely analogous as we progress,except that the mapping of the p2 for the created flat wouldbe different.The different levels are manipulated as a stack in file STATUS.

The collection of points associated with each flat at each levelis stored in file POINTS. Only those points associated withcells which may contain flats of interest are stored in POINTS.The file POINTS is manipulated as a stack with pointers in fileSTATUS.The progression up and down the levels is described here.

Each F-flat is divided into a series of (F- 1)-flats by intersect-ing it with a series of parallel hyperplanes of finite thicknesswhich between them cover the entire flat. The number of

points in each (F - 1)-flat is inspected and if it is not enough(<k), the flat and the associated points are discarded at thislevel. If F - 1 = m (where m is the dimensionality of the flatwe are seeking), then the remaining (F - 1)-flats are the desiredresults. If F - 1 > mr, the points of the remaining flats, if any,are recorded in file POINTS, the STATUS file is updated toreflect these flats, and processing is continued by selecting an(F - 1) flat to be subdivided further. The stack is pushed, the(F - 1) flats become the new F-flats, and the process is re-peated until F- 1 = m.During the initial descent from n to m, the intersecting

hyperplanes have their initial orientation as specified by theuser, i.e., the user may guide by specifying the initial direc-tions. When a series of m-flats are determined (or when all(F - 1)-flats at any particular level are discarded because theycontain too few points), it is necessary to perform a rotation.The STATUS stack is popped one level and the series of hyper-planes which were intersected with the F-flat (now a sourceflat again) is rotated by a user specified increment. If the rota-tion has been completed, then the F-flat has been completelyanalyzed and is discarded. The program searches for the nextF-flat. If one is found, the rotation is reinitialized, the stackis pushed and the F-flat is subdivided into (F - 1)-flats asbefore. If no further F-flat is found, we have exhausted thislevel. The stack is popped, level F + 1 becomes the new levelF, and the series of hyperplanes at this level is rotated. Thisprocess continues until the series of hyperplanes at level n hasbeen rotated to the limit. Since there is only one flat at leveln (the n-space) this concludes the search.

Finally, we comment on the rotation mechanism in theimplementation. Any m-flat is clearly the intersection ofn - m hyperplanes. All flats in the program are created thisway. We already remarked that the axes of the n-space aredivided into m VACANT axes and n - m BASE axes. Eachhyperplane used to construct an m-flat is associated with aparticular base axis. For example, in 2-space consider generat-ing all lines. Here m = 1 and n = 2. There is one vacant axis(say the x-axis) and one base axis (say the y-axis). To generateall lines, start with a series of lines perpendicular to the y axisand rotate their normal toward the x-axis. It must be rotatedthrough 180 - dO to generate all orientations. Similarly, con-sider the generation of planes in 3-space. Here, m = 2 andn = 3. Let x and y be the vacant axes and z be the base axis.Start with a plane perpendicular to the z-axis and rotate it inturn toward each of the vacant axes (x and y), such that foreach orientation with respect to the x-axis it is rotated in allpossible directions with respect to the y-axis. This is general-ized to n dimensions. After each rotation the direction cosinesof the rotated normal and the distance to the flat are foundas explained earlier.There are many other features in the program such as pre-

processing the data, interface with the user, and options on theformat of the result. However, we wish to elaborate on thedifferent quantization schemes because we feel that this is themost important part of the whole flat detection mechanism.We have found that the quantization must be varied in anextremely complex manner if we are to avoid the various dis-tortions and spurious flats and have an equal chance of finding

251

IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI-3, NO. 3, MAY 1981

flats which appear anywhere in the picture. Most important ofall, the user can guide this phase if he has any a priori knowl-edge of the image space.

VI. QUANTIZATION SCHEMES-A COMPARATIVE STUDYProbabilistically, the uniform quantization of the p-axis im-

plies the assumption that flats are equispaced. Geometrically,in the uniform quantization the volume included within a sin-gle cell is greater near the center of the sphere than near theboundaries. Thus, the uniform quantization is biased towardsfinding flats near the center of the field and it tends to ignoreflats near the boundaries. However, the beta distribution ofp2 to m-flats, as given by Theorem 1, takes into account allpossible combinations of m + 1 linearly independent points inthe hypersphere. Thus, even flats which contain only pointsnear the boundaries may pass close to the origin, if the pointsare not close to each other or are oriented properly. So thedistance p for these flats tends to be very small compared tothe average distance to the points defining the flats. Due tothis tendency, the cells generated according to the invariantmeasure (call this BQ1 quantization) are thin near (but notat) the origin, and the outermost cell is very thick. Thus,flats situated closer to the origin stand the chance of gettingfragmented, whereas flats near the boundary will always bedetected.Geometrically, however, one may not be interested in all

possible hyperplanes, but only those in specific orientations.The beta distribution in Theorem 2 is applicable only forhyperplanes. The cells generated according to this conditionalmeasure (call this BQ2 quantization) will be such that if thereis a hyperplane whose spread is totally within a conical regiondetermined by two successive quantized direction vectors,there is a great likelihood of missing this hyperplane or frag-menting it into two adjacent cells, no matter where the planeis located in the image space.There is another practical difficulty with beta quantizations.

The distribution functions given in the two theorems are forp2 and not for p, i.e., p has a root-beta distribution. To im-plement a beta quantization, we first need to subdivide theinterval (-1, l)into r subintervals -1 = xo <xi<... < Xr-1 <Xr = 1, such that the probability P(xi-l < p < xi) = Ilr orequivalently we need F(xi) = i/r, 0 < i < r, where F(x) is thedistribution of p2. This means that we need the inverse ofF, i.e., xi = F-1(i/r), 0 S i < r. For definiteness let F denotethe distribution function given in Theorem 2. For the casen = 2, the inversion process demands solving a complicatedequation, for n = 3 it calls for solving a cubic equation, and forn > 3, the exact solution is difficult to obtain. If we deal withp2 instead of p, we can make use of standard statistical sub-routines to obtain inverse beta values. This way we indirectlyreduce the complexity, yet it persists and the results are onlyapproximate. Moreover, if we obtain inverse beta, we obtainthe subintervals in (0, 1) and by symmetry we can extend thisto (-1, 0). To determine the subinterval in which a particularPj occurs, we can compute rF(x), x = pj. This way we avoidsearching through a list, yet we remark that the amount of

uniform quantization. Moreover, the endpoints of the sub-intervals in any beta quantization can only be approximate.These considerations have led us to investigate mixed quanti-

zations, which combine the best and avoid the worst featuresof the uniform and the two beta quantizations. We have foundthat such a quantization performs well for several values ofm and n.

One mixed quantization (call this MQ1) is simply the com-

bination of uniform quantization of p in the range (0, Pc) andBQ1 quantization of p in the range (P, 1), where Pc is thecrossover point. We have tested several data and found thatPc = (a + 1 )/(a + p + 1) is an excellent choice of crossoverpoint. One pleasant feature of Pc is that it is the mean of thebeta distribution. This choice of p, in mixed quantizationenables the detection of all true m-flats and minimizes thenumber of spurious flats in a given orientation for our testcases.

This quantization has two important effects. First, it in-creases the cell size near the boundary over what uniformquantization would give, but the cell size remains smaller thanwhat beta quantization would give; this enables accurate de-tection of flats near the boundary without too many of thesegetting coalesced. Next, the cell sizes near the center, whichwould tend to be small with the beta quantization, are largernow; this means that flats near the center do not get fragmented.The other mixed quantization (call this MQ2) is to apply

BQ2 quantization to detect hyperplanes and BQI quantizationto other levels. The effect here is to gather existing families ofhyperplanes in a specific orientation and determine flats con-

tained in each of these by successively intersecting them withother chosen hyperplanes. Since the quantization phase isthe most vital to this problem, we explain now the differentquantizations which are best suited in different levels of theflat detection mechanism.For finding (n - 1)-flats in n-space we have found that the

BQ2 quantization as well as MQI quantization perform well.To find m-flats 1 < m < n - 1 in n-space, we recommendeither: 1) MQI quantization for the innermost level and uni-form quantization (UQ) for all the outer sets n, * * *, (m + 2)of intersecting hyperplanes, or 2) MQ2 quantization with BQ2applied to the outermost level and BQI applied to each innerlevel. Since the conditional measure of p for any m, 1 < m <n - 1 is not unique, there is no measure similar to BQI that isuniformly applicable to all levels of quantizations.

Finally, we comment on the problem of migration of hyper-planes towards the center of the retina. This is an interestingside issue and an increasingly important one as the differencein dimensionality between the flats of interest and the space

containing them increases. As the number of intersectinghyperplanes required to define a flat of interest increases, so

does the probability that at least one of these hyperplanes"compresses" the quantization.Consider Fig. 1, which contains the projection of a plane

P1 which has been found to contain more than k points. Thisplane is close to the boundary and is quite thick to allowshorter planes to be more easily found. The other lines across

computation is much more in any beta quantization than in a

252

the page represent a set of planes P2, to be intersected with

ALAGAR AND THIEL: DETECTING M-DIMENSIONAL OBJECTS

Fig. 1.

PI in the hope of findings lines. Note that although we hopeto find a shorter line far from the origin, the quantization ofthe intersecting hyperplanes does not reflect this. Cells shouldbe thick and approximately uniform because the target linesare all about the same distance from the origin, but vary froma thin cell at P21 to a thick one near the boundary. If the linehappens to fall in P2 , it will probably be missed. If it falls inthe thick cell, it will more probably be found.A second, related kind of "compression" of the quantization

space is also illustrated in Fig. 1. Note that as we have drawnthe figure, all points in the subspace being tested fall in onlyhalf of the defined cells, while the other half (not shown, butcovering the clear half of the sphere) will never be used. It iseasy to change the angles involved so that only two or three ofthe planes P21 cover all of PI. This situation provides us withvery little refinement, resulting in very coarse locations for theintersections.Thus, we see that the quantization must be varied in an ex-

tremely complex manner if we are to avoid the various distor-tions and have an equal chance of finding all flats of interest inthe image space.

VII. TEST RESULTSWe have tested our flat detection procedure on both random

and nonrandom data. Given that points are uniformly dis-tributed in a hypersphere, our procedure is expected to pro-duce a flat histogram; conversely, if the result is a flat histo-gram, the input data must have a uniform distribution. Thus,our procedure can be used to test uniformity of points in abounded n-dimensional space.

It is known [17] that points produced by any linear congru-ential random number generator show high regularities and inparticular all these points are contained in a small number ofparallel hyperplanes. Random numbers were generated usinga congruential generator-one set within a hypercube and

another set within a hypersphere. For our flat detection wegave the proper orientation and tested uniform, BQl and BQ2quantizations independently. We found that the two betaquantizations found all the hyperplanes containing all therandom points; whereas the uniform quantization found allthe hyperplanes, but accounted for fewer points. Note -thatthe distribution of the distance to a flat formed by a set ofindependent uniform points within a hypercube is not a beta;yet the beta quantizations performed well. When we testedour procedure on the uniform points inside a hypersphere, theuniform quantization found more planes and more lines thanthe beta quantization. The significance of our tests suggestthat our procedure can be used as a test for random numbersgenerated in n-dimensions, and the particular case n = 2 ismentioned in [121.The nonrandom data consisted of flats in predefined direc-

tions superimposed with uniformly distributed noise points.We compare the performance of the various quantizations onthe basis of the ratios P, R, and G. The following notationsare used in the tables:

d:NP:d':NP':T:

UQ:BQI:MQl:MQ*:

actual distance of a flat,number of points generated on a flat,observed distance to a flat,number of points on the observed flat,thickness of an observed flat, = (actual thickness)/(radius),uniform quantization,beta quantization (Theorem 1),mixed quantization for hyperplane detection,mixed quantization for m flats, uniform quantizationforFflats,m < F < n.

Tables I through VI show results for the quantized orienta-tion closest to the true orientation.

253

IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI-3, NO. 3, MAY 1981

TABLE ICOMPARISON OF EXPECTED AND OBSERVED LINES IN THE VARIOUS QUANTIZATIONS

Lines in 2-space

Radius of circle = 64; Number of points = 345; Points were assigned to form nine parallellines, the normal to the line making an angle of 120 degrees with the x-axis.

Expected lines Observed lines

UQ BQ1 MQ1d NP _ -

d' NP' T d' NP' T d' NP' T

-57.6 21 -58.3 18 0.031 -57.1 21 0.204 -58.1 21 0.172-44.8 35 -44.5 35 " -44.6 35 0.051 -45.3 34 0.034

-32.6 32 it -32.8 27 0.029 -32.8 14 0.019-32.0 43 -30.7 11 " -30.9 16 0.027 -31.6 29 0.018-6.40 49 -6.92 42 n -6.44 43 0.019 -6.92 42 0.031

0.583 15 0.0181.28 49 0.989 48 " 1.75 34 0.018 0.989 48 0.0316.40 49 6.92 43 66.44 42 0.019 6.92 43 0.031

30.9 14 0.027 31.6 28 0.01832.0 43 32.6 36 " 32.8 29 0.029 32.8 15 0.01944.8 35 44.5 35 " 44.6 35 0.051 45.3 34 0.03457.6 21 58.3 19 " 57.1 21 0.224 58.1 21 0.172

TABLE IIPRECISION, RECALL, AND MEASURE OF GOODNESS OF THREE

QUANTIZATIONS FOR LINE DETECTION IN 2-SPACE

UQ BQ1 MQ1

P 9/10 9/12 9/11

R 1.0 1.0 1.0

G 8/9 6/9 7/9

TABLE IIICOMPARISON OF EXPECTED AND OBSERVED PLANES IN THE VARIOUS QUANTIZATIONS

Planes in 3-spa__c__

Radius of sphere = 64; Number of points = 2000; Points were assigned to form nine parallelplanes, the normal to the planes making equal angles with the axes of coordinates.

Expected planes

d NP

Observed planes

UQ BQ1

d' NP' T d' NP' T d' NP' T

57.6 65 56.9 63 0.031

44.8 173 45.8 9843.5 75

32.0 255 32.4 254 "t 32.36.4 337 5.58 280 It 6.9

6.01.28 340 1.12 340 " 1.4-6.4 337 -5.58 284 " -6.0

-6. 9-32.0 255 -32.4 255 ' -32.3-44.8 173 -43.5 66 "

-45.8 107 " -58.1-57.6 65 -56.9 64 "

59.4 6558.1 230 0.384

44.9 173

255154183289184153254

255

0.0320.0130.0130.0130.0130.0130.032

0.384

31.75.58

1.12-5.58

-31.7-44.9

-59.4

223280

340284

224173

65

MQ1

0.346

0.060

0. 0 1 00.031

0.0300.031

0.0190.060

0.346

254

ALAGAR AND THIEL: DETECTING M-DIMENSIONAL OBJECTS

TABLE IVPRECISION, RECALL, AND MEASURE OF GOODNESS OF THREE

QUANTIZATIONS FOR PLANE DETECTION IN 3-SPACE

UQ BQ1 MQ1

p 9/11 7/9 1.0

R 1.0 7/9 1.0

G 7/9 5/9 1.0

TABLE VCOMPARISON OF EXPECTED AND OBSERVED LINES IN THE VARIOUS QUANTIZATIONS

Lines in 3-space

Radius = 64; Number of points = 1000; Tested data consisted of nine lines and the number of points oneach line follows uniform distribution in a sphere.

Expected lines Observed lines

UQ BQ1 MQ MQ1d NP

d' NP' T d' NP' T d' NP' T d' NP' T

57.6 62 58.7 61 0.18044.8 102 45.0 101 0.03 44.4 71 0.03 44.3 95 0.02832.0 123 31.0 77 32.0 72 0.02 31.8 95 0.0196.4 142 7.0 136 n 3.28 72 0.10 7.01 136 0.031 6.95 142 0.097

3.29 95 0.101.28 142 1.0 133 1.0 133 0.031 0.04 136 0.094-6.4 142 -7.0 132 -3.29 61 0.10 -7.01 132 0.031 -5.84 142 0.065

-32.0 123 -31.0 79 " -32.0 74 0.02 -31.8 94 0.019 -31.8 82 0.033-44.8 102 45.0 102 -44.4 72 0.03 -44.3 95 0.02857.6 62 -58.7 57 0.180

TABLE VIPRECISION, RECALL, AND MEASURE OF GOODNESS OF THREE

QUANTIZATIONS FOR LINE DETECTION IN 3-SPACE

UQ BQ1 MQ' MQ1

P 1.0 6/7 1.0 1.0

R 7/9 6/9 1.0 4/9

G 7/9 3/9 1.0 4/9

VIII. CONCLUDING REMARKS

We have examined both exact and approximate algorithmsfor detecting lines in a noisy two-dimensional image space.We have generalized the line detection problem to that ofdetecting m-flats in n-space. Our procedures have been ana-

lyzed to determine their complexity and robustness. Theworst case running time of the m-flat detection algorithm hasbeen shown to be O(ptm(n-m)2), where p is the number ofpoints in the image space and t (a user parameter) is the num-ber of rotations required for a desired precision and complete

analysis of the image space. In practice, the algorithm worksthrough much faster.The robustness of a procedure is measured by three quan-

tities called precision, recall, and goodness. These depend onthe quantization schemes; and from our test results we con-clude as follows. For finding hyperplanes in an n-space useMQ1 or BQ2; for finding m-flats, 1 S m < n - 1, use the MQ1quantization for the innermost level and the uniform quantiza-tion for all the outer sets of intersecting hyperplanes or usethe MQ2 quantization. Any such quantization finds all trueflats and minimizes (in our test cases it did not find any in theproper orientation) spurious flats. The binary refinementprocedure can be used in the transform space if more accuracyis desired.

ACKNOWLEDGMENT

The authors would like to thank the referees whose com-ments and suggestions helped to improve the manuscriptconsiderably.

REFERENCES11 D. J. H. Moore and D. J. Parker, "Analysis of global pattern fea-

tures," Pattern Recognition, vol. 6, pp. 149-164, 1974.

255

IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI-3, NO. 3, MAY 1981

[2] A. lannino and S. D. Shapiro, "A survey of the Hough transformand its extension for curve detection," in Proc. IEEE Comput.Soc. Conf: Pattern Recognition Image Processing, Chicago, IL,1978, pp. 32-38.

[3] F. O'Gorman and M. B. Clowes, "Finding picture edges throughcollinearity of feature points," IEEE Trans. Comput., vol. C-25,pp. 449-456, 1976.

[4] Y. Shirai, "A hierarchical program for recognition of polyhedra,"Artificial Intell. Lab., Mass. Inst. Technol., Cambridge, MA,Memo 263, 1972.

[51 S. A. Dudani and A. L. Luk, "Locating straight-line edge segmentson outdoor scenes," Pattern Recognition, vol. 10, pp. 145-157,1978.

[6] P. V. C. Hough, "Method and means for recognizing complexpatterns," U.S. Patent 3 069 654, Dec. 1962.

[71 A. Rosenfeld, Picture Processing by Computer. New York:Academic, 1969.

[8] R. 0. Duda and P. E. Hart, "Use of the Hough transformationto detect lines and curves in pictures," Commun. Ass. Comput.Mach., vol. 15, pp. 11-15, 1972.

[9] A. K. Griffith, "Computer recognition of prismatic solids," Ph.D.dissertation, Mass. Inst. Technol., Cambridge, MA, Project MAC,1970.

[101 S. D. Shapiro, "Transformations for the computer detection ofcurves in noisy pictures," Comput. Graphics Image Processing,vol. 4, pp. 328-338, 1975.

[11] J. Sklansky, "On the Hough technique for curve detection,"IEEE Trans. Comput., vol. C-27, pp. 923-926, Oct. 1978.

[12] M. Cohen and G. T. Toussaint, "On the detection of structures innoisy pictures," Pattern Recognition, vol. 9, pp. 95-98, 1977.

[13] G. Marsaglia and V. S. Alagar, "Random slices of the n-sphere:An extension of Bertrand's paradox," McGill Univ., Montreal,Canada, Res. Rep., 1974, unpublished.

[14] F. Garwood and E. M. Holroyd, "The distance of a random chordof a circle from the center," Math. Gaz., vol. 50, pp. 283-286,1966.

[151 M. G. Kendall and P. A. P. Moran, Geometric Probability, GriffinStatistical Monograph. London: Griffin, 1962.

[16] V. S. Alagar, "The distribution of the distance between randompoints," J. Appl. Prob., vol. 13, pp. 558-566, 1976.

[ 17] G. Marsaglia, "Random numbers mainly fall in the planes," Proc.Nat. Acad. Sci., vol. 61, pp. 25-28, 1968.

Vangalur S. Alagar received the B.A. and M.Sc.degrees in mathematics from Madras University,India, in 1959 and 1961, respectively, the M.A.degree in mathematics from the State Univer-sity of New York, Stony Brook, in 1971, andthe Ph.D. degree in computer science fromMcGill University, Montreal, Canada, in 1975.From 1961 to 1970 he was a Lecturer in

Mathematics at Vivekananda College, Madras$<W W University. In 1975 he joined the Department

of Computer Science, Concordia University,Montreal, Canada, where he is currently an Associate Professor. Hisresearch interests include applied probability, analysis of algorithms,information retrieval, and probabilistic methods in computing.

Dr. Alagar is a member of the Association for Computing Machinery.

Larry H. Thiel received the B.S. degree in math-ematics from Michigan State University, EastLansing, in 1967. He is currently working to-wards an M.S. degree in computer science atConcordia University, Montreal, Canada.Currently, he is a Senior Analyst in the De-

partment of Computer Science at ConcordiaUniversity. His interests include informationretrieval, computer languages, and compilers.

256


Recommended