View angle transformations

View angle transformations

Pattern Recognition Letters 12 (1991) 273-278 North-Holland May 1991 View angle transformations E r w i n R. K o m e n Pattern Recognition Group, Fa...

2MB Sizes 0 Downloads 40 Views

Pattern Recognition Letters 12 (1991) 273-278 North-Holland

May 1991

View angle transformations E r w i n R. K o m e n Pattern Recognition Group, Faculty of Applied Physics, Delft University of Technology, Lorentzweg 1, 2628 CL Delft, Netherlands

Received 19 September 1990

Abstract Komen, E.R., View angle transformations, Pattern Recognition Letters 12 (1991) 273-278. A novel object operation is proposed, where each point in a destination image contains the value of the 'view angle' with which it can see the object in the source image. Thresholding a view angle image at 180" gives the convex hull of the objects in the source image.

Keywords. View angle transformation, image processing algorithms.

1. Introduction

Since the introduction of the distance transform in 1967 by Rosenfeld [10], a large family of related transforms has evolved. One can think of the grey weighted distance transform, which has been proposed by several authors [10,15,12]. On the other hand, the constrained distance transform has been introduced and used among others for robot path planning [3,7]. Distance transformations have initially been calculated approximatively (with respect to Euclidean distance) by using recursive neighbourhood operations [7,10,13]. Another approach has been to use a (possibly signed) vectorised distance transform, with the aim of minimising the error with respect to the Euclidean distance [1,5,6,8,9,14]. Instead of calculating the distance from an object point to the closest background point (or from a background point to the closest object point), we propose to calculate the angle with which a point

in the image 'views' an object. The image containing the view angles from every point is called the view angle transform. The operation to get such an image we call the view angle transformation (VAT). As with the distance transform family, we propose several different VATs, which range from accurate but slow up to fast but approximative. 1.1. Notation The definition of object and recursive neighbourhood operations as introduced in the literature [4] is shown in Table I, together with the definition of other low-level image processing operations. The consistency in definitions is apparent from this table. The symbols used in the operation-definitions are explained with Figure I. A point at position p in an image m a y h a v e a set S of neighbourhood points connected to it. The value of a source image point at position p is denoted Xp. The value of a

0167-8655/91/$03.50 © 1991 - - Elsevier Science Publishers B.V. (North-Holland)

273

Volume 12, Number 5

PATTERN RECOGNITION LETTERS

May 1991

\

....,.p 2",

~/:'

",,.~- q

lm= Whole image

(a)

(b)

hn = Whole image

Figure 1. Use of symbols for the description of low-level image processing operations: (a) object operation and (b) local neighbourhood operations.

point with relative position q towards p is denoted as Xp_q. Neighbourhoods can extend over the set S, to the object Obj until the whole image, denoted as Im.

2. Calculation of the view angle transformations We will now show how the different view angle transformations can be calculated, and what kind of discretisations can be used. We will also show the difference between calculating the VATs as object and as recursive neighbourhood operations. This difference will become even more apparent when considering speed, as done in Section 4.

2.1. The full VAT Ideally every point in the destination image should contain an angle in the interval [0, 360 °] after applying the View Angle T r a n s f o r m (VAT). If an angle is zero, then f r o m that point in the image no object part can be seen at all. Object points, and points completely contained within the object (i.e., in a hole or in a spiral) will have the value of 360 degrees. An example of some situations is drawn in Figure 2.

The formulation and hence the calculation of the full VAT gives some difficulties for angles larger than 180 ° . Angles up to 180 ° can be calculated by taking the inverse cosine of the inner product between the normalized vectors ql, q2 that go from an object point to the point p for which the view angle is being calculated. A full VAT which gives angles from 0 to 360 degrees c a n - - i n principle--be calculated as follows. Construct a vector q3 with an angle that is the bisection of the angle between the pair ql, q2 and check where it goes through the object. If the angle between q3,ql is larger than 90 ° then add 180 ° , else don't. However, if we are just interested in view angles in the interval [0, 180°], then we can simply take the inverse cosine of the inner (i.e., dot) product between ql,q2. Angles larger than 180 ° are then m a p p e d to 180 ° . The object operation which does this job is called the inner product VAT, and can be written as follows:

( V p e l m ) Y~= max cos -1 ql.2EObj

. (1)

\l[qlll [Iq2[I

Instead of calculating the inverse cosine of the inner product to obtain the view angle, one may be satisfied already with the inner product itself (i.e.,

Table 1 Definitions of image processing operations Operation

Short

Definition

Point Local Neighbourhood Object Recursive Neighbourhood

PO LNO OO RNO

(Vp (Vp (Vp (Vp

e Im) e Im) e Im) e Ira)

Yp =f(Xp) Yp = fq ~ s(Xp _ q, q) lip =fq e O b j ( X p - q, q) Yp = fq e s(Yp- q, Xp q,q)

lm = whole image; S = structuring element; Obj = object pixels; X p - source image point; Yp = destination image point. 274

((ql'q2))

Volume 12, Number 5

PATTERN RECOGNITION LETTERS

q2

May 1991

~p

(a)

(b)

(c)

Figure 2. Full View Angle Transform: (a) most background points have an angle of less than 180 °, (b) a background point in a nitch has a view angle of more than 180 °, and (c) points contained in holes have view angle of 360 °.

with the cosine of the view angle). In that case the following object operation can be utilised:

(Vp e Im) Y? = min ql.2EObj

( q l " q2)

Ilqlll" ]lq211

.

(2)

Looking at Figures 2b and 2c one can see that applying the VAT on both points p will result in view angle value of 180 °, although their actual view angle is higher. An example of applying the inner product VAT to a real input image is shown in Figure 3. The VAT images can now be thresholded at any grey value to obtain a binary image with points that are within or outside a certain view angle of the object. Immediate construction of thresholded VATs will be discussed later on in this paper.

2.2. Discrete view angle transform

numbers we can think of several possibilities for discretisation: • the resulting view angle is discretisized to some accuracy (e.g., the view angles are abbreviated to 0, 10, 20, 30, .... 180 degrees); • the angle of the vectors q ~ Obj with which every image point p scans the object is discretisized (e.g., L q ~ {0, 10,20 . . . . . 180°}). Note that discretisation of the second type in effect leads to discretisation of the first type. - For reasons yet to become clear, we define a discrete VAT with a discretisation of the second type as follows:

(Vpelm) Yp= max c o s - l ( ( q l " q 2 ) ) q,.zeObj

I[

(3)

i-[Iq211

with:

{qeObJ l L q ~ A },

and

Lq=atan(qY~.

\qx/ Instead of calculating the view angles as real

(ii

!9!

!!~i:

L ¸¸

The set A from which the angles may be chosen

. . . .

.................

Figure 3. Example of the Inner Product VAT (64,64): (a) binary original, (b) image with cosines of view angles obtained by taking the normalized inner products (black corresponds with - 1 and white with + 1), (c) result of taking the inner product VAT (white is 180 °, and black 0°). 275

Volume 12, Number 5

PATTERN RECOGNITION LETTERS

May 1991

(a)

Figure 4. Example of the discrete VAT: (a) original, (b) result using the 8 directions between 0 and 360 degrees, (c) result using 16 directions, (d) using 28 directions, (e) 180 ° VAT for comparison.

is arbitrarily. An example of some discrete VATs with different point sets A is given in Figure 4.

ing a thresholded version of the discrete VAT called the Smallest Enclosing Regular Polygon (SERP).

3. Faster calculation o f tile V A T or thresholds o f it

3.1. The VAT as recursive neighbourhood operation

As will become clear in Section 4, calculation of the full or discrete VAT is time-consuming. Simplifications have therefore to be sought. Speedup over the full or discrete VAT can be reached in a number of ways, from which we mention the following: • Decrease the number of vectors q~,2 ~ Obj to be considered for the calculation of each result pixel value (see equation (2)). • If possible, calculate the object operation as a recursive neighbourhood operation. • Calculate only a threshold of the (possibly discrete) VAT. We will treat both simplifications by looking into the discrete VAT as an RNO, and by consider-

The nice thing about the discrete VAT is, that it can be rewritten as a recursive neighborhood operation. In Section 4 it will become clear that calculating the discrete VAT as an RNO is faster than calculating it as an object operation. The speed improvement depends on the number of different angles in the set A. If all possible angles in the image are put in the set A, then the discrete VAT RNO is as fast as its object operation counterpart. The trade-off is therefore between speed and accuracy of the VAT. The RNO form of the discrete VAT is as follows:

276

(Vp ~ hn) Zp = U (Zp_g N zq), q~-

( V p e l m ) Yp = ki=l L q i + l - zqi l

(4)

(zq~,a+~N Zp ~ 0){ J

with:

Z(p°)=Xp.lq~esLql, q#s+l = ql,

and also

and

Lqi+l>Lqi.

From the binary source image X the 'directionimage' Z is initialised with the union of all angles available in the neighborhood point set S on the object positions, and with zero elsewhere. The discrete VAT RNO propagates the initial angles in the directions corresponding to those angles. When the propagation is finished, a point operation transforms the directions image Z into the discrete VAT image Y by summing the angles made between the stored directions. A comparison with the trade-off found in distance transformation calculation comes in mind here. The most accurate distance transform (with regard to Euclidean distance measure) is the vector

(a)

May 1991

PATTERN RECOGNITION LETTERS

Volume 12, Number 5

DTF. However, this is also the one which is calculated most slow. Approximations of the Euclidean distance transform can be made by taking only a few basic distances. If the number of basic distances is enlarged, then the speed decreases, but the accuracy increases.

3.2. Smallest enclosing regular polygon If one is only interested in getting an approximation of the convex hull of an object, then the operation which we call the 'Smallest Enclosing Regular Polygon' (SERP) may serve as such. This operation can be described as a threshold of the discrete VAT RNO (see equation (4)) as follows:

CVpe lm) Zp = qUsCZp_qnLq), (Vp ~ Im) Yp = t.i= i z-qi+ 1- Lqi [

(Lqi, i+l nZp*

(b)

)1 >

180°

(c)

.a

al

(d)

(5)

(e)

l .al

Figure 5. Demonstration of the Smallest Enclosing Regular Polygon: (a) original object image, (b) octagon, (e) hexagon, (d) 28-gon, (e) real convex hull (for comparison). 277

Volume 12, Number 5

PATTERN RECOGNITION LETTERS

with:

q # s + t = ql

References

and

/qi+l >/qi.

If the set A is chosen such that the difference between two successive angles in the set is relatively constant, then the determination of the thresholded discretisized view angle can be written much simpler. In that case we can rewrite the SERP as follows:

where the inequality takes the value '1' if true, and '0' otherwise. An example of the SERP as calculated for different angle sets A is shown in Figure 5b-e. The results of calculating the SERP as an RNO as shown in equation (6) are exactly the same as when calculating the SERP as threshold of the discrete VAT.

4. Evaluation We have introduced a family of view angle transformations ranging from accurate and slow for the 180° VAT to fast but approximative for thresholds of the discrete VAT. The different VATs can be used to obtain the convex hull or an approximation of it. On top of that, the VAT of an object can be used to describe other view angles than the 180°. A possible application is the determination of the area where a robot-gripper with a certain view angle may or may not come.

Acknowledgements This work was supported by the Foundation for Computer Science in the Netherlands SION with financial support from the Netherlands organisation for Scientific Research (NWO).

278

May 1991

[1] Danielsson, P.E. (1980). Euclidean distance mapping. Computer Graphics and hnage Processing 14, 227-248. [2] Dekker, S.T., P.P. Jonker and F.C.A. Groen (1987). Distance transform With datafiow techniques. Proc. 6th Aachen Symposium on Signal Theory, 269-272. [3] Dorst, L. and P.W. Verbeek (1986). The constrained distance transformation: a pseudo-Euclidean recursive implementation of the Lee algorithm. In: Young, I.T., J. Biemond, R.P.W. Duin and J.J. Gerbrands, Eds., Signal Processing III: Theoriesand Applications. North-Holland, Amsterdam, 917-920. [4] Komen, E.R. (1990). Low-level image processing architectures: compared for some non-linear recursive neighbourhood operations. Meinema, Delft, Netherlands, Thesis. [5] Montenari, U. (1968). A method for obtaining skeletons using a quasi euclidean distance. J. ACM 15 (4), 600-624. [6] Okabe, N., J.l. Toriwaki and T. Fukumura (1983). Paths and distance functions on three-dimensional digitized pictures. Pattern Recognition Letters 1,205-212. [7] Piper, J. and E. Granum (1987). Computing distance transformations in convex and non-convex domains. Pattern Recognition 20 (6), 599-615. [8] Ragnemalm, I. (1989). The Euclidean distance transform and its implementation on SIMD architectures. Proc. 6th SCIA, 379-384. [9] Ragnemalm, I. (1990). Contour processing distance transforms. In: Cantoni, V., L.P. Cordelia, S. Levialdi and G. Sanniti di Baja, Eds., Progress in Image Analysis and Processing. World Scientific, London, 204-212. [10] Rosenfeld, A. and J.L. Pfalz (1968). Distance functions in digital pictures. Pattern Recognition 1 (1), 33-61. [I1] Shih, F.Y.C. and O.R. Mitchell (1987). Skeletonization and distance transformation by greyscale morphology. [12] Verbeek, P.W. and B.J.H. Verwer (1990). Shading from shape, the eikonal equation solved by grey-weighted distance transform. Pattern Recognition Letters 11, 681-690. [13] Verwer, B.J.H., P.W. Verheek and S.T. Dekker (1989). An efficient uniform cost algorithm applied to distance transforms. IEEE Trans. Pattern Anal. Machine Intell. 11 (4), 425-429. [14] Ye, Q.Z. (1988). The signed euclidean distance transform and its applications. IEEE CSP, 495-499. [15] Yokoi, S., J.l. Toriwaki and T. Fukumura (1981). Theoretical considerations on a family of distance transformations and their applications. In: Onoe, M., K. Preston Jr. and A. Rosenfeld, Eds., Real.Time/Parallel Computers: Image Processing. Plenum Press, New York, 73-94.