Pattern Recognition 41 (2008) 543 – 554 www.elsevier.com/locate/pr An easy measure of compactness for 2D and 3D shapes Ernesto Bribiesca ∗ Departamento de Ciencias de la Computación, Instituto de Investigaciones en Matemáticas Aplicadas y en Sistemas, Universidad Nacional Autónoma de México, Apdo. Postal 20-726, D.F., 01000, México Received 6 July 2005; received in revised form 9 April 2007; accepted 29 June 2007 Abstract An easy measure of compactness for 2D (two dimensional) and 3D (three dimensional) shapes composed of pixels and voxels, respectively, is presented. The work proposed here is based on the two previous works of the measure of discrete compactness [E. Bribiesca, Measuring 2-D shape compactness using the contact perimeter, Comput. Math. Appl. 33 (1997) 1–9; E. Bribiesca, A measure of compactness for 3D shapes, Comput. Math. Appl. 40 (2000) 1275–1284]. The measure of compactness proposed here improves and simplifies the previous measure of discrete compactness. Now, using this proposed measure of compactness, it is possible to compute measures for any kind of object including porous and fragmented objects. Also, the computation of the measures is very simple by means of the use of only one equation. The measure of compactness proposed here depends in large part on the sum of the contact perimeters of the side-connected pixels for 2D shapes or on the sum of the contact surface areas of the face-connected voxels for 3D shapes. Relations between the perimeter and the contact perimeter for 2D shapes and between the area of the surface enclosing the volume and the contact surface area, are presented. The measure presented here of compactness is invariant under translation, rotation, and scaling. In this work, the term of compactness does not refer to point-set topology, but is related to intrinsic properties of objects. Finally, in order to prove our measure of compactness, we calculate the measures of discrete compactness of different objects. Also, we present an important application for brain structures quantification by means of the use of the new proposed measure of discrete compactness. 2007 Pattern Recognition Society. Published by Elsevier Ltd. All rights reserved. Keywords: Measure of compactness; Discrete compactness; Contact perimeter; Contact surface area; Shape analysis; Shape classification; Fragmented objects; Porous objects; Brain images 1. Introduction The compactness C of an object is a beautiful property. The compactness for a 2D shape relates its perimeter with its area and can be measured by the ratio (perimeter 2 )/area, which is dimensionless and minimized by a disk [1]. In 3D domain, the compactness of an object relates the enclosing surface area with the volume and can be defined by the ratio (area 3 )/(volume 2 ), which is dimensionless and minimized by a sphere [1]. The classical measures of compactness described by Duda and Hart [2], Ballard and Brown [1], Youssef [3], Levine [4], González and Wintz [5], and Haralick and Shapiro [6], depend in large part on the perimeter in 2D domain or on ∗ Tel.: +52 555622 3617; fax: +52 555622 3620. E-mail address: ernesto@leibniz.iimas.unam.mx. 0031-3203/$30.00 2007 Pattern Recognition Society. Published by Elsevier Ltd. All rights reserved. doi:10.1016/j.patcog.2007.06.029 the enclosing surface area in 3D, which produces a sensitive measure to noise. In real applications, most objects have noisy perimeters or enclosing-surfaces, which affect their measures of compactness. Other authors have proposed different techniques for mea- suring circularity and compactness of objects: a measure for circularity of digital figures was proposed by Haralick [7]; the compactness of subsets of digital pictures was presented by Sankar and Krishnamurthy [8]; a new distance mapping and its use for shape measurement on binary patterns was devel- oped by Wahl [9]; circularity measures based on mathematical morphology were defined by Ruberto and Dempster [10]. We present here an improvement and simplification on the measure of discrete compactness [11,12] for 2D and 3D shapes composed of pixels and voxels, respectively, which depends in large part on the sum of the contact perimeters of the side- connected pixels for 2D shapes or on the sum of the contact