<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" article-type="research-article">
<front>
<journal-meta>
<journal-id journal-id-type="nlm-ta">Sensors</journal-id>
<journal-title>Sensors</journal-title>
<issn pub-type="epub">1424-8220</issn>
<publisher>
<publisher-name>Molecular Diversity Preservation International (MDPI)</publisher-name></publisher></journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3390/s111009121</article-id>
<article-id pub-id-type="publisher-id">sensors-11-09121</article-id>
<article-categories>
<subj-group>
<subject>Article</subject></subj-group></article-categories>
<title-group>
<article-title>A Novel Approach for Foreign Substances Detection in Injection Using Clustering and Frame Difference</article-title></title-group>
<contrib-group>
<contrib contrib-type="author">
<name><surname>Lu</surname><given-names>Guiliang</given-names></name></contrib>
<contrib contrib-type="author">
<name><surname>Zhou</surname><given-names>Yu</given-names></name><xref ref-type="corresp" rid="c1-sensors-11-09121"><sup>★</sup></xref></contrib>
<contrib contrib-type="author">
<name><surname>Yu</surname><given-names>Yao</given-names></name><xref ref-type="corresp" rid="c1-sensors-11-09121"><sup>★</sup></xref></contrib>
<contrib contrib-type="author">
<name><surname>Du</surname><given-names>Sidan</given-names></name></contrib>
<aff id="af1-sensors-11-09121">School of Electronic Science and Engineering, Nanjing University, Nanjing 210093, Jiangsu, China; E-Mail: <email>luguiliang@gmail.com</email> (G.L.); <email>coff128@nju.edu.cn</email> (S.D.)</aff></contrib-group>
<author-notes>
<corresp id="c1-sensors-11-09121">
<label>★</label> Author to whom correspondence should be addressed; E-Mails: <email>nackzhou@nju.edu.cn</email> (Y.Z.); <email>allanyu@nju.edu.cn</email> (Y.Y.); Tel.: +86-25-8359-7453; Fax: +86-25-8359-7453.</corresp></author-notes>
<pub-date pub-type="collection">
<year>2011</year></pub-date>
<pub-date pub-type="epub">
<day>27</day>
<month>9</month>
<year>2011</year></pub-date>
<volume>11</volume>
<issue>10</issue>
<fpage>9121</fpage>
<lpage>9135</lpage>
<history>
<date date-type="received">
<day>2</day>
<month>8</month>
<year>2011</year></date>
<date date-type="rev-recd">
<day>15</day>
<month>9</month>
<year>2011</year></date>
<date date-type="accepted">
<day>16</day>
<month>9</month>
<year>2011</year></date></history>
<permissions>
<copyright-statement>© 2011 by the authors; licensee MDPI, Basel, Switzerland.</copyright-statement>
<copyright-year>2011</copyright-year>
<license>
<p>This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution license (http://creativecommons.org/licenses/by/3.0/).</p></license></permissions>
<abstract>
<p>This paper focuses on developing a novel technique based on machine vision for detection of foreign substances in injections. Mechanical control yields spin/stop movement of injections which helps to cause relative movement between foreign substances in liquid and an ampoule bottle. Foreign substances are classified into two categories: subsiding-slowly object and subsiding-fast object. A sequence of frames are captured by a camera and used to recognize foreign substances. After image preprocessing like noise reduction and motion detection, two different methods, Moving-object Clustering (MC) and Frame Difference, are proposed to detect the two categories respectively. MC is operated to cluster subsiding-slowly foreign substances, based on the invariant features of those objects. Frame Difference is defined to calculate the difference between two frames due to the change of subsiding-fast objects. 200 ampoule samples filled with injection are tested and the experimental result indicates that the approach can detect the visible foreign substances effectively.</p></abstract>
<kwd-group>
<kwd>computer vision</kwd>
<kwd>detection of foreign substances</kwd>
<kwd>clustering</kwd>
<kwd>frame difference</kwd></kwd-group></article-meta></front>
<body>
<sec sec-type="intro">
<label>1.</label>
<title>Introduction</title>
<p>Injection liquids and transfusion solutions have been widely used in clinical treatment in the world. Foreign substances, such as metal shavings, glass shavings and fibres, may appear in injections during the process of production but they are prohibited to appear in qualified injections. These foreign substances can cause serious diseases such as tumor, phlebitis, anaphylactic reaction or even death when they are injected into blood. Despite of such large production and strict standard of injection liquid, most of the pharmaceutical corporations in China still detect the foreign substances artificially [<xref ref-type="bibr" rid="b1-sensors-11-09121">1</xref>]: an injection is illumined by a light source, a worker turns it over to checks whether visible foreign substances appear and decides the injection is qualified or not. Though this method is simple, it can result in low accuracy and low efficiency. It is significant to invent an automatic detection method with high accuracy.</p>
<p>Previous works based on machine vision are developed to detect foreign substances. A foreign substances inspection system can be traced back to 1970s [<xref ref-type="bibr" rid="b2-sensors-11-09121">2</xref>]. A lot of work is done later. Researchers have developed detection algorithm based on a sequence of frames about the liquid. Ishii <italic>et al.</italic> [<xref ref-type="bibr" rid="b3-sensors-11-09121">3</xref>] breaks up frames into odd ones and even ones, obtains the maximum and minimum values of pixel in odd and even frames respectively, and computes the difference between these values to detect foreign substances. Ishii’s method has a small amount of computation but may be confused by bubbles. Lu <italic>et al.</italic> [<xref ref-type="bibr" rid="b4-sensors-11-09121">4</xref>] proposes another method which use Mean Shift to track the moving object and judge foreign substances by trajectory. Lu’s method can distinguish foreign substances and bubbles effectively but is weak in tracking fast-moving objects. Zhou <italic>et al.</italic> [<xref ref-type="bibr" rid="b5-sensors-11-09121">5</xref>] depicts a classifier (SVM) to judge foreign substances and bubbles based on area size and ratio of length to width. This classifier has a better precision than Lu’s method but it mainly depends on samples. Moghadas <italic>et al.</italic> [<xref ref-type="bibr" rid="b6-sensors-11-09121">6</xref>] uses MLP neural network and SVM to detect foreign substances. Moghadas divides the foreign substances into 4 groups and recognizes surface objects, foreign substances and bubbles efficiently without rotating the bottles. However, this method may miss objects which falls to the bottom before detection. Xiao <italic>et al.</italic> [<xref ref-type="bibr" rid="b7-sensors-11-09121">7</xref>] detects movement by calculating the difference among three contiguous frames, tracks the movement by Particle Filter (PF) and recognizes foreign substances based on the direction of movement. This method does well in slowly-moving objects while it is weak in computation and fast-moving objects.</p>
<p>In this paper, we developed different methods corresponding to different foreign substances. Moving-object Clustering (MC) is proposed to detect subsiding-slowly objects. Clustering [<xref ref-type="bibr" rid="b8-sensors-11-09121">8</xref>] is an unsupervised learning method, breaking up a set of observations into clusters in which observations are similar in some sense. In other words, clustering is to make observations in same cluster to be as similar as possible and the ones in different clusters to be as different as possible. Therefore we employ several features to calculate the similarity of moving object and cluster the similar ones of each frame into one cluster. After clustering, we develop some criterions to distinguish foreign substances from clusters.</p>
<p>Features of subsiding-fast objects may change rapidly, which reduces the precision of clustering. In this case, we calculate the frame difference between two frames to recognize foreign substances. We analyze the frame difference values of different samples to support our method.</p>
<p>The paper is organized as follows. Section 2 introduces the framework and architecture of the detection system. Section 3 presents the classification of foreign substances. Section 4 presents algorithm of subsiding-slowly foreign substances detection. Section 5 proposes algorithm of subsiding-fast foreign substances detection. Section 6 is devoted to the experiments and analyses of the results. Section 7 concludes this paper.</p></sec>
<sec>
<label>2.</label>
<title>Framework and Architecture</title>
<p>In order to gain relative movement and reduce the appearance of bubbles, we spin ampoule at high speed and then stop it suddenly. In this case, we can distinguish moving foreign substances from static ampoule bottles. An ampoule filled with injection is fixed on a turntable driven by a motor at speed 2,000 <italic>r/min</italic>. We use a white LED back-light illumination because white light is insensitive to the color of injection and back-light illumination can cause obvious contrast between transparent and opaque region. A sequence of frames are captured by an industrial camera with resolution of 2,048 × 1,536. The framework of the detection system is shown in <xref ref-type="fig" rid="f1-sensors-11-09121">Figure 1</xref>.</p>
<p>The overall process of the detection system framework is as follow:
<list list-type="order">
<list-item>
<p>High speed rotating. An injection ampoule is delivered to a turntable by conveyor belt and fixed on it. The turntable is driven by a motor located underneath and revolves rapidly together with the ampoule. A vortex is formed so that the foreign substances can move to the center of the ampoule. The ampoule rotates steady to reduce the probability of the appearance of bubbles.</p></list-item>
<list-item>
<p>Sudden stoping. After high-speed rotation for a few seconds, the movement is stopped suddenly. Due to inertia, foreign substances continue moving for a while and have relative movement from the ampoule bottle. Thus before the liquid slows down, the white LED is lit on and the camera begins to capture a sequence of frames as inputs of our detection algorithm.</p></list-item></list></p></sec>
<sec>
<label>3.</label>
<title>Classification of Foreign Substances</title>
<p>Foreign substances used to be classified into black and white ones [<xref ref-type="bibr" rid="b3-sensors-11-09121">3</xref>,<xref ref-type="bibr" rid="b4-sensors-11-09121">4</xref>,<xref ref-type="bibr" rid="b7-sensors-11-09121">7</xref>,<xref ref-type="bibr" rid="b9-sensors-11-09121">9</xref>] when both back-light and bottom-light illumination are used together. In our framework, we only use back-light illumination and propose a new classification of foreign substances: subsiding-slowly ones and subsiding-fast ones. This classification is based on the subsiding speed of foreign substances. Subsiding-slowly foreign substances generally include rubber, hair and fiber, and subsiding-fast foreign substances mainly are glasses and metals. Illustrations of foreign substances, fiber and glass, are shown in <xref ref-type="fig" rid="f2-sensors-11-09121">Figure 2</xref>. Due to their different subsiding speed, the features of the two kinds of objects are different.</p>
<sec>
<label>3.1.</label>
<title>Subsiding-Slowly Foreign Substances</title>
<p>These foreign substances often have light weight and subside slowly after the ampoule stops moving. Therefore, we can assume that the average brightness value, area size and shape of the foreign substance are almost identical between contiguous frames. The distribution of brightness values and area sizes of the moving objects and the noise in a sequence of frames are shown in <xref ref-type="fig" rid="f3-sensors-11-09121">Figure 3</xref>, which is a statistical result after motion detection where moving objects and noise are obtained by considering the background image. The brightness values of those objects are within [115, 140], and area sizes are lower than 600. It is clear that brightness values and area sizes of the same foreign substance in a sequence of frames are close. As we assume the subsiding speed to be low, we use the positions of foreign substances between contiguous frames as another feature. Besides, Hu invariant moments [<xref ref-type="bibr" rid="b10-sensors-11-09121">10</xref>] of foreign substance qualify as features for they are invariant to scale, rotation and reflection.</p></sec>
<sec>
<label>3.2.</label>
<title>Subsiding-Fast Foreign Substances</title>
<p>In contrast to the subsiding-slowly objects, the features of subsiding-fast objects are that:
<list list-type="order">
<list-item>
<p>The density of subsiding-fast objects is relatively big, so the objects always move close to the bottom area of ampoule where bubbles hardly appear.</p></list-item>
<list-item>
<p>The shape of such object varies in frames.</p></list-item>
<list-item>
<p>They stop moving rapidly, generally in 3 or 4 frames.</p></list-item></list></p>
<p>Two contiguous frames with subsiding-fast foreign substance (glass) is shown in <xref ref-type="fig" rid="f4-sensors-11-09121">Figure 4</xref>. It is clear that the area size and shape of glass are different in two contiguous frames, hence clustering is not effective in detecting subsiding-fast foreign substances.</p></sec></sec>
<sec>
<label>4.</label>
<title>Detection of Subsiding-Slowly Foreign Substances</title>
<p>The detection of subsiding-slowly foreign substances includes three phases: motion detection, moving-object clustering and foreign substances recognition.</p>
<sec>
<label>4.1.</label>
<title>Motion Detection</title>
<p>Motion detection is to separate moving objects from frames. Images captured by camera include ampoule area and environment area, so we need to separate ampoule area from the image so as to reduce calculation. Since the height of ampoule and camera is fixed, we can set the vertical area into a fixed range. Compared with the vertical area, the horizontal area of ampoule varies in every detection. We employ Gaussian smooth and Canny operator to obtain the edges of ampoule, project the image to the horizontal direction, and gain the horizontal area by calculating the maximum value in the left half and right half part of the projection.</p>
<p>After separating the ampoule area from images, we obtain a static background by <xref ref-type="table" rid="t6-sensors-11-09121">Algorithm 1</xref>. A pixel contributes to the static background if the difference between the brightness values of two contiguous frames is less than <italic>δ</italic>, then we add this pixel value to the sum <italic>total</italic>. Each pixel value of static background <italic>BG</italic>(<italic>x, y</italic>) is the mean of values added to <italic>total</italic>.</p>
<table-wrap id="t6-sensors-11-09121" position="anchor">
<label>Algorithm 1.</label>
<caption>
<p>Static background gained from a sequence of frames.</p></caption>
<table frame="hsides" rules="none">
<tbody>
<tr>
<td colspan="2" align="left" valign="top"><bold>Input:</bold></td></tr>
<tr>
<td align="left" valign="top"/>
<td align="left" valign="top"><italic>L</italic> frames with <italic>M</italic> × <italic>N</italic> pixels;</td></tr>
<tr>
<td align="left" valign="top"/>
<td align="left" valign="top">Brightness value of pixel (<italic>x</italic>, <italic>y</italic>) in frame <italic>i</italic>, <italic>B<sub>i</sub></italic>(<italic>x</italic>, <italic>y</italic>);</td></tr>
<tr>
<td colspan="2" align="left" valign="top"><bold>Output:</bold></td></tr>
<tr>
<td align="left" valign="top"/>
<td align="left" valign="top">Static background with <italic>M</italic> × <italic>N</italic> pixels, <italic>BG</italic>;</td></tr>
<tr>
<td align="right" valign="top">1:</td>
<td align="left" valign="top"><bold>for</bold> coordinate <italic>x</italic> = 0 to <italic>M</italic> − 1 <bold>do</bold></td></tr>
<tr>
<td align="right" valign="top">2:</td>
<td align="left" valign="top">  <bold>for</bold> coordinate <italic>y</italic> = 0 to <italic>N</italic> − 1 <bold>do</bold></td></tr>
<tr>
<td align="right" valign="top">3:</td>
<td align="left" valign="top">   <italic>counter</italic> = 0;</td></tr>
<tr>
<td align="right" valign="top">4:</td>
<td align="left" valign="top">   <italic>total</italic> = 0;</td></tr>
<tr>
<td align="right" valign="top">5:</td>
<td align="left" valign="top">   <bold>for</bold> frame <italic>i</italic> = 1 to <italic>i</italic> = <italic>L</italic> − 1 <bold>do</bold></td></tr>
<tr>
<td align="right" valign="top">6:</td>
<td align="left" valign="top">    <bold>if</bold> |<italic>B<sub>i</sub></italic>(<italic>x</italic>, <italic>y</italic>) − <italic>B</italic><sub><italic>i</italic>+1</sub>(<italic>x</italic>, <italic>y</italic>)| &lt; <italic>δ</italic> <bold>then</bold></td></tr>
<tr>
<td align="right" valign="top">7:</td>
<td align="left" valign="top">     <italic>counter</italic> + +;</td></tr>
<tr>
<td align="right" valign="top">8:</td>
<td align="left" valign="top">     <italic>total</italic> = <italic>total</italic> + <italic>B<sub>i</sub></italic>(<italic>x</italic>, <italic>y</italic>);</td></tr>
<tr>
<td align="right" valign="top">9:</td>
<td align="left" valign="top">    <bold>end if</bold></td></tr>
<tr>
<td align="right" valign="top">10:</td>
<td align="left" valign="top">   <bold>end for</bold></td></tr>
<tr>
<td align="right" valign="top">11:</td>
<td align="left" valign="top">   <italic>BG</italic>(<italic>x</italic>, <italic>y</italic>) = <italic>total</italic>/<italic>counter</italic>;</td></tr>
<tr>
<td align="right" valign="top">12:</td>
<td align="left" valign="top">  <bold>end for</bold></td></tr>
<tr>
<td align="right" valign="top">13:</td>
<td align="left" valign="top"><bold>end for</bold></td></tr>
<tr>
<td align="right" valign="top">14:</td>
<td align="left" valign="top"><bold>return</bold> <italic>BG</italic>;</td></tr></tbody></table></table-wrap>
<p>As static background is obtained above, moving objects can be found by computing the difference between each frame and static background, as shown in <xref ref-type="disp-formula" rid="FD1">Equation (1)</xref>. Motion is described by a binary image <italic>MT<sub>i</sub></italic> and a pixel is considered to be part of a moving object if its value equals to 1.
<disp-formula id="FD1">
<label>(1)</label>
<mml:math display="block">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="italic">MT</mml:mi>
<mml:mi>i</mml:mi></mml:msub>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:mo>{</mml:mo>
<mml:mrow>
<mml:mtable columnalign="left">
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mn>1</mml:mn></mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mtext>if</mml:mtext>
<mml:mrow>
<mml:mo>|</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>F</mml:mi>
<mml:mi>i</mml:mi></mml:msub>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>−</mml:mo>
<mml:mi mathvariant="italic">BG</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">)</mml:mo></mml:mrow>
<mml:mo>|</mml:mo></mml:mrow>
<mml:mo>≥</mml:mo>
<mml:mi>δ</mml:mi></mml:mrow></mml:mtd></mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn></mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mtext>others</mml:mtext></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:mrow></mml:mrow></mml:math></disp-formula></p>
<p>At last, image morphological transformations is applied to reduce noise and fill up holds.</p></sec>
<sec>
<label>4.2.</label>
<title>Moving-Object Clustering</title>
<p>Generally, based on whether a classification method classifies observations into a finite number of unrelated supervised classes or unsupervised clusters, the classification method is either supervised or unsupervised [<xref ref-type="bibr" rid="b11-sensors-11-09121">11</xref>–<xref ref-type="bibr" rid="b14-sensors-11-09121">14</xref>]. Clustering, also called exploratory data analysis, is unsupervised classification. The task of clustering is to split up a set of observations into clusters so that the similarity between observations within a cluster is larger than that between observations belonging to different clusters [<xref ref-type="bibr" rid="b11-sensors-11-09121">11</xref>]. There are two types of clustering techniques: partitional clustering and hierarchical clustering [<xref ref-type="bibr" rid="b15-sensors-11-09121">15</xref>,<xref ref-type="bibr" rid="b16-sensors-11-09121">16</xref>].</p>
<p>Hierarchical clustering algorithms produce a nested series of partitions [<xref ref-type="bibr" rid="b8-sensors-11-09121">8</xref>], find successive clusters using previously established clusters. Basically, these algorithms are either agglomerative (bottom-up) or divisive (top-down). Agglomerative algorithms separate each element as a cluster and then merge them into larger clusters. Divisive algorithms regard all the elements as a cluster and then divide it into smaller clusters. <xref ref-type="fig" rid="f5-sensors-11-09121">Figure 5</xref> illustrates the operation of a bottom-up hierarchical clustering using a two-dimensional data set. <xref ref-type="fig" rid="f5-sensors-11-09121">Figure 5(a)</xref> describes 8 data (A–H) in four clusters. A dendrogram yielded by a hierarchical clustering algorithm represents the nested grouping based on the pattern and similarity of data, as shown in <xref ref-type="fig" rid="f5-sensors-11-09121">Figure 5(b)</xref>. Different clusters can be obtained by breaking the dendrogram into different leaves [<xref ref-type="bibr" rid="b8-sensors-11-09121">8</xref>].</p>
<p>Now come back to our detection, the proposed motion detection in Section 4.1 has marked all the suspected moving objects. After that, a hierarchical clustering algorithm is used to cluster the similarity of moving objects. Foreign substances recognition is then operated on the clusters.</p>
<p>As mention in Section 3.1, several features of subsiding-slowly foreign substances is almost invariant between contiguous frames. Moreover, our clustering algorithm is based on assumptions as follow: (1) The average brightness values, area sizes, Hu moments of one actual moving object in contiguous frames are analogous, and the positions of the object in contiguous frames are close. (2) The similarity of the features of the same actual object in the frames have negative correlation with the distance of the frames containing the object. (3) Suspected objects of one frame do not belong to the same actual object.</p>
<p>Based on the assumptions above and experiments, similarity between suspected objects <italic>m</italic> and <italic>n</italic> is defined in <xref ref-type="disp-formula" rid="FD2">Equations (2)</xref>–<xref ref-type="disp-formula" rid="FD6">(6)</xref>:
<disp-formula id="FD2">
<label>(2)</label>
<mml:math display="block">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>S</mml:mi></mml:mrow>
<mml:mi>B</mml:mi></mml:msub>
<mml:mo>=</mml:mo>
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>+</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mrow>
<mml:mo>|</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>m</mml:mi></mml:msub>
<mml:mo>−</mml:mo>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>n</mml:mi></mml:msub></mml:mrow>
<mml:mo>|</mml:mo></mml:mrow></mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>m</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mrow></mml:mfrac></mml:mrow></mml:math></disp-formula>
<disp-formula id="FD3">
<label>(3)</label>
<mml:math display="block">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>S</mml:mi></mml:mrow>
<mml:mi>A</mml:mi></mml:msub>
<mml:mo>=</mml:mo>
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>+</mml:mo>
<mml:mtext>log</mml:mtext>
<mml:mo>|</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:msub>
<mml:mi>A</mml:mi>
<mml:mi>m</mml:mi></mml:msub></mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>A</mml:mi>
<mml:mi>n</mml:mi></mml:msub></mml:mrow></mml:mfrac>
<mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:mrow></mml:math></disp-formula>
<disp-formula id="FD4">
<label>(4)</label>
<mml:math display="block">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>S</mml:mi></mml:mrow>
<mml:mi>H</mml:mi></mml:msub>
<mml:mo>=</mml:mo>
<mml:mtext>exp</mml:mtext>
<mml:mo stretchy="false">(</mml:mo>
<mml:mo>−</mml:mo>
<mml:mi>α</mml:mi>
<mml:munderover>
<mml:mo>∑</mml:mo>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>1</mml:mn></mml:mrow>
<mml:mn>7</mml:mn></mml:munderover>
<mml:mrow>
<mml:mo>|</mml:mo>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>m</mml:mi></mml:msub>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>i</mml:mi>
<mml:mo stretchy="false">)</mml:mo></mml:mrow>
<mml:mo>−</mml:mo>
<mml:msub>
<mml:mi>H</mml:mi>
<mml:mi>n</mml:mi></mml:msub>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>i</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>|</mml:mo>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></disp-formula>
<disp-formula id="FD5">
<label>(5)</label>
<mml:math display="block">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>S</mml:mi></mml:mrow>
<mml:mi>P</mml:mi></mml:msub>
<mml:mo>=</mml:mo>
<mml:mtext>exp</mml:mtext>
<mml:mo stretchy="false">(</mml:mo>
<mml:mo>−</mml:mo>
<mml:mi>β</mml:mi>
<mml:msqrt>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi></mml:mrow>
<mml:mi>m</mml:mi></mml:msub>
<mml:mo>−</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi></mml:mrow>
<mml:mi>n</mml:mi></mml:msub></mml:mrow>
<mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mrow>
<mml:mn>2</mml:mn></mml:msup>
<mml:mo>+</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi></mml:mrow>
<mml:mi>m</mml:mi></mml:msub>
<mml:mo>−</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi></mml:mrow>
<mml:mi>n</mml:mi></mml:msub></mml:mrow>
<mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mrow>
<mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:msqrt>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></disp-formula>
<disp-formula id="FD6">
<label>(6)</label>
<mml:math display="block">
<mml:mrow>
<mml:mi>S</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:mo>{</mml:mo>
<mml:mrow>
<mml:mtable columnalign="left">
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>S</mml:mi></mml:mrow>
<mml:mi>B</mml:mi></mml:msub>
<mml:mo>×</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>S</mml:mi></mml:mrow>
<mml:mi>A</mml:mi></mml:msub>
<mml:mo>×</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>S</mml:mi></mml:mrow>
<mml:mi>H</mml:mi></mml:msub>
<mml:mo>×</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>S</mml:mi></mml:mrow>
<mml:mi>P</mml:mi></mml:msub>
<mml:mo stretchy="false">)</mml:mo></mml:mrow>
<mml:mrow>
<mml:mo>Δ</mml:mo>
<mml:mi>F</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mo>Δ</mml:mo>
<mml:mi>F</mml:mi>
<mml:mo>&gt;</mml:mo>
<mml:mn>0</mml:mn></mml:mrow></mml:mtd></mml:mtr>
<mml:mtr columnalign="left">
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn></mml:mtd>
<mml:mtd columnalign="left">
<mml:mrow>
<mml:mo>Δ</mml:mo>
<mml:mi>F</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:mrow></mml:mrow></mml:math></disp-formula>where <italic>B</italic> denotes the average brightness value, <italic>A</italic> is the area size, <italic>H</italic>(<italic>i</italic>) indicates the <italic>i</italic> moment of the 7 Hu ones, <italic>α</italic> and <italic>β</italic> are constant, <italic>x</italic> is the X coordinate of the position while <italic>y</italic> is the Y coordinate, and Δ<italic>F</italic> is the distance between two frames. <italic>S<sub>B</sub></italic> denotes the similarity between average brightness values of object <italic>m</italic> and <italic>n. S<sub>A</sub></italic> is the similarity of two area sizes. The similarity of Hu moments is denoted by <italic>S<sub>H</sub></italic>. <italic>S<sub>P</sub></italic> represents the similarity of two positions. These four similarities form the overall similarity <italic>S</italic> of two objects. The result <italic>S</italic> of <xref ref-type="disp-formula" rid="FD6">Equation (6)</xref> is located in [0, 1], where the more similar two objects are, the bigger <italic>S</italic> is. Besides, we define <italic>D<sub>S</sub></italic> as the distance function between two objects, as shown in <xref ref-type="disp-formula" rid="FD7">Equation (7)</xref>.
<disp-formula id="FD7">
<label>(7)</label>
<mml:math display="block">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>D</mml:mi></mml:mrow>
<mml:mi>S</mml:mi></mml:msub>
<mml:mo>=</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>−</mml:mo>
<mml:mi>S</mml:mi></mml:mrow></mml:math></disp-formula></p>
<p>The clustering algorithm is depicted as follow:
<list list-type="order">
<list-item>
<p>Suppose we have <italic>L</italic> contiguous frames, each frame <italic>i</italic>, <italic>i</italic> ∈ [1, <italic>L</italic>], has <italic>N<sub>i</sub></italic> suspected objects, and each object <italic>n<sub>i</sub></italic> in each frame has <italic>K</italic> features. Therefore, K-dimension eigenvector of object is represented by <italic>O<sub>in</sub></italic> = {<italic>f</italic><sub><italic>i</italic>,<italic>n</italic>,1</sub>, <italic>f</italic><sub><italic>i</italic>,<italic>n</italic>,2</sub>, …, <italic>f</italic><sub><italic>i</italic>,<italic>n</italic>,<italic>K</italic></sub> }, where <italic>f</italic><sub><italic>i</italic>,<italic>n</italic>,<italic>K</italic></sub> is the feature <italic>k</italic> of object <italic>n</italic> in frame <italic>i</italic>. All the suspected objects form a matrix in <xref ref-type="disp-formula" rid="FD8">Equation (8)</xref>:
<disp-formula id="FD8">
<label>(8)</label>
<mml:math display="block">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>O</mml:mi></mml:mrow>
<mml:mi>S</mml:mi></mml:msub>
<mml:mo>=</mml:mo>
<mml:mo stretchy="false">[</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>O</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>11</mml:mn></mml:mrow></mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>O</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>12</mml:mn></mml:mrow></mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>⋯</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>O</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi></mml:mrow>
<mml:mn>1</mml:mn></mml:msub></mml:mrow></mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>O</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>21</mml:mn></mml:mrow></mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>O</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>22</mml:mn></mml:mrow></mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>⋯</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>O</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:msub>
<mml:mrow>
<mml:mi>n</mml:mi></mml:mrow>
<mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>⋯</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>O</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>L</mml:mi>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi></mml:mrow>
<mml:mi>L</mml:mi></mml:msub></mml:mrow></mml:msub>
<mml:mo stretchy="false">]</mml:mo></mml:mrow></mml:math></disp-formula>where <italic>O</italic><sub><italic>in</italic><sub><italic>i</italic></sub></sub> is the eigenvector of object <italic>n</italic> in frame <italic>i</italic>, <italic>n<sub>i</sub></italic> ∈ [1, <italic>N<sub>i</sub></italic>]. <xref ref-type="table" rid="t1-sensors-11-09121">Table 1</xref> shows the eigenvector <italic>O</italic><sub>11</sub>.</p></list-item>
<list-item>
<p>Using <italic>O<sub>S</sub></italic> as input, we operate bottom-up hierarchical clustering algorithm.</p></list-item></list></p>
<p><xref ref-type="fig" rid="f6-sensors-11-09121">Figure 6</xref> shows the dendrogram of one clustering on a sequence frames, the nested relationship between objects and the average <italic>D<sub>S</sub></italic> in one cluster. There are 292 suspected objects. Although there are still 50 clusters where average <italic>D<sub>S</sub></italic> is 0.85, only a few clusters have objects which appear in each frame. We can rule out most clusters based on this.</p></sec>
<sec>
<label>4.3.</label>
<title>Foreign Substances Recognition</title>
<p>Now we have clusters about noise, bubbles, and foreign substances. Because foreign substances subside slowly, we can assume that these foreign substances and bubbles receive constant force and have uniformly accelerated motion, while the motion of noise is irregular. Furthermore, bubbles always float up to injection surface while foreign substances go down to bottom or travel smaller vertical distance than bubbles. Therefore, we can recognize foreign substances based on motion calculated as follow:</p>
<p>First of all, centroid of objects is gained by <xref ref-type="disp-formula" rid="FD9">Equation (9)</xref>:
<disp-formula id="FD9">
<label>(9)</label>
<mml:math display="block">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi></mml:mrow>
<mml:mi>c</mml:mi></mml:msub>
<mml:mo>=</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:msub>
<mml:mo>∑</mml:mo>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>∈</mml:mo>
<mml:mi>R</mml:mi></mml:mrow></mml:msub>
<mml:mi mathvariant="italic">xB</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">)</mml:mo></mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mo>∑</mml:mo>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>∈</mml:mo>
<mml:mi>R</mml:mi></mml:mrow></mml:msub>
<mml:mi>B</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mfrac>
<mml:mo>,</mml:mo>
<mml:mi> </mml:mi>
<mml:mi> </mml:mi>
<mml:mi> </mml:mi>
<mml:mi> </mml:mi>
<mml:mi> </mml:mi>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi></mml:mrow>
<mml:mi>c</mml:mi></mml:msub>
<mml:mo>=</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:msub>
<mml:mo>∑</mml:mo>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>∈</mml:mo>
<mml:mi>R</mml:mi></mml:mrow></mml:msub>
<mml:mi mathvariant="italic">yB</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">)</mml:mo></mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mo>∑</mml:mo>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>∈</mml:mo>
<mml:mi>R</mml:mi></mml:mrow></mml:msub>
<mml:mi>B</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mfrac></mml:mrow></mml:math></disp-formula>where <italic>B</italic>(<italic>x</italic>, <italic>y</italic>) denotes the brightness value of pixel (<italic>x</italic>, <italic>y</italic>) in object area <italic>R</italic>. Assume the motion of an object has initial velocity (<italic>v<sub>x</sub></italic>, <italic>v<sub>y</sub></italic>), acceleration (<italic>a<sub>x</sub></italic>, <italic>a<sub>y</sub></italic>) and initial position (<italic>x</italic><sub>0</sub>, <italic>y</italic><sub>0</sub>), then the position of the object at time <italic>t</italic> is calculated by <xref ref-type="disp-formula" rid="FD10">Equation (10)</xref>:
<disp-formula id="FD10">
<label>(10)</label>
<mml:math display="block">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi></mml:mrow>
<mml:mn>0</mml:mn></mml:msub>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi></mml:mrow>
<mml:mi>x</mml:mi></mml:msub>
<mml:mo>×</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>+</mml:mo>
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mn>2</mml:mn></mml:mfrac>
<mml:msub>
<mml:mrow>
<mml:mi>a</mml:mi></mml:mrow>
<mml:mi>x</mml:mi></mml:msub>
<mml:mo>×</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>t</mml:mi></mml:mrow>
<mml:mn>2</mml:mn></mml:msup>
<mml:mo>,</mml:mo>
<mml:mi> </mml:mi>
<mml:mi> </mml:mi>
<mml:mi> </mml:mi>
<mml:mi> </mml:mi>
<mml:mi> </mml:mi>
<mml:mi> </mml:mi>
<mml:mi> </mml:mi>
<mml:mi> </mml:mi>
<mml:mi> </mml:mi>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>=</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi></mml:mrow>
<mml:mn>0</mml:mn></mml:msub>
<mml:mo>+</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi></mml:mrow>
<mml:mi>y</mml:mi></mml:msub>
<mml:mo>×</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>+</mml:mo>
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mn>2</mml:mn></mml:mfrac>
<mml:msub>
<mml:mrow>
<mml:mi>a</mml:mi></mml:mrow>
<mml:mi>y</mml:mi></mml:msub>
<mml:mo>×</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>t</mml:mi></mml:mrow>
<mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math></disp-formula>It is obvious that the third-order derivatives of <italic>x</italic>(<italic>t</italic>) and <italic>y</italic>(<italic>t</italic>) are zero ideally. Though the actual third-order derivative is not zero due to inaccurate positions of objects, there is large difference between third-order derivative of actual objects and that of noise. Third-order derivative of discrete positions are shown in <xref ref-type="disp-formula" rid="FD11">Equations (11)</xref> and <xref ref-type="disp-formula" rid="FD12">(12)</xref>.
<disp-formula id="FD11">
<label>(11)</label>
<mml:math display="block">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>d</mml:mi></mml:mrow>
<mml:mn>3</mml:mn></mml:msup>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo stretchy="false">)</mml:mo></mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="italic">dt</mml:mi></mml:mrow>
<mml:mn>3</mml:mn></mml:msup></mml:mrow></mml:mfrac>
<mml:mo>=</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>−</mml:mo>
<mml:mn>3</mml:mn>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:mn>3</mml:mn>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>−</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></disp-formula>
<disp-formula id="FD12">
<label>(12)</label>
<mml:math display="block">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>d</mml:mi></mml:mrow>
<mml:mn>3</mml:mn></mml:msup>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo stretchy="false">)</mml:mo></mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="italic">dt</mml:mi></mml:mrow>
<mml:mn>3</mml:mn></mml:msup></mml:mrow></mml:mfrac>
<mml:mo>=</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>−</mml:mo>
<mml:mn>3</mml:mn>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>+</mml:mo>
<mml:mn>3</mml:mn>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo>−</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></disp-formula></p>
<p>In <italic>L</italic> frames, we can get (<italic>L</italic> − 3) third-order derivatives of object positions. Add the square of these derivatives up to be <italic>T<sub>D</sub></italic> in <xref ref-type="disp-formula" rid="FD13">Equation (13)</xref>.
<disp-formula id="FD13">
<label>(13)</label>
<mml:math display="block">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>T</mml:mi></mml:mrow>
<mml:mi>D</mml:mi></mml:msub>
<mml:mo>=</mml:mo>
<mml:munderover>
<mml:mo>∑</mml:mo>
<mml:mrow>
<mml:mi>t</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>1</mml:mn></mml:mrow>
<mml:mrow>
<mml:mi>L</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>3</mml:mn></mml:mrow></mml:munderover>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>d</mml:mi></mml:mrow>
<mml:mn>3</mml:mn></mml:msup>
<mml:mi>x</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo stretchy="false">)</mml:mo></mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="italic">dt</mml:mi></mml:mrow>
<mml:mn>3</mml:mn></mml:msup></mml:mrow></mml:mfrac></mml:mrow>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mrow>
<mml:mn>2</mml:mn></mml:msup>
<mml:mo>+</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>d</mml:mi></mml:mrow>
<mml:mn>3</mml:mn></mml:msup>
<mml:mi>y</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo stretchy="false">)</mml:mo></mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="italic">dt</mml:mi></mml:mrow>
<mml:mn>3</mml:mn></mml:msup></mml:mrow></mml:mfrac></mml:mrow>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mrow>
<mml:mn>2</mml:mn></mml:msup></mml:mrow>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mrow></mml:math></disp-formula></p>
<p>A threshold <italic>η</italic> is set to recognize actual objects and noise. It is considered as an actual object if <italic>T<sub>D</sub></italic> &lt; <italic>η</italic> and as noise if otherwise. Besides, we use the distance on vertical direction to separate foreign substances and bubbles. A threshold <italic>μ</italic> is set to complete this job.</p></sec></sec>
<sec>
<label>5.</label>
<title>Detection of Subsiding-Fast Foreign Substances</title>
<p>As analyzed in Section 3.2, detection algorithm of subsiding-fast foreign substances is different from that of subsiding-slowly foreign substances. Due to the features of subsiding-fast objects, Frame Difference is proposed. Assume the bottom area of an ampoule in frame <italic>i</italic> is <bold><italic>G</italic></bold><italic><sub>i</sub></italic> shown in <xref ref-type="disp-formula" rid="FD14">Equation (14)</xref>:
<disp-formula id="FD14">
<label>(14)</label>
<mml:math display="block">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mtext mathvariant="bold-italic">G</mml:mtext></mml:mrow>
<mml:mi>i</mml:mi></mml:msub>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>00</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>01</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mo>⋯</mml:mo></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>Q</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>10</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>11</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mo>⋯</mml:mo></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>Q</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mo>⋮</mml:mo></mml:mtd>
<mml:mtd>
<mml:mo>⋮</mml:mo></mml:mtd>
<mml:mtd>
<mml:mo>⋱</mml:mo></mml:mtd>
<mml:mtd>
<mml:mo>⋮</mml:mo></mml:mtd></mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>P</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>P</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mo>⋯</mml:mo></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>P</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>Q</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mrow>
<mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math></disp-formula>in which <italic>P</italic> × <italic>Q</italic> denotes the bottom area size of an ampoule and <italic>g<sub>jk</sub></italic> is the brightness value of pixel (<italic>j</italic>, <italic>k</italic>). We compute the sum of row vectors and that of column vectors respectively in <italic>G<sub>i</sub></italic>, as shown in <xref ref-type="disp-formula" rid="FD15">Equations (15)</xref> and <xref ref-type="disp-formula" rid="FD16">(16)</xref>:
<disp-formula id="FD15">
<label>(15)</label>
<mml:math display="block">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold-italic">V</mml:mi></mml:mrow>
<mml:mi>i</mml:mi></mml:msub>
<mml:mo>=</mml:mo>
<mml:mo>(</mml:mo>
<mml:mtable columnalign="left">
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>V</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>V</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>V</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mo>⋯</mml:mo></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>V</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>Q</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msub>
<mml:mo>)</mml:mo>
<mml:mo>=</mml:mo>
<mml:munderover>
<mml:mo>∑</mml:mo>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn></mml:mrow>
<mml:mrow>
<mml:mi>P</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>1</mml:mn></mml:mrow></mml:munderover>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mtable columnalign="left">
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mo>⋯</mml:mo></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>Q</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr></mml:mtable>
<mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:math></disp-formula>
<disp-formula id="FD16">
<label>(16)</label>
<mml:math display="block">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold-italic">W</mml:mi></mml:mrow>
<mml:mi>i</mml:mi></mml:msub>
<mml:mo>=</mml:mo>
<mml:mo>(</mml:mo>
<mml:mtable columnalign="left">
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>W</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>W</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>W</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mo>⋯</mml:mo></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>W</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>P</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msub>
<mml:mo>)</mml:mo>
<mml:mo>=</mml:mo>
<mml:munderover>
<mml:mo>∑</mml:mo>
<mml:mrow>
<mml:mi>k</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn></mml:mrow>
<mml:mrow>
<mml:mi>Q</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>1</mml:mn></mml:mrow></mml:munderover>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mtable columnalign="left">
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd>
<mml:mtd>
<mml:mo>⋯</mml:mo></mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi></mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>P</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd></mml:mtr></mml:mtable>
<mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:math></disp-formula>where <bold><italic>V<sub>i</sub></italic></bold> is the sum of row vectors and <bold><italic>W<sub>i</sub></italic></bold> is the sum of column vectors. Frame Difference <italic>D</italic> is defined in <xref ref-type="disp-formula" rid="FD17">Equations (17)</xref>–<xref ref-type="disp-formula" rid="FD19">(19)</xref>. Unlike calculating the difference between pixels, we first derive the sum of row vectors <bold><italic>V<sub>i</sub></italic></bold> and sum of column vectors <bold><italic>W<sub>i</sub></italic></bold>, then compute the differences of the sums between two contiguous frames, <italic>D</italic> is the sum of two differences.
<disp-formula id="FD17">
<label>(17)</label>
<mml:math display="block">
<mml:mrow>
<mml:msub>
<mml:mi>D</mml:mi>
<mml:mi>i</mml:mi></mml:msub>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:mo>‖</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>V</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn></mml:mrow></mml:msub>
<mml:mo>−</mml:mo>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mi>i</mml:mi></mml:msub></mml:mrow>
<mml:mo>‖</mml:mo></mml:mrow>
<mml:mo>+</mml:mo>
<mml:mrow>
<mml:mo>‖</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>W</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn></mml:mrow></mml:msub>
<mml:mo>−</mml:mo>
<mml:msub>
<mml:mi>W</mml:mi>
<mml:mi>i</mml:mi></mml:msub></mml:mrow>
<mml:mo>‖</mml:mo></mml:mrow></mml:mrow></mml:math></disp-formula>
<disp-formula id="FD18">
<label>(18)</label>
<mml:math display="block">
<mml:mrow>
<mml:mrow>
<mml:mo>‖</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>V</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn></mml:mrow></mml:msub>
<mml:mo>−</mml:mo>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mi>i</mml:mi></mml:msub></mml:mrow>
<mml:mo>‖</mml:mo></mml:mrow>
<mml:mo>=</mml:mo>
<mml:munderover>
<mml:mo>∑</mml:mo>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn></mml:mrow>
<mml:mrow>
<mml:mi>Q</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>1</mml:mn></mml:mrow></mml:munderover>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>V</mml:mi></mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>i</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mi>j</mml:mi></mml:mrow></mml:msub>
<mml:mo>−</mml:mo>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mi mathvariant="italic">ij</mml:mi></mml:msub></mml:mrow>
<mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mrow>
<mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:mrow></mml:math></disp-formula>
<disp-formula id="FD19">
<label>(19)</label>
<mml:math display="block">
<mml:mrow>
<mml:mrow>
<mml:mo>‖</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>W</mml:mi></mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn></mml:mrow></mml:msub>
<mml:mo>−</mml:mo>
<mml:msub>
<mml:mi>W</mml:mi>
<mml:mi>i</mml:mi></mml:msub></mml:mrow>
<mml:mo>‖</mml:mo></mml:mrow>
<mml:mo>=</mml:mo>
<mml:munderover>
<mml:mo>∑</mml:mo>
<mml:mrow>
<mml:mi>k</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn></mml:mrow>
<mml:mrow>
<mml:mi>P</mml:mi>
<mml:mo>−</mml:mo>
<mml:mn>1</mml:mn></mml:mrow></mml:munderover>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>W</mml:mi></mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mi>i</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">)</mml:mo>
<mml:mi>k</mml:mi></mml:mrow></mml:msub>
<mml:mo>−</mml:mo>
<mml:msub>
<mml:mi>W</mml:mi>
<mml:mi mathvariant="italic">ik</mml:mi></mml:msub></mml:mrow>
<mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mrow>
<mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:mrow></mml:math></disp-formula></p>
<p>After image preprocessing like Gaussian smoothing, we calculate Frame Difference <italic>D</italic><sub>1</sub> between frame 1 and frame 2, because the different between those frames may be the biggest among all contiguous two frames. At last, a threshold <italic>θ</italic> is set to recognize subsiding-fast foreign substances. In order to analyze the effect of <italic>D</italic>, we employ 112 ampoule samples among which 28 samples have glass. <xref ref-type="fig" rid="f7-sensors-11-09121">Figure 7</xref> shows the statistical result of <italic>D</italic>. It is obvious that the <italic>D</italic> value of ampoules with subsiding-fast foreign substances is much bigger than that of ampoules without foreign substances. <italic>θ</italic> is set to be 150 to detect subsiding-fast foreign substances.</p></sec>
<sec>
<label>6.</label>
<title>Experimental Result</title>
<p>Before testing our system, we have to solve a problem: decide the values of parameters mentioned above. <italic>δ</italic> in <xref ref-type="disp-formula" rid="FD1">Equation (1)</xref> is used to separate foreground from background and decided by experiment. <xref ref-type="fig" rid="f8-sensors-11-09121">Figure 8</xref> illustrates one of the experimental result. When <italic>δ</italic> = 1, there will be too much noise in foreground which only increases the computation of detection. When <italic>δ</italic> = 7, boundary area of foreign substance is lost which affects the features of foreign substances. We choose <italic>δ</italic> = 3 rather than <italic>δ</italic> = 5 to increase the precision of motion detection.</p>
<p><italic>α</italic> and <italic>β</italic> are scale parameters used to reduce the contribution of Hu moments on similarity and adjust the pixel distance to the ampoule size in image. They are set to be 
<inline-formula>
<mml:math>
<mml:mrow>
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mrow>
<mml:mn>30</mml:mn></mml:mrow></mml:mfrac></mml:mrow></mml:math></inline-formula> and 
<inline-formula>
<mml:math>
<mml:mrow>
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mrow>
<mml:mn>200</mml:mn></mml:mrow></mml:mfrac></mml:mrow></mml:math></inline-formula>.</p>
<p>Our method uses <italic>μ</italic> in Section 4.3 to recognize foreign substances and bubbles. According to Pan’s simulation [<xref ref-type="bibr" rid="b17-sensors-11-09121">17</xref>], the speed of bubbles with over 40 <italic>μm</italic> radius rises to over 3 <italic>mm/s</italic> after 0.01 second. The camera captures 9 frames every second and 1 <italic>mm</italic> distance has 60 pixels. Assume that the speed of bubbles is 3 <italic>mm/s</italic>, so bubbles can move up at least 20 pixel between two frames. Since some foreign substances hardly move in frames, we set <italic>μ</italic> to be −10. If one object moves up less than 10 pixel, it is considered to be foreign substance.</p>
<p><italic>η</italic> in Section 4.3 is proposed to recognize foreign substances and noise. In order to decide the value of <italic>η</italic>, we compute <italic>T<sub>D</sub></italic> values in <xref ref-type="disp-formula" rid="FD13">Equation (13)</xref> using 603 trace samples as shown in <xref ref-type="fig" rid="f9-sensors-11-09121">Figure 9</xref>. 206 trace samples of foreign substances are used, whose <italic>T<sub>D</sub></italic> values are all lower than 100. Over 99.7% percent of <italic>T<sub>D</sub></italic> values of noise samples are higher than 100. It is obvious that <italic>T<sub>D</sub></italic> can recognize traces of foreign substances and that of noise effectively, therefore we choose <italic>η</italic> to be 100.</p>
<p>After choosing the value of the parameters, some experiment are made and the results are shown in <xref ref-type="table" rid="t2-sensors-11-09121">Tables 2</xref> and <xref ref-type="table" rid="t3-sensors-11-09121">3</xref>. There are 200 ampoule samples, among which 129 samples are without foreign substance, 41 samples contain subsiding-slowly foreign substances and the others contain subsiding-fast foreign substances. The accuracy of recognizing subsiding-fast foreign substances is 96.67%. It is because some glass are big and heavy, and they stop moving before frames are captured. In this case, Frame Difference <italic>D</italic> is lower than <italic>θ</italic>. Some improvement about control system, motor and camera can solve this problem. Accuracy of subsiding-slowly foreign substances detection is 97.56%. The reasons for failed detection are that:
<list list-type="order">
<list-item>
<p>foreign substances move to the side wall of an ampoule and then miss in a frame;</p></list-item>
<list-item>
<p>noise due to camera and environment cause the failure;</p></list-item>
<list-item>
<p>foreign substances move too slowly, so they are considered to be background.</p></list-item></list></p>
<p>The detection precision of ampoules without foreign substance is 98.45%. Since the variation of brightness in some frames is apparent due to the camera and environment, ampoules without foreign substance is recognized into those with subsiding-fast foreign substances.</p>
<p>The comparison among our system and other systems is shown in <xref ref-type="table" rid="t4-sensors-11-09121">Table 4</xref>. The qualified liquids’ detection accuracy of our system is the highest among the systems brought forward. The accuracy of our system in detecting unqualified liquids is the second best. It is shown that our system can detect qualified and unqualified injections effectively.</p>
<p>We apply Knapp–Kushner testing programs [<xref ref-type="bibr" rid="b18-sensors-11-09121">18</xref>], which are accepted by U.S. Food &amp; Drug Administration (FDA) and European pharmacopoeia, to test our automatic detection system. The testing samples are the same as those in <xref ref-type="table" rid="t2-sensors-11-09121">Table 2</xref>. Because the judging criterion is <italic>FQB/FQA &gt;</italic> 1, the result shown in <xref ref-type="table" rid="t5-sensors-11-09121">Table 5</xref> points out that our detection machine is more effective than workers.</p></sec>
<sec sec-type="conclusions">
<label>7.</label>
<title>Conclusions</title>
<p>This paper mainly studies the detection of foreign substances in injection ampoule. A mechanical system is designed and achieved. We build the system with an industry camera, a motor and some supporting tables like turntable. Foreign substances are classified into two categories: subsiding-slowly ones and subsiding-fast ones. Since we detect foreign substances based on movement, classifying those objects based on their movement features is reasonable. Different characteristics between those categories lead to different detection methods. Moving-object clustering is proved to be effective in detecting subsiding-slowly objects. Four features are employed to calculate the similarity between objects in clusters. Bubbles hardly affect the detection of subsiding-fast objects, so a light computation method Frame Difference is proposed.</p>
<p>Future work may focus on the improvement of mechanical system, algorithms and application of the system in production.</p></sec></body>
<back>
<ack>
<p>This work was partially supported by Grant No. 1118021013 from the Chinese Fundamental Research Funds for the Central Universities, Grant No. BK2010391 from Natural Science Foundation of Jiangsu Province and Grant No. 61100111 from Natural Science Foundation of China.</p></ack>
<ref-list>
<title>References</title>
<ref id="b1-sensors-11-09121"><label>1.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Du</surname><given-names>XP</given-names></name></person-group><article-title>The difference between artificial inspection and machine inspection</article-title><source>Mech. Elect. Inform</source><year>2010</year><volume>29</volume><fpage>21</fpage><lpage>25</lpage></citation></ref>
<ref id="b2-sensors-11-09121"><label>2.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Nagamatsu</surname><given-names>K</given-names></name><name><surname>Tomita</surname><given-names>A</given-names></name></person-group><article-title>Research on the automatic inspection machine of ampoules</article-title><source>J. Takeda Res. Lab</source><year>1974</year><volume>33</volume><fpage>43</fpage><lpage>54</lpage></citation></ref>
<ref id="b3-sensors-11-09121"><label>3.</label><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Ishii</surname><given-names>A</given-names></name><name><surname>Mizuta</surname><given-names>T</given-names></name><name><surname>Todo</surname><given-names>S</given-names></name></person-group><article-title>Detection of Foreign Substances Mixed in a Plastic Bottle of Medicinal Solution Using Real-Time Video Image Processing</article-title><conf-name>Proceedings of Fourteenth International Conference on Pattern Recognition</conf-name><conf-loc>Brisbane, Australia</conf-loc><conf-date>16–20 August 1998</conf-date></citation></ref>
<ref id="b4-sensors-11-09121"><label>4.</label><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Lu</surname><given-names>J</given-names></name><name><surname>Wang</surname><given-names>YN</given-names></name><name><surname>Zhang</surname><given-names>H</given-names></name><name><surname>Zhou</surname><given-names>BW</given-names></name></person-group><article-title>On-Line Detection of Foreign Substances in Glass Bottles Filled with Transfusion Solution Through Computer Vision</article-title><conf-name>Proceedings of 2008 International Conference on Information and Automation</conf-name><conf-loc>Zhangjiajie, China</conf-loc><conf-date>20–23 June 2008</conf-date></citation></ref>
<ref id="b5-sensors-11-09121"><label>5.</label><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Zhou</surname><given-names>BW</given-names></name><name><surname>Wang</surname><given-names>YN</given-names></name><name><surname>Ge</surname><given-names>J</given-names></name><name><surname>Zhang</surname><given-names>H</given-names></name></person-group><article-title>A Machine Vision Intelligent Inspector for Injection</article-title><conf-name>Proceedings of Paciia 2008: Pacific-Asia Workshop on Computational Intelligence and Industrial Application</conf-name><conf-loc>Wuhan, China</conf-loc><conf-date>19–20 December 2008</conf-date></citation></ref>
<ref id="b6-sensors-11-09121"><label>6.</label><citation citation-type="confproc"><person-group person-group-type="author"><name><surname>Moghadas</surname><given-names>S</given-names></name><name><surname>Rabbani</surname><given-names>N</given-names></name></person-group><article-title>Detection and Classification of Foreign Substances in Medical Vials Using MLP Neural Network and SVM</article-title><conf-name>Proceedings of 6th Iranian Conference on Machine Vision and Image Processing</conf-name><conf-loc>Isfahan, Iran</conf-loc><conf-date>27–28 October 2010</conf-date></citation></ref>
<ref id="b7-sensors-11-09121"><label>7.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Xiao</surname><given-names>F</given-names></name><name><surname>Wang</surname><given-names>Y</given-names></name><name><surname>Zhang</surname><given-names>J</given-names></name><name><surname>Cao</surname><given-names>L</given-names></name></person-group><article-title>Research on an on-line detection system for foreign substances in ampoule</article-title><source>Comput. Measur. Control</source><year>2010</year><volume>18</volume><fpage>295</fpage><lpage>298</lpage></citation></ref>
<ref id="b8-sensors-11-09121"><label>8.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Jain</surname><given-names>A</given-names></name><name><surname>Murty</surname><given-names>M</given-names></name><name><surname>Flynn</surname><given-names>P</given-names></name></person-group><article-title>Data clustering: A review</article-title><source>ACM Comput. Surv</source><year>1999</year><volume>31</volume><fpage>264</fpage><lpage>323</lpage><pub-id pub-id-type="doi">10.1145/331499.331504</pub-id></citation></ref>
<ref id="b9-sensors-11-09121"><label>9.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ge</surname><given-names>J</given-names></name><name><surname>Wang</surname><given-names>Y</given-names></name><name><surname>Zhou</surname><given-names>B</given-names></name><name><surname>Zhang</surname><given-names>H</given-names></name></person-group><article-title>Intelligent foreign particle inspection machine for injection liquid examination based on modified pulse-coupled neural networks</article-title><source>Sensors</source><year>2009</year><volume>9</volume><fpage>3386</fpage><lpage>3404</lpage><pub-id pub-id-type="doi">10.3390/s90503386</pub-id><pub-id pub-id-type="pmid">22412318</pub-id></citation></ref>
<ref id="b10-sensors-11-09121"><label>10.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Hu</surname><given-names>M</given-names></name></person-group><article-title>Visual pattern recognition by moment invariants</article-title><source>IEEE Trans. Informa. Theory</source><year>1962</year><volume>8</volume><fpage>179</fpage><lpage>187</lpage></citation></ref>
<ref id="b11-sensors-11-09121"><label>11.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Xu</surname><given-names>R</given-names></name><name><surname>Wunsch</surname><given-names>D</given-names></name></person-group><article-title>Survey of clustering algorithms</article-title><source>IEEE Trans. Neural Netw</source><year>2005</year><volume>16</volume><fpage>645</fpage><lpage>678</lpage><pub-id pub-id-type="doi">10.1109/TNN.2005.845141</pub-id><pub-id pub-id-type="pmid">15940994</pub-id></citation></ref>
<ref id="b12-sensors-11-09121"><label>12.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Kriegel</surname><given-names>H</given-names></name><name><surname>Kr Ger</surname><given-names>P</given-names></name><name><surname>Zimek</surname><given-names>A</given-names></name></person-group><article-title>Clustering high-dimensional data: A survey on subspace clustering, pattern-based clustering, and correlation clustering</article-title><source>ACM Trans. Knowl. Discov. Data</source><year>2009</year><volume>3</volume><fpage>1</fpage><lpage>58</lpage></citation></ref>
<ref id="b13-sensors-11-09121"><label>13.</label><citation citation-type="book"><person-group person-group-type="author"><name><surname>Cherkassky</surname><given-names>V</given-names></name><name><surname>Mulier</surname><given-names>F</given-names></name></person-group><source>Learning From Data: Concepts, Theory, and Methods</source><publisher-name>Wiley-IEEE Press</publisher-name><publisher-loc>New York, NY, USA</publisher-loc><year>2007</year></citation></ref>
<ref id="b14-sensors-11-09121"><label>14.</label><citation citation-type="book"><person-group person-group-type="author"><name><surname>Duda</surname><given-names>R</given-names></name><name><surname>Hart</surname><given-names>P</given-names></name><name><surname>Stork</surname><given-names>D</given-names></name></person-group><source>Pattern Classification</source><edition>2nd ed</edition><publisher-name>Wiley</publisher-name><publisher-loc>New York, NY, USA</publisher-loc><year>2001</year></citation></ref>
<ref id="b15-sensors-11-09121"><label>15.</label><citation citation-type="book"><person-group person-group-type="author"><name><surname>Berkhin</surname><given-names>P</given-names></name></person-group><article-title>Survey of clustering data mining techniques</article-title><source>Grouping Multidimensional Data: Recent Advances in Clustering</source><publisher-name>Springer</publisher-name><publisher-loc>London, UK</publisher-loc><year>2006</year><fpage>25</fpage><lpage>71</lpage></citation></ref>
<ref id="b16-sensors-11-09121"><label>16.</label><citation citation-type="book"><person-group person-group-type="author"><name><surname>Everitt</surname><given-names>B</given-names></name><name><surname>Landau</surname><given-names>S</given-names></name><name><surname>Leese</surname><given-names>M</given-names></name></person-group><source>Cluster Analysis</source><publisher-name>Arnold</publisher-name><publisher-loc>London, UK</publisher-loc><year>2001</year></citation></ref>
<ref id="b17-sensors-11-09121"><label>17.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Pan</surname><given-names>F</given-names></name><name><surname>Lu</surname><given-names>W</given-names></name></person-group><article-title>Theoretical study and simulation of a single micro-bubble in still water</article-title><source>Ship Elect. Eng</source><year>2009</year><volume>29</volume><fpage>155</fpage><lpage>158</lpage></citation></ref>
<ref id="b18-sensors-11-09121"><label>18.</label><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Knapp</surname><given-names>J</given-names></name><name><surname>Kushner</surname><given-names>H</given-names></name></person-group><article-title>Generalized methodology for evaluation of parenteral inspection procedures</article-title><source>PDA J. Pharm. Sci. Tech</source><year>1980</year><volume>34</volume><fpage>14</fpage><lpage>61</lpage></citation></ref></ref-list>
<sec sec-type="display-objects">
<title>Figures and Tables</title>
<fig id="f1-sensors-11-09121" position="float">
<label>Figure 1.</label>
<caption>
<p>Framework of the detection system.</p></caption>
<graphic xlink:href="sensors-11-09121f1.gif"/></fig>
<fig id="f2-sensors-11-09121" position="float">
<label>Figure 2.</label>
<caption>
<p>Foreign substances. <bold>(a)</bold> Fiber, <bold>(b)</bold> Glass.</p></caption>
<graphic xlink:href="sensors-11-09121f2.gif"/></fig>
<fig id="f3-sensors-11-09121" position="float">
<label>Figure 3.</label>
<caption>
<p>Distribution of brightness value and area size in a sequence of frames.</p></caption>
<graphic xlink:href="sensors-11-09121f3.gif"/></fig>
<fig id="f4-sensors-11-09121" position="float">
<label>Figure 4.</label>
<caption>
<p>Two contiguous frames with glass. <bold>(a)</bold> Glass in frame <italic>i</italic>, <bold>(b)</bold> Glass in frame (<italic>i</italic> + 1).</p></caption>
<graphic xlink:href="sensors-11-09121f4.gif"/></fig>
<fig id="f5-sensors-11-09121" position="float">
<label>Figure 5.</label>
<caption>
<p>Illustration of hierarchical clustering algorithm. <bold>(a)</bold> Points fall into four clusters, <bold>(b)</bold> Dendrogram yielded by the algorithm.</p></caption>
<graphic xlink:href="sensors-11-09121f5.gif"/></fig>
<fig id="f6-sensors-11-09121" position="float">
<label>Figure 6.</label>
<caption>
<p>Dendrogram of one clustering on a sequence frames.</p></caption>
<graphic xlink:href="sensors-11-09121f6.gif"/></fig>
<fig id="f7-sensors-11-09121" position="float">
<label>Figure 7.</label>
<caption>
<p>The statistical result of Frame Difference D.</p></caption>
<graphic xlink:href="sensors-11-09121f7.gif"/></fig>
<fig id="f8-sensors-11-09121" position="float">
<label>Figure 8.</label>
<caption>
<p>Experiment of foreground on different <italic>δ</italic>, foreign substance with the biggest white area. <bold>(a)</bold> <italic>δ</italic> = 1, <bold>(b)</bold> <italic>δ</italic> = 3, <bold>(c)</bold> <italic>δ</italic> = 5, <bold>(d)</bold> <italic>δ</italic> = 7.</p></caption>
<graphic xlink:href="sensors-11-09121f8.gif"/></fig>
<fig id="f9-sensors-11-09121" position="float">
<label>Figure 9.</label>
<caption>
<p><italic>T<sub>D</sub></italic> values of 603 track samples.</p></caption>
<graphic xlink:href="sensors-11-09121f9.gif"/></fig>
<table-wrap id="t1-sensors-11-09121" position="float">
<label>Table 1.</label>
<caption>
<p>Eigenvector <italic>O</italic><sub>11</sub>.</p></caption>
<table frame="hsides" rules="groups">
<thead>
<tr>
<th align="center" valign="middle" rowspan="3">object</th>
<th colspan="11" align="center" valign="middle">eigenvector
<hr/></th></tr>
<tr>
<th align="center" valign="middle"><italic>B</italic></th>
<th align="center" valign="middle"><italic>A</italic></th>
<th align="center" valign="middle"><italic>x</italic></th>
<th align="center" valign="middle"><italic>y</italic></th>
<th align="center" valign="middle"><italic>H</italic>[1]</th>
<th align="center" valign="middle"><italic>H</italic>[2]</th>
<th align="center" valign="middle"><italic>H</italic>[3]</th>
<th align="center" valign="middle"><italic>H</italic>[4]</th>
<th align="center" valign="middle"><italic>H</italic>[5]</th>
<th align="center" valign="middle"><italic>H</italic>[6]</th>
<th align="center" valign="middle"><italic>H</italic>[7]</th></tr></thead>
<tbody>
<tr>
<td align="center" valign="top"><italic>O</italic><sub>11</sub></td>
<td align="center" valign="top"><italic>f</italic><sub>1,1,1</sub></td>
<td align="center" valign="top"><italic>f</italic><sub>1,1,2</sub></td>
<td align="center" valign="top"><italic>f</italic><sub>1,1,3</sub></td>
<td align="center" valign="top"><italic>f</italic><sub>1,1,4</sub></td>
<td align="center" valign="top"><italic>f</italic><sub>1,1,5</sub></td>
<td align="center" valign="top"><italic>f</italic><sub>1,1,6</sub></td>
<td align="center" valign="top"><italic>f</italic><sub>1,1,7</sub></td>
<td align="center" valign="top"><italic>f</italic><sub>1,1,8</sub></td>
<td align="center" valign="top"><italic>f</italic><sub>1,1,9</sub></td>
<td align="center" valign="top"><italic>f</italic><sub>1,1,10</sub></td>
<td align="center" valign="top"><italic>f</italic><sub>1,1,11</sub></td></tr></tbody></table></table-wrap>
<table-wrap id="t2-sensors-11-09121" position="float">
<label>Table 2.</label>
<caption>
<p>Detection result of 200 samples.</p></caption>
<table frame="hsides" rules="all">
<thead>
<tr>
<th align="left" valign="middle">Category</th>
<th align="center" valign="middle">Number of samples</th>
<th align="center" valign="middle">True detection</th>
<th align="center" valign="middle">Accuracy</th></tr></thead>
<tbody>
<tr>
<td align="left" valign="middle">Subsiding-fast</td>
<td align="center" valign="middle">30</td>
<td align="center" valign="middle">29</td>
<td align="center" valign="middle">96.67%</td></tr>
<tr>
<td align="left" valign="middle">Subsiding-slowly</td>
<td align="center" valign="middle">41</td>
<td align="center" valign="middle">40</td>
<td align="center" valign="middle">97.56%</td></tr>
<tr>
<td align="left" valign="middle">No foreign substance</td>
<td align="center" valign="middle">129</td>
<td align="center" valign="middle">127</td>
<td align="center" valign="middle">98.45%</td></tr></tbody></table></table-wrap>
<table-wrap id="t3-sensors-11-09121" position="float">
<label>Table 3.</label>
<caption>
<p>Overview result of detection.</p></caption>
<table frame="hsides" rules="all">
<tbody>
<tr>
<td align="left" valign="middle">Total number of samples</td>
<td align="center" valign="middle">200</td></tr>
<tr>
<td align="left" valign="middle">Number of true detection</td>
<td align="center" valign="middle">196</td></tr>
<tr>
<td align="left" valign="middle">Detection accuracy</td>
<td align="center" valign="middle">98.00%</td></tr></tbody></table></table-wrap>
<table-wrap id="t4-sensors-11-09121" position="float">
<label>Table 4.</label>
<caption>
<p>Comparison among our system and other systems.</p></caption>
<table frame="hsides" rules="all">
<thead>
<tr>
<th align="center" valign="middle">System</th>
<th align="center" valign="middle">Our system (200 samples)</th>
<th align="center" valign="middle">Lu’ system [<xref ref-type="bibr" rid="b4-sensors-11-09121">4</xref>] (180 samples)</th>
<th align="center" valign="middle">Zhou’s system [<xref ref-type="bibr" rid="b5-sensors-11-09121">5</xref>] (480 samples)</th>
<th align="center" valign="middle">Xiao’s system [<xref ref-type="bibr" rid="b7-sensors-11-09121">7</xref>] (3,500 samples)</th></tr></thead>
<tbody>
<tr>
<td align="center" valign="middle">Detection accuracy of qualified liquids</td>
<td align="center" valign="middle">98.45%</td>
<td align="center" valign="middle">96.10%</td>
<td align="center" valign="middle">97.00%</td>
<td align="center" valign="middle">98.32%</td></tr>
<tr>
<td align="center" valign="middle">Detection accuracy of unqualified liquids</td>
<td align="center" valign="middle">97.18%</td>
<td align="center" valign="middle">91.80%</td>
<td align="center" valign="middle">98.89%</td>
<td align="center" valign="middle">96.00%</td></tr></tbody></table></table-wrap>
<table-wrap id="t5-sensors-11-09121" position="float">
<label>Table 5.</label>
<caption>
<p>Knapp–Kushner testing result.</p></caption>
<table frame="hsides" rules="groups">
<thead>
<tr>
<th align="center" valign="middle">FQA<xref ref-type="table-fn" rid="tfn1-sensors-11-09121"><sup>1</sup></xref></th>
<th align="center" valign="middle">FQB<xref ref-type="table-fn" rid="tfn1-sensors-11-09121"><sup>1</sup></xref></th>
<th align="center" valign="middle">FQB/FQA</th>
<th align="center" valign="middle">Criterion</th>
<th align="center" valign="middle">Result</th></tr></thead>
<tbody>
<tr>
<td align="center" valign="middle">407</td>
<td align="center" valign="middle">613</td>
<td align="center" valign="middle">1.506</td>
<td align="center" valign="middle"><italic>FQB/FQA &gt;</italic> 1</td>
<td align="center" valign="middle">Detection machine is more effective than workers</td></tr></tbody></table>
<table-wrap-foot><fn id="tfn1-sensors-11-09121">
<label>1</label>
<p><italic>FQ<sub>i</sub></italic>: quality factor of bottle <italic>i</italic>.</p>
<p><italic>FQ<sub>i</sub></italic> = (<italic>n/N</italic>) × 10, where n is unqualified times of bottle i, N is total testing times of bottle i.</p>
<p><italic>FQA: FQ</italic> of workers.</p>
<p><italic>FQA</italic> = <italic>FQA</italic><sub>[7,10]</sub> = Σ <italic>FQA<sub>i</sub></italic>, only <italic>FQA<sub>i</sub></italic> located in [7, 10] are added.</p>
<p><italic>FQB: FQ</italic> of detection machine.</p>
<p><italic>FQB</italic> = <italic>FQB</italic><sub>[7,10]</sub> = Σ <italic>FQB<sub>i</sub></italic>, only <italic>FQB<sub>i</sub></italic> located in [7, 10] are added.</p></fn></table-wrap-foot></table-wrap></sec></back></article>
