6
Vol.22No.5 JOURNAL OF ELECTRONICS(CHINA) Sept. 2005 IMAGE PROFILE AREA CALCULATION BASED ON CIRCULAR SAMPLE MEASUREMENT CALIBRATION 1 Chen Ken (College of Information Science and Engineering, Ningbo University, Ningbo 315211, China) Larry E. Banta (College of Engineering, West Virginia University, WV 26506-6106, USA) Abstract A practical approach of measurement calibration is presented for obtaining the true area of the photographed objects projected in the 2-D image scene. The calibration is performed using three circular samples with given diameters. The process is first to obtain the ratio mm/pixel in two orthogonal directions, and then use the obtained ratios with the total number of pixels scanned within projected area of the object of interest to compute the desired area. Compared the optically measured areas with their corresponding true areas, the results show that the proposed method is quite encouraging and the relevant application also proves the approach adequately accurate. Key words Calibration; Measurement; Image processing; Area calculation I. Introduction Using the images captured by the video camera to calculate the imaged objects' geo- metric parameters such as perimeter, major and minor axes, area, volume etc. are common tasks in the image analysis and processing applications [1]. One of the fundamental sources for such calculations is based on the size of the basic image structuring element, i.e., pixels. For example, in optical sieving for the aggregates, in order to accurately compute the aspect ratio and area of an individual object in the scene at the predefined camera parameter and distance setting, the size of each pixel must be known before further computation can be taken[2,3]. Pixels are in general not square, so a unit of one pixel represents different length in the horizontal direction and in the vertical direction. For example, a perfect circular-shaped object photographed by a camera with non-square pixels will appear in a chicken-egg-shaped profile in the image. To realistically correlate the profile of the imaged object in the scene to its real contour so that the area will subsequently be calculated based on the profile, it is necessary to translate the pixel measurements into standard dimensions of millimeters. In addition, due to the fact that the object is projected optically onto a Charge Coupled Device (CCD) array, the area of the object's image depends not only on the size of the object but also on its distance from the camera, and on the focal length of the lens used to project 1Manuscript received date: December 2, 2004; revised date: March 2, 2005. Supported by the National Natural Science Foundation of China (No.60472100). Communication author: Chen Ken, born in 1962, male, Ph.D, senior lecturer. The Col- lege of Information Science and Engineering, Ningbo University, Ningbo 315211, China. [email protected]

Image profile area calculation based on circular sample measurement calibration

Embed Size (px)

Citation preview

Page 1: Image profile area calculation based on circular sample measurement calibration

Vol.22No.5 J O U R N A L OF E L E C T R O N I C S ( C H I N A ) Sept. 2005

I M A G E P R O F I L E A R E A C A L C U L A T I O N B A S E D O N C I R C U L A R S A M P L E M E A S U R E M E N T C A L I B R A T I O N 1

Chen Ken

(College of Information Science and Engineering, Ningbo University, Ningbo 315211, China)

Larry E. Ban ta

(College of Engineering, West Virginia University, WV 26506-6106, USA)

Abstract A practical approach of measurement calibration is presented for obtaining the true area of the photographed objects projected in the 2-D image scene. The calibration is performed using three circular samples with given diameters. The process is first to obtain the ratio mm/pixel in two orthogonal directions, and then use the obtained ratios with the total number of pixels scanned within projected area of the object of interest to compute the desired area. Compared the optically measured areas with their corresponding true areas, the results show that the proposed method is quite encouraging and the relevant application also proves the approach adequately accurate.

Key words Calibration; Measurement; Image processing; Area calculation

I. I n t r o d u c t i o n

Using the images captured by the video camera to calculate the imaged objects ' geo- metric parameters such as perimeter , ma jor and minor axes, area, volume etc. are common tasks in the image analysis and processing applications [1]. One of the fundamental sources for such calculations is based on the size of the basic image s t ructur ing element, i.e., pixels. For example, in optical sieving for the aggregates, in order to accurately compute the aspect ratio and area of an individual object in the scene at the predefined camera pa rame te r and distance setting, the size of each pixel must be known before fur ther computa t ion can be taken[2,3].

Pixels are in general not square, so a unit of one pixel represents different length in the horizontal direction and in the vertical direction. For example, a perfect c i rcular-shaped object photographed by a camera with non-square pixels will appea r in a chicken-egg-shaped profile in the image. To realistically correlate the profile of the imaged object in the scene to its real contour so tha t the area will subsequently be calculated based on the profile, it is necessary to t ransla te the pixel measurements into s tandard dimensions of mill imeters. In addition, due to the fact tha t the object is projected optically onto a Charge Coupled Device (CCD) array, the area of the object ' s image depends not only on the size of the object but also on its distance from the camera, and on the focal length of the lens used to pro jec t

1Manuscript received date: December 2, 2004; revised date: March 2, 2005. Supported by the National Natura l Science Foundat ion of China (No.60472100). Communicat ion author: Chen Ken, born in 1962, male, Ph.D, senior lecturer. The Col- lege of Information Science and Engineering, Ningbo University, Ningbo 315211, China. [email protected]

Page 2: Image profile area calculation based on circular sample measurement calibration

No.5 IMAGE PROFILE AREA CALCULATION 529

the image onto the CCD sensor. Therefore, a scale of mm/pixel at the certain setting level needs to be determined before any useful image analysis takes place.

In this letter, a practical method is presented to achieve the goal of calibrating the optical measurement for the non-square pixels in the image. Three circular coins are sampled in the calibration process and an industry video camera is mounted to capture the sampled 2-D images. The images taken are at pre-set camera parameters and imaging distance. The gray-scale images are converted to binary images using back-lighting device, as introduced in Refs.[4,5], and can also be noted in Fig.1 below (the light-colored cubic box under the lamp and camera). Based upon the binary images acquired, the number of pixels for each sample is calculated and through these pixel numbers and known diameters of the samples, the desired ratio mm/pixel for both orthogonal scanning directions is thus obtained. The acquired ratio is subsequently applied for sample area calculation and correction subsequently. The testing results show that the after correction, the errors between optically measured area and actual area are decreased drastically. The accuracy of the proposed method is witnessed by the application in the random-shape-and-size particle volume estimation [4,5] briefly mentioned in the end of this letter.

II. Hardware Set-up and Operating Condition A video camera translates light levels focused on the image plane into electronic signals

which can be transmitted and reproduced on a monitor set. The most common type of video camera uses a CCD chip to translate the light into electrical signals. The CCD chip is actually a grid of tiny individual light measuring devices which break the scene into individual picture elements, or pixels. The camera used for this research breaks each scene into an array of 512 pixels wide and 484 pixels high.

To process these signals using a computer, the light level represented by the video signal must be digitized by translating the signals into a series of numbers that the computer can manipulate. This is implemented by a frame grabber board, which performs very fast analog- to-digital conversion on the electronic signal for the camera. As a result, a grid (matrix) of numbers ranging from 0 to 255, with one number for each pixel, is formed. Low numbers represent dark parts of the image and high numbers represent bright parts of the image.

The laboratory consists of a video camera housed in a curtained enclosure to allow manipulation of the lighting conditions, a computer with a frame grabber card, a box with translucent cover to backlight the aggregates, and miscellaneous equipment for scene il- lumination, positioning the camera, measuring the light level, etc. The photo in Fig.1 demonstrates the actual lay-out of the hardware components. The interior of the wall was painted black to reduce light reflection so as for the better ambient lighting conditioning.

The operating specifications for image capturing in this research using the lighting box are tabulated in Tab.1.

Tab.1 Operat ing condit ion Camera distance Camera Camera shut ter Camera Ambient lighting

from background focus speed aper ture intensity 508 mm 508 mm 1/125 s 6 12 LUX

(20 inch) (20 inch)

III. Image Acquisition In order to describe the shape of the object profile in the scene, tracing object image's

Page 3: Image profile area calculation based on circular sample measurement calibration

530 JOURNAL OF ELECTRONICS(CHINA) Vol.22

edge is necessary. Various edge-detection algorithms and lighting angles were explored to find a method that would reliably detect the boundary of each object. The simplest and most common edge detectors are first-order high-pass filters based on the Sobel operator or variants thereof [e] . These filters are highly sensitive to noise and directional in nature, performing best on edges that are either vertical or horizontal. Sobel filters combined with top lighting are also prone to including unwanted edges, such as those resulting from corners or shadows on the top surface of the particle.

To eliminate possible interior edges in an object, a small light table was thus constructed for backlighting the aggregates. This lighting method produces extremely high contrast images with welt-defined edges. In the phase of obtaining image data, objects are backlit to obtain sharply distinctive edges from black images on a white background, as stated previously. Once the image has been captured under the operating conditions specified in foregoing table, the image is further converted to binary one and stored as a set of x-y

points. Image processing and analysis are performed on these sets.

IV. Image Measurement Calibration

The measuring unit for the image is the number of pixels. For example, the image area for a given particle might be 100 pixels, and the circumference length might be 50 pixels, etc. The actual measuring unit is millimeters, thus a conversion from pixels to millimeters is required. In other words, the scale of mm/pixel needs to be determined.

Three types of sample circles were selected using coin Penny, Nickel, and Quarter for the desired purpose. Their diameters are 19.05mm, 21.12 mm, 24.20 mm, respectively. The corresponding areas are 285.02 mm 2, 350.33 mm 2, and 459.96 mm 2, respectively. The distance between the camera and the imaging background is set to 508 mm (20 inch), which is unchanged for all images. The parameters of the camera such as shutter speed and aperture were unchanged during the imaging process, as tabulated in Tab.1. Fig.2 shows the binary image of the sample Quarter used for calibration, and the image of the rest two samples will appear in the similar fashion. Note that the circle appears in olive shape caused by non-square pixel shape.

• • 0

• • •

• • •

Fig.1 Image capturing set Fig.2 Sample Quarter for calibration

Fig.3 shows the maximum pixel number in x (horizontal) and y (vertical) directions for the diameter of the three sample circles. Note that the horizontal and vertical numbers are

Page 4: Image profile area calculation based on circular sample measurement calibration

No.5 IMAGE PROFILE AREA CALCULATION 531

different, proving that the individual pixel is not square. They are obtained by scanning the image in two orthogonal directions. Note also that although 9 coins are used for each type of circle, the plot shows that some resultant pixel numbers are coincident with or completely overlapping over each other.

Using least square curve fitting technique, both the horizontal and vertical pixel da ta points can be fitted with a straight line, which is forced to go through the origin (0, 0), as briefly described in Eq.(1). Fig.4 illustrates the graphic result.

x

45 40 35 30 25 20 15 10 5

x Max ho;izontai pixel number' o Max vertial pixel number

0

t

45 40

.~ 3s ~ 30 e~

~ 2s "z, 20

Z5 10 5

i i i i i

0 5 10 15 20 25 30 0

Actual diameter (ram)

' - - 6urve-fit for /

horizontal pixel points ~ / " , - - - Curve-fit for 8 / ~

f /

/ j j

, m i m m

5 10 15 20 25 30

Actual diameter (ram)

Fig.3 Maximum pixel number vs. d iameter Fig.4 Data curve fitting

Least square technique used in modeling the maximum pixel number and actual diam- eter can be reviewed as follows,

P = D ~ + ~ (1)

where P is the maximum measured (or scanned) pixel number in x and y direction inside the sample of interest, P = [Pl P2 P3 "'" Pn] T, n=27; D is the actual sample diameter in millimeter (mm), D = [dl d2 d3 . . . dn] T, n=27; f} is the partial regression coefficient; 6 is the random error with zero mean and variance, e = [el e2 es "." en] T, n=27; and "T" denotes matrix transpose.

The reciprocal of the slope of each straight line is taken as the desired scaling factor of mm/pixel. The results are 0.8802 mm/pixel in the horizontal direction, and 0.6551 mm/pixel in the vertical direction.

V. A r e a C a l c u l a t i o n a n d C o r r e c t i o n

Prior to calibration, the object area is measured in number of pixels. Using the scale factors obtained previously, the measured area in terms of square millimeter can be acquired. Fig.5 shows the plot of the findings against the corresponding actual areas, and the measured area data points are curve fitted by a straight line using least square method which is similar to the use formulated in Eq.(1) except that the first-order fitting lines do not pass through the origin. The fitting may demonstrate the discrepancy between the measured areas and their corresponding true areas quantitatively as well as graphically on the whole.

Note that the value on the abscissa is actual area, and this leads to the relation between the actual area and the measured area. This function was found to be

At = (Am + 7.9335) (2) 0.9742

Page 5: Image profile area calculation based on circular sample measurement calibration

532 JOURNAL OF ELECTRONICS(CHINA) Vol.22

where At is the actual area (mm2), Am is the measured area (mm2).

The above transformation is necessary because there are "dead areas" in the image between pixels, so simply multiplying the two scaling factors leads to inadequate results.

As illustrated in Fig.6, the measured areas are much closer or "lifted" to the corre- sponding actual areas after the correction using Eq.(2). As a result, the accuracy of the measured areas is improved accordingly.

550

500 E E 450

400

350

300

250

200

- - Actual area fitting curve

. . . . . .

150 250 350 450 550 Actual area (mm 2)

550

500

450

400

"~ 350

300

250

200

o Actual area + Corrected area

i

i i i I i I

150 250 350 450 550 Actual area (ram 2)

Fig.5 Comparison between the measured area and actual area

Fig.6 Improvement of measured area

V I . T e s t i n g R e s u l t s

The improvement in the measured areas can be demonstrated by observing their error before and after using Eq.(2). The error for the three circle samples are shown in Fig.7. The corresponding data points are tabulated in Tab.2. The full-scale application based on the proposed calibration method in this letter can be referenced in Refs.[3-5]. From these reports it can be noted that, in estimation of the volume of the randomly shaped particles that involves the projected area calculation using the presented calibration, the estimation results are adequately accurate and thus very encouraging in other prospective parameter estimating application.

~ i ~ , 1 0 I . . . . . . . . .

0 2 4 6 8 Cricle number

10 10

(a) Improvement of error for Penny

1 0 . . . . . . . . .

8

4 " • t ~ s S

[dd " ~ ' % e ,s

0 2 4 6 8 10 Cricle number

- - - Uncorrected area percent error Corrected area percent error

(b) Improbement of error for Nickel

| 0 . . . . . . . . .

', ,.'., / ', I \ /

0 2 4 6 8 Cricle number

(c) Improvement of error for Quarter

Fig.7 Error improvement

Page 6: Image profile area calculation based on circular sample measurement calibration

No.5 IMAGE PROFILE AREA CALCULATION 533

Sample number

T a b . 2 M e a s u r e m e n t i m , r o v e m e n t in absolute e r r o r

Penny Before (%) A~er (%)

8.3553 3.0749

4.9161 0.4553

8.3553 3.0749

4.7138 0.6629

3.9046 1.4936

5.7253 0.3753

5.3207 0.0400

6.9392 1.6213

7.9507 2.6596

Nickel

Before (%) A~er (%)

4.8653 0.0252

3.3839 1.4954

3.7131 1.1575

1.7380 3.1848

0.9150 4.0295

5.0299 0.1941

5.5236 0.7009

2.7256 2.1711

5.3590 0.5320

Quarter Before (%) ARer (%)

5.2258 0.9492

5.2258 0.9492

5.2258 0.9492

5.3512 1.0779

2.0917 2.2677

4.3483 0.0485

5.6019 1.3353

2.3425 2.0103

6.2287 1.9787

VII. Conc lus ions

In this letter, a practical calibration method is introduced for obtaining the projected area of the photographed objects through calculating the area in the image. The calibration performance is based on the use of three circular samples with known diameters. The process is first to obtain the ratio mm/pixel in both x and y direction, and then combine them with the total scanned number of pixels inside the contour of the object in question to produce the desired areas. Testings show that the optically measured area can represent coreesponding true area to a satisfying extent, and the application involving the proposed method also appears quite promising and encouraging.

References

[1] N. H. Maerz, Aggregate sizing and shape determination using digital image processing, International

Center for Aggregate Research (ICAR) 6th Annual Symposium Proceedings, St. Louis, Missouri, April

19-20, 1998, 195-203.

[2] Chen Ken, Optical gradation for crushed limestone aggregates, Dissertation, Evansdale Library of The

West Virginia University, USA, 2000.

{3] Chen Ken, Larry E. Banta, Using optic sieving to obtain the gradation curve for particles with random

parameters, Journal of Ningbo University (Sci. ~ Eng. Edition), 17(2004)3, 299-303, (in Chinese).

[4] Larry Banta, Chen Ken, J. Zaniewski, 2-D image-based volumetric modeling for crushed limestone

aggregates, Powder Technology, 132(2003), 184-189.

[5] Larry Banta, Chen Ken, John Zaniewski, Estimating mass of crushed limestone particles from 2-

D images, Proceedings of the SPIE, International Symposium on Intelligent Systems and Advanced

Manufacturing, Boston MA. USA, 28 Oct-2 Nov. 2001, SPIE paper #4567-35.

[6] Rafeal G. Gonzalez, Richard E. Woods, Digital Image Processing, Massachusetts, Addison-Wesley

Publishing, 1992, ch.4.