• 沒有找到結果。

Chapter 2 | Apparatus and Instrumentation

2.7 Release Mechanism

2.7.3 Experiment Procedure

Before we describe the procedures for experiment, we need to explain how the impact pendulum was hold in place to be released from the desired angle. To achieve this, a 1:1 model for the entire experiment setup was built in the SolidWorks® (a 3-D graphics software). After the fundamental dimensions (such as the length of the pendulum string, the locations of the blocks carrying the impact and target pendulums, etc.) were determined, we simulated several possible configurations with this model. Assume that we preferred to release the pendulum at the angle o,

we then moved the depositor and the electromagnet in the model to tangentially contact the impact sphere with the desired angle, as shown in Fig. 2.9. Thus, the required lengths of displacement,ΔX

and H1, were easily measured from the 3-D model. When the actual impact sphere was positioned

Below, we give the procedures for setting up each experiment:

1. Shift the depositor to the designated position and pull the impact sphere to lean on it.

2. Shift and have the electromagnet touch the impact sphere within the central area of attraction.

3. Turn on the power supply to the electromagnet.

4. Vertically lower and horizontally retreat the depositor away from the impact sphere.

5. Turn off the power supply to release the impact sphere.

2.8: Illumination

The sight was illuminated from behind the water tank by two 110V 500W halogen lamps (Fig.

2.24). Since light cannot pass through a solid opaque object, a test sphere in sight was in strong contrast with the background.

Fig. 2.24: Halogen lamp.

Note that the light emitted from a halogen tube is extremely harsh and would erode the

area, which makes the background have uneven light intensity. Both of these problems reduced the accuracy in center detection. Therefore, a white translucent corrugated plastic plate was introduced in between the tank and the lamps. The translucency of it softened the light intensity, and the roughness of its surface spread the light more evenly.

2.9: High-Speed Camera

The main high-speed camera is an ATM GmbH Inc. COOKE PCO. 1200S CMOS (Fig. 2.25).

Its lens is a Nikon AF-S 50mm f/1.4. This camera was used to directly record the pendulum motion in front of the tank. The captured digital images were transmitted by an IEEE 1394 fire wire to the computer.

Fig. 2.25: High-speed camera used to directly record the pendulum motion.

The other high-speed camera was used to simultaneously record the bottom view of pendulum motion presented in the 45o reflector. It is an AVT and Prosilica Inc. GigE Vision GE640C CMOS (Fig. 2.26). Its lens is a NAVITAR Inc. Zoom 7000. The captured images were transmitted by a

Fig. 2.26: High-speed camera used to record the bottom view of pendulum motion presented in the 45o reflector.

In order to position the main high-speed camera normal to the front of the tank, the calibrated laser pointer was mounted onto the camera with its mark (introduced in Section 2.7.2) aligned with the centerline of the camera. The camera was mounted on a pan-head that topped a tripod. The pan-head was capable of rotating the camera along the three orthogonal axes of revolution, as illustrated by the numbered circular arcs in Fig 2.27. A plane mirror was attached flat to the front of the tank to reflect the laser beam. We then adjusted the angular positions of the camera along the axes of revolution so that the beam was mirrored back to its source point. Thus, there were no angle of deflection from the normal direction along the z- and y-axes of revolution (corresponding to the arcs No. 1 and 2), but an angle of elevation/depression from the horizontal (corresponding to the arc No. 3) might still be present. To eliminate this inclination, the camera was leveled according to a mounted bubble level. Therefore, we could then confirm that the line of shooting was normal to the front of the tank.

Fig. 2.27: Adjusting the orientation of camera to make the line of shooting normal to the front of the tank.

2.10: Thermometer

A TECPEL electrical thermometer (Fig. 2.28) was employed to measure the fluid temperature.

A thermal couple is affixed to the thermometer. The physical quantity sensed by the thermal couple is converted to voltage signal in the thermometer and displayed as the temperature reading.

In this study, the temperature of the test fluid was measured for each round of experiment.

Thus, a time-averaged temperature was estimated when the entire set of experiments was completed.

It was observed that if the environment was controlled well, the temperature change in a day’s work was quite minor.

Fig. 2.28: Thermometer.

2.11: Hydrometer

The specific gravity of the test fluid was measured by a hydrometer (Fig. 2.29). It is known that the specific gravity of glycerol-water mixture is sluggish to a temperature change, compared with the viscosity. In this study, a measurement of the specific gravity was conducted for each set of experiments.

Fig. 2.29: Hydrometer.

2.12: Viscometer

A Brookfield Inc. LVDV-E viscometer (Fig. 2.30) was employed to measure the viscosity of the test fluid.

Fig. 2.30: Viscometer.

Although the viscosity of glycerol-water mixture is sensitive to temperature change, it was observed that the temperature change in a day’s work was quite minor. Therefore, a set of experiments was usually designed to be finished in a day. Then quantities of fluid at different depths were extracted and mixed in a container. The viscosity of this mixture was measured and taken as the representative viscosity for the test fluid in the tank.

Chapter 3

Image Processing Procedure and Error Analysis

3.1: Circular Hough Transform

3.1.1: Introduction

Hough transform is a feature-detecting technique developed to locate defective features within

a class of shapes characterized by a finite number of shape parameters. For examples, the slope and the intercept are used for a line in a two-dimensional (2D) space, which is the original concept of the very first line detection algorithm developed by Hough (1962). A 2D circle is characterized by its radius and the two coordinates of its center. Following Dudda and Hart (1975), Ballard and Brown (1981), algorithms for a circle, an ellipse, etc. have been developed. Thus, Hough transform may be interpreted as a mapping between the physical and the parameter space, which has been widely employed in image analysis, computer vision, and digital image processing.

How Hough transform is employed to determine a unique combination of shape parameters, hence the object in the physical space, is briefed (Fig. 3.1). Firstly, a set of points is selected in the physical space from an object contour whose shape is desired, and their physical information is mapped onto the parameter space. The possible range of the parameter space is previously specified

by the user, which is further discretized to generate an accumulator space in which a voting procedure is performed on the mapped information. An optimal choice of parameters is found as the

local maxima (LM) from the accumulator space.

Fig. 3.1: Flowchart of the Hough transform procedure.

The current work concerns about the motion of a solid sphere and thus requires circle detection.

When the circle image is in strong contrast with the background, sharp periphery forms, across which the light intensity in the images varies greatly. Conceptually, a peripheral gradient vector of the light intensity falls perpendicularly to the periphery. Thus, all the gradient vectors extended inwards from the image periphery should intersect at the center (Fig. 3.2).

Fig. 3.2: Orthogonality of the peripheral gradient vector to the circumference of the circle image. The circle image, which is white, is in strong contrast with the black background and its center is indicated by the cross.

A transition from the background to the circle image is represented by the gradation of gray scale (or light intensity), which constitutes the so-called “gradient”.

The concept of this geometry property has indeed been employed to achieve Hough transform for

a gradient detector. And a detector in general (and in the current algorithm) only determines where a periphery should be but gives no information about the direction of its curvature, as indicated by the dashed arrow and the short tangent segment in Fig. 3.3. Further, due to digitalization, there always are irregularities on the outline of a circle image that makes the contour deviate from a smooth curve. Therefore, depending on the accuracy of the gradient detector, a gradient vector does not necessarily pass the center when extended inward, as illustrated by Fig. 3.4 [38]. Of these two concerns, the former is easily solved, since all the peripheral gradient vectors extended in the wrong direction will never converge. On the contrary, the latter concern is unsettled, and it is deemed as one of the major contributions to the error in center location.

Fig. 3.3: Uncertainty about which alternative orientation orthogonal to the circumference should point into the circle even though the possible location of circumference and its local tangents have been determined by the gradient detector.

Fig. 3.4: Uncertainty about whether a generated peripheral gradient vector could accurately pass the center, which is owing to the irregularities on the circumference that affect the accuracy of the gradient detector. Reprinted from the Machine Vision and Applications, volume 5, Pär Kierkegaard, “A Method for Detection of Circular Arcs Based on the Hough Transform”, pp. 250, Copyright (1992).

The algorithm employed in the current study is developed on the framework of an open-access MATLAB code CircularHough_Grd released by Tao Peng in 2007. It is a MATLAB function that

performs Hough transform routine with gradients applied to detect the center locations and to estimate the radius.

This function consists of four consecutive stages: defining the arguments involved, constructing the accumulation array, locating the centers, and estimating the radius. A brief introduction of each of these steps is presented next.

3.1.2: Introduction of Arguments

Six input arguments are required in the CircularHough_Grd code. The first two must be specified by the users and thus are briefed below.

The first is the source image. The conventional way to store an image in MATLAB is by a M-by-N matrix with the subscripts, (i , j), indicating the ordinals of the row (top-to-bottom) and the

column (left-to-right), respectively. Before imported into the CircularHough_Grd, an image has to be converted to the gray-scale format and is required to be at least 32-by-32 pixels. Each entry of the gray-scale image matrix falls between 0 and 255 in correlation with the local light intensity. In particular, 0 stands for true black, 255 stands for true white, and those in between represent gradation of light intensity.

The second argument, in the unit of pixel, is a two-entry row vector, (RL , RU), keeping the

picking a probable radius length to be the midpoint of the range, and then setting a possible variation in pixels. For example, if we guess that 70 pixels is the most probable length of the radius, and a deviation of ± 3 pixels is expected, then (RL , RU) = (67 , 73).

The rest input: gradient magnitude threshold, which should always be positive and has a default value of 10; a factor used to form the filter for peak enhancement, which is never less than 3 and has a default value of 8; a ratio contributed to the recognition of concentric circles, whose default value is 0.5; lastly, a default filter that conditions the accumulation matrix.

We have performed sensitivity test to see how these six parameters affect the detection result and it was concluded that the last four parameters were comparably insignificant for our images.

Thus, only the two parameters will be altered in this thesis to achieve better processing results.

As for outputs, there are four arguments generated by the CircularHough_Grd, including the accumulation matrix, the detected centers of the circles in the image, the estimated radii of the corresponding circles, and some debug information.

In particular, the accumulation matrix is of the same size as the source image, with each entry keeping the “relative” probability of each pixel for being the true center location. The second output argument is a N-by-2 matrix stacking the Cartesian coordinates of the detected centers, (xci , yci), with i = 1 ~ N. The third output argument records the corresponding estimated radii and thus is N-by-1. We skip the introduction of the debug information presented in the last argument since we

did not exploit its function in the current analysis.

3.1.3: Construction of Accumulation Matrix

The next goal of the CircularHough_Grd is to build the accumulation matrix. To begin, the local gradient vector of the image is calculated conceptually by

ˆx ˆy

horizontal and vertical directions. It must be recalled that the positive orientation of the y-axis is defined downward in MATLAB image matrices. Specifically, a local gradient vector is the vector pointing in the direction of increasing light intensity at a certain pixel for a 2-D image.

The definition in Eqn. (3.1) is for an infinite continuous field, but an image is discretized in computation and has a confined size. Therefore, an actual B is computed by various algorithm schemes applied at different positions. In the current algorithm, at the position (i , j) of an M-by-N image matrix,

The scheme applied when 1< j <N or 1< i <M is called a central difference, the scheme applied when i or j = 1 is called a forward difference, and the scheme applied when j = N or i = M is called a

Fig. 3.5: Example of the gradient operation with the employed mechanisms displayed.

After the local gradient vectors across the entire image are calculated, a threshold (default = 10) is applied. Only those gradient vectors larger than 10 are kept and their positions saved, which should include those gradient vectors on the circumference of a circle image. Hereinafter, these retained gradient vectors will be called the quasi-peripheral gradient vectors.

If the length of the radius and the direction of curvature are known, we could directly extend a peripheral gradient vector inward to reach the center. But as demonstrated in Fig. 3.3 and 3.4, this is not the case here. Instead, one has to deal with a range of radius length both inwards and outwards from the true circumference. The CircularHough_Grd treats this problem by first discretizing the input vector (RL , RU) by an increment of 1 (Fig. 3.6). This sequence of discrete values is copied and mirrored across 0 (negative-ward), indicating the possibility of the other orientation. Finally, all these positive and negative radius lengths are collected as length factors.

Each of the quasi-peripheral gradient vectors is then normalized to a unit vector, and the serial length factors just created are multiplied one by one to each unit vector. Consequently, multiple

locations of possible centers are attained and saved (Fig. 3.6).

Fig. 3.6: Multiplying the length factors one by one to each normalized peripheral gradient vector to attain multiple locations of possible centers indicated by the numbered scale.

It should be noted that some of these locations are repeated; that is, different quasi-peripheral gradient vectors can result in the same possible center. Aware of this, we can now move to the accumulation process. Simply put, if a possible center is derived from a quasi-peripheral gradient vector, this possible center receives the magnitude of the vector as “votes”; likewise, a second such quasi-peripheral gradient vector will also cast its votes on this possible center. This voting procedure will repeat for all the quasi-peripheral gradient vectors of the like, and the votes accumulate. Following the voting procedure, the accumulation matrix can be constructed. This matrix has the identical size as the source image and each entry position of it corresponds to the pixel position of the image, while the scalar assigned to an entry now indicates the total amount of votes received by this position.

3.1.4: Determination of the Centers

Basically, the local maxima (or the peaks) in the accumulation matrix should locate the actual centers. However, if we take into account the errors caused by digitalization on the circumference, a local maximum might not be as perfect a choice as we expect. Moreover, an element neighboring the local maximum usually has a scalar of comparable level. Hence, a more refined treatment is needed to determine the so-called local maximum.

To make clear the distinction between various “local” regions, the concept of an “area of interest”, abbreviated as AOI, is devised in the CircularHough_Grd. There are two methods by

which the AOI’s are formed.

In the first treatment, a threshold of 20 is first applied to the accumulation matrix, and those elements above this threshold are kept and viewed as “separate groups”; that is, if some of these retained elements are connected to each other either on sides or on corners, they are considered as a group (Fig. 3.7). A rectangular region is then created to enclose each group. The spacing between the top and the bottom borders of the group is taken as the vertical dimension of the rectangle, and the same in the horizontal direction. Each rectangular region is next scrutinized by a threshold:

“A criterion is ‘1/4 of the width of the source image’, and the other is ‘3/2 of RU’. Then either dimension of the rectangle has to be larger than or equal to the smaller one of these criterions,

or otherwise the rectangle would be rejected.”

In the end, those retained rectangular regions represent the so-called “areas of interest”.

Fig. 3.7: Grouping the retained elements (black). The element in the lower right corner of the group 1 is connected to another retained element on its corner, so it is included into the group 1 rather than isolated as a separate group. The rectangular regions bounding the groups are indicated by the dashed lines.

The second treatment takes the entire source image as the “area of interest”, and the criterion stated above is no longer needed.

An AOI is in fact a target area in which one or more local maxima could be found. Before any maximum can be recognized, a peak-enhancing filter is first applied on each AOI, and those elements turned positive in each AOI are kept in separate groups by the same rule stated above.

Later on, group by group, a strict threshold is imposed:

“A criterion is ‘1/5 of the maximum in the accumulation matrix’. In a group, only those elements with a value larger than this criterion are deemed valid. Then, if the number of these valid elements is less than 13, the corresponding group is rejected, and if not, accepted.”

“centroid” of this local area with the mass replaced by the amount of votes, which is equivalent to applying weighting according to the votes. Finally, the location of the computed centroid is taken as the location of the actual center and the third stage of the CircularHough_Grd ends here.

As for the fourth stage, since its information is never used in the current study, we would just skip it for now.

3.1.5: Recommendation for Implementation

In the early stage of the experiments, it was observed that the CircularHough_Grd frequently failed to extract any center in our images. For example, the center of the circle in Fig. 3.3 could not be predicted, though the image resolution was significantly high (the image size was 1000-by-480 in pixel and the circle diameter is 123 pixels). Contrastingly, the center in an image of poorer quality could be detected without difficulty.

In order to explain why the failure occurred, we processed the image in Fig. 3.3 and the result

In order to explain why the failure occurred, we processed the image in Fig. 3.3 and the result