Practical Applications
6.2 Hot-stage Microscopy Tool
6.2.4 CVP Computation
Let S = {s1, s2, . . . , sn} be the set of n images that depict the evolution over time of the melting in a furnace of a sample. For each image in S, the above described preprocessing is applied to compute all its distinctive data. After that, the set of segmented images is ready to detect the six CVP corresponding to Scholze’s definition.
First and Maximum Shrinkage
First and maximum shrinkage are characterized by the sample’s size starting to decrease and reaching its maximum decrease respectively. In order to detect these CVP, the evolution of the sample’s area along time is plotted with a line chart. The common characteristic in these
kind of charts is that the first shrinkage occurs approximately when the line begins to drop (see Figure 6.3), from here, the sample continues decreasing and when the line is flat again, the maximum shrinkage is reached. At the beginning of the melting process, the sample can inflate briefly, but, according to the experts, it generally occurs before 200◦C. So, the first values of the chart under this temperature are ignored.
Figure 6.3: Graph of the area sample trough time.
To detect this CVP in the chart, the slope angle is computed at every point. When it is large enough, the image si at this point corresponds to the first shrinkage CVP. Then, when the slope angle tends to zero again, the image sj at this point corresponds to the maximum shrinkage CVP. To increase measurement accuracy, the chart points are analyzed in groups of 3. Initially, an angle of 15◦ is considered by default as large enough to detect the curvature.
However, this parameter can be defined by the user.
Softening
The softening point is characterized by the disappearance of sharp parts and the beveling of the corners of the sample (corners and peaks start to soften). Three different alternatives can be applied to obtain this CVP.
1. The first alternative gets the image si having the ratio between si and its AABB areas closest to 1.
si.area
area(AABB(si)) ≈ 1 (6.1)
2. The second alternative gets the image sihaving the ratio between the line segment length from a to d (or from c to b) and the diagonal length of its AABB closest to a given threshold. This threshold is defined by the user and is initially set to 0.95.
length(si.a, si.d)
diagonal(si) ≈ threshold, length(si.c, si.b)
diagonal(si) ≈ threshold (6.2) 3. The third alternative is based on the Freeman chain code[39]. The Freeman code with 8-connected grid (see Figure 6.4) is used to encode in a counter-clockwise sense the 10%
of the top of the image (see Figure 6.5(a)). Since the softening CVP is characterized by corners and peaks starting to disappear, the image with the most flat top is a candidate to represent this point. Therefore, the softening CVP is estimated as that image sihaving a chain code with the maximum ratio between the number of occurrences of 6-direction and the size of the chain. An example is shown in Figure 6.5(b).
max(countCCode6(si)/sizeCCode(si)) (6.3)
3 4 5
2
∗
61 0 7
Figure 6.4: Freeman code scheme with 8 directions.
(a)
(b)
Figure 6.5: Example of Freeman chain code. (a) The top 10% of a sample. (b) Zoom and its chain code: 6766765666666665666. . .
Equations 6.2 and 6.3 were selected in the final application because they give a more accurate result for the softening CVP.
Ball
This point is characterized by the sample’s shape being a ball. When the sample is close to a circular shape, it can be seen as a circle inscribed in a square. However, the sample actually never forms a perfect circle shape but a circular segment (see Figure 6.6(a)), where approximately the 15% of the circle height is lost.
Then, the ratio between the line segment defined by the left-bottom corner of AABB p0
and the point b (or by the right-bottom corner of AABB and a) of length g, and the AABB diagonal of length d, is used to determine the ball CVP (see Figure 6.6(b)).
To determine g, a line-circle intersection is performed. The line-circle intersection equation for a line starting at point p0= (0, 0) is defined as |v|2t2−2(v · o)t+|o|2−r2= 0, where v is the director vector of the line and o the center of the circle with radius r. In this case, v = (2r, 1.7r)
(a) (b)
Figure 6.6: Circular segment. (a) A real sample shape. (a) Geometric representation.
and o = (r, 0.7r). Thus, the quadratic equation is 0.689r2t2− 0.638r2t + 0.049r2= 0. Solving for t, t ≈ 0.81463, b ≈ (1.68292r, 1.43048r), and the desired ratio g/d ≈ 0.84146.
Note that b corresponds to the point detected in the distinctive data. Therefore, the ball CVP is estimated as that image si having the ratio g/d closest to 0.84146.
length g(si)
diagonal(si) ≈ 0.84146 (6.4)
Half Ball
This point is characterized by the sample shape being a semi-circle. As this CVP appears after the ball CVP, it can be detected as the image si having a width twice its height.
si.wmax
si.hmax ≈ 2 (6.5)
Flow
The las CVP is assigned to the image si having the ratio si.hmax/s1.hmaxclosest to a constant k. According to the experts, k is usually fixed between 10 and 16%.
si.hmax
s1.hmax ≈ k (6.6)
6.2.5 Experimental Results
The software has been written in C++ using the GTKMM toolkit as its interface. It has been tested on a PC Intel Core 2 Duo CPU [email protected] with 3.2 GB RAM and runningR
Linux. The software save all processed data for future analysis and allows users to modify some parameters such as the angle for the shrinkage CVP, and the thresholds for the binary filter and the softening and flow CVP points. Figure 6.7 shows screenshots of the developed software Hot-stage Microscopy Tool.
Hot-stage Microscopy Tool has been tested with several real datasets. Here, results for two glass samples obtained from wastewater treatment plants are presented. A dataset contains 369 images and the other one 667 images. Figure 6.8 shows the results, in these cases all of the CVP were detected using the default parameters.
(a)
(b) (c)
Figure 6.7: Screenshots of Hot-stage Microscopy Tool. (a) Main interface. (b) Temperatures window.
(c) Parameters window.
(a)
(b)
Figure 6.8: Results of Hot-stage Microscopy Tool for two glass samples obtained from wastewater treatment plants.