Alignment of the Measurement Scale Mark during Immersion Hydrometer Calibration Using an Image Processing System

The present work presents an improved method to align the measurement scale mark in an immersion hydrometer calibration system of CENAM, the National Metrology Institute (NMI) of Mexico, The proposed method uses a vision system to align the scale mark of the hydrometer to the surface of the liquid where it is immersed by implementing image processing algorithms. This approach reduces the variability in the apparent mass determination during the hydrostatic weighing in the calibration process, therefore decreasing the relative uncertainty of calibration.


Introduction
Hydrometers are widely used instruments in industry to measure the density of liquids. Depending on the application, the hydrometer may change its name, i.e., alcoholmeter to measure the percent of alcohol in breweries [1][2][3]; Brix hydrometer [4], to measure the percent of sugar in sugar cane OPEN ACCESS solutions; lactometers, to determine the fat content from milk density [5] and API hydrometers or thermo-hygrometers [6], but in the end, no matter in which units the hydrometer is graduated, it measures the density of a liquid [7]. These instruments are generally manufactured in glass, having two main parts: the body, sometimes with a bulb and a hydrometer stem. The body has a cylindrical shape with a load in the bottom; the hydrometer stem is a thin hollow tube attached to the upper portion of the body. A paper with a graduated scale is fixed inside the hydrometer stem. The hydrometer floats vertically on the liquid where it is immersed by means of the Archimedes' principle; the density of the liquid is the reading of the scale mark at the surface level of the liquid.
Cuckow's method is used for the calibration of hydrometers [8]. It consists in obtaining the mass of the hydrometer both in air and when it is submerged to a desired point of its scale mark, in a liquid of known density (hydrostatic weighing).
One of the difficulties in calibration by Cuckow's method, when the hydrometer is immersed in the liquid of known density, is how to align the desired scale mark of the hydrometer with the liquid surface because of the meniscus formed around the hydrometer stem caused by the surface tension of the liquid. This alignment depends on the skill of the metrologist, giving rise to human errors that have a direct impact in the best estimate and in the uncertainty of the calibration result. Previous work has been done in order to minimize this source of error by means of semi-automated [9] or automated [10,11] systems based on image processing acquisition.
A methodology based on a vision system and image processing algorithm developed at CENAM is proposed to improve both the alignment of the desired scale mark at the same level of the surface liquid, and the resolution of the hydrometer during its calibration. Experimental results show the improvement to the calibration of hydrometers with the vision system alignment method vs. the traditional alignment method, i.e., with the naked eye or with a magnifying glass. Also, key and supplementary international comparisons have been carried out to validate the methodology proposed in this work.

Hydrometer Calibration System
The system that has been developed in CENAM for hydrometers calibration, includes a thermostatic bath with an external temperature controller, a glass vessel to contain the reference liquid, a platinum resistance thermometer to measure the temperature of the liquid, an hygro-thermometer, a barometer to obtain the density of air, and a set of mass standards and a weighing instrument (balance) capable to perform hydrostatic weightings, as can be seen on Figure 1.
Usually, hydrometers are calibrated at three or four graduation marks of the scale and for each of them the correction C ρ n can be calculated as C ρn = ρ x -ρ n , where ρ x is the density of the liquid in which the hydrometer would freely float at the scale mark ρ n [12]. Hence, the measurand in hydrometers calibration is the correction C ρ n [13]. (e) thermometer for measuring the liquid temperature; (f) barometer; (g) thermo-hygrometer; (h) weighing instrument (balance); (i) mass standards.
The mathematical model employed in hydrometer calibration (Cuckow's Method) to obtain x  is: C g gravity correction due to difference in centre of mass.
 d(bal) error due to resolution of the balance.
g/h vertical gravity gradient.
To obtain the mass both in air and in liquid of the hydrometer, the simple substitution method is used; the mass m a for weightings in air, and apparent mass m L , when the hydrometer is immersed in the liquid, are compared against mass standards using the balance as a comparator. The alignment of the desired point of scale mark at the horizontal level of the reference liquid is a difficult task, because the meniscus formed around the hydrometer stem due to the surface tension of the liquid hides the scale mark. The operator performs manually this alignment using a magnifying lens and reading the scale mark below the surface of the liquid, introducing human errors depending on the operator's skill, sight and experience. The contribution to the uncertainty due to repeatability in the apparent mass determination in the liquid m 2 is highly significant.

The Vision System
In order to reduce this human error, the vision system which is shown in Figure 2 was adapted to the actual hydrostatic weighing system consisting of a high resolution (1,300 H × 1,030 V pixels) PULNIX TM-1320-15CL monochromatic CCD camera (Pulnix Imaging Products, Sunnyvale, CA, USA), a lens array, an 8-bits NI-PCI-1428 frame grabber camera link (National Instruments, Austin, TX, USA) and a light source. Also, a glass sinker controlled by a stepper motor was installed to adjust the level of the reference liquid. The level of the liquid will rise (or fall) when the sinker is immersed (or emerged) in the liquid. The motorized-sinker is used for the finest adjustment of the scale mark to the surface of the liquid.  By using the vision system, it is possible to acquire images of the scale mark of the hydrometer at the level of the liquid; the frame grabber converts the images from an analog signal to digital format for future image processing. The camera is located at an angle  below the horizontal level of the y 1

Liquid of known density (Reference liquid)
liquid, as can be seen on the scheme presented on Figure 3, so the target mark L can be seen. The mark of the scale below the target mark A is reflected on the surface of the liquid, so there is a virtual image of marks A and A'. The alignment of L at the surface level is accomplished when the distance in pixels between A and L and that between L and A' is the same at the image plane. However, due to the position of the camera, corrections of these two distances should be made [9]. The marks L, A and A' on the hydrometer scale will be presented later, in the alignment using image processing section. In order to obtain the relation K between the distances from A to L (d 1 ) and form L to A' (d 2 ) a pin-hole camera model approach has been employed as shown in Figure 3. The relation between d 1 and d 2 is as follows: K is obtained by means of the following equation: with: The known values that can be measured are the horizontal distance from the hydrometer stem to the camera (x T ), the vertical distance (y 1 ) between two consecutive marks of the hydrometer (usually the mark to be aligned and the mark below immersed in the liquid), and the vertical distance from the liquid surface to the camera (y 2 ).

Image Processing Algorithm
The step by step procedure of the image processing algorithm developed to perform the alignment of the hydrometer's calibration scale mark at the surface level of the reference liquid is shown in Figure 4.
From I 2 (x,y) the region of interest (ROI), which includes the calibration mark, the mark below the reference mark and its reflection on the surface of the liquid, is selected. Afterwards, a procedure to detect the three marks is applied to a column vector of the ROI, which includes a noise reduction subroutine, where information of pixel position against gray level is relevant. A plot of the data obtained after this procedure shows that each scale mark can be approximate to a second order equation by ordinary least square fitting. The pixel position at maximum gray level for each mark is obtained: p 1 for the pixel position of the mark below the calibration mark, p 2 for the pixel position of the calibration mark, and p 3 for the virtual image (the reflection) of the mark below the reference mark. Then, the distance d 1 and d 2 are calculated using the values p 1 , p 2 and p 3 as follows: with d 1 and d 2 the K relation is calculated. If the calculated K value is not equal to the expected K value, the motorized sinker is used to adjust the liquid level so the value of d 2 changes until the K value is obtained, due to the fact that d 1 remains equal.

Experimental Section
The majority of primary metrology laboratories around the world use the Cuckow method to calibrate the immersion hydrometer, due to the fact that its main advantage is the use of only a standard liquid of known density to calibrate the equipment for any measurement interval.
The procedure described in previous section proposed that an alignment mark in the hydrometer scale can be calibrated utilizing digital image processing, which considers that the criterion values K calc and K meas are equal within a confidence interval.
In case that the alignment doesn't occur, it is necessary to immerse or emerge the hydrometer shaft as required in the reference liquid. This occurs by the use of a "sinker" made of a material which does not react chemically with the reference liquid, because if this occurs its density value could change. To avoid the, the material chosen to fabricate the "sinker" was solid borosilicate. The sinker's dimensions are 172.75 mm long and 177.0 mm in diameter. In addition, the sinker has an eyelet so it can be hung. Figure 5 shows a photograph of the sinker.

Adjustment in the Liquid Level Using a Motorized Sinker
The sinker of Figure 5 is utilized to vary the liquid level by immersion. This solid is held by the grommet with a nylon thread which is wound on the pulley of a stepper motor whose movement is manually controlled using a keypad. To control the stepper motor movement, an open loop controller was implemented in the electronic circuit as shown in the block diagram of Figure 6.  The stepper motor is a brushless synchronous electric motor with the ability to divide a full rotation into a large number of steps. Each step represents a small discrete angular movement. The advantage of this motor is that it can be used for position control without feedback. For controlling movement of the stepper motor a PIC16F84A microcontroller (Microchip Technology, Inc., Chandler, AZ, USA) was selected. This microcontroller satisfies the needs for this application. The microcontroller has two ports that can be configured as either inputs or outputs. For this application five pins of port A were configured as an input and the eight pins of port B were configured as an output.
Both ports handle incoming and outgoing digital Transistor-Transistor Logic (TTL) signals. To send digital signals from the microcontroller, we designed an electronic circuit, which can receive digital signals produced by a keypad (hardware) or by sending digital signals from an acquisition card data (DAQ) installed in a personal computer (PC).
Signals from the keypad are sent to the port A of the microcontroller, which are processed by the algorithm programmed into its memory and making decisions to enable or disable the output signals through the pins of port B.
The output signals of the microcontroller are sent to an L297 integrated circuit (STMicroelectronics, Geneva, Switzerland) which works as a driver or interpreter between microcontroller and the power to move the stepper motor. The L297 has the ability to "translate" the digital input signals in the correct sequence of pulses required to be sent to the power amplifier (L298 and L6210 integrated circuits, STMicroelectronics) to properly energize the motor windings and get their movement.
The L297 circuit has as an additional function of cutting the dual PWM circuit which serves to regulate the current flowing through the motor windings.
The circuit L297 is connected to a L298 integrated circuit, which internally has a dual H-bridge transistors designed for higher voltage and current values of electrical current through their TTL digital inputs, it can handle inductive loads such as solenoids, relays, DC motors and stepper motors. The emitters of the transistors of the lower H-bridge are connected together and the respective output terminal is used for connecting an external resistor to sense the current flowing through the coil (RS1 and RS2). It uses a separate power supply for making that the circuit logic works at a lower DC voltage. It also has two pins to enable operation of each of the H-bridges. So the motor windings are discharged rapidly during the transition from one sequence to the next to energize, it uses a Schottky fast recovery diode array type capable of maintain peak currents up to 2 A, the diode array is encapsulated in the integrated circuit L6210. Figure 7 shows the connection diagram of integrated circuits L297, L298 and L6210 to the motor windings. The stepper motor used to move the sinker is an Applied Motion brand HT17-075 (Applied Motion Products, Watsonville, CA, USA) model with a resolution of 1.8° per step. To carry out the rise and fall of the shaft of the hydrometer immersed in reference liquid, the borosilicate sinker is also immersed in the liquid. The upper end of the sinker is attached through its eyelet with hemp yarn which is wound on a pulley fixed to the shaft of the stepper motor. The motor, when rotated clockwise (CW), causes the sinker go down and soak in the liquid causing the liquid level rise due to the volume of liquid displaced by the sinker gradual immersion, the resulting effect is also the shaft becomes immersed into the liquid. Conversely, when the motor rotates counterclockwise (CCW), the sinker rises and reference fluid emerges causing the fluid level down and making the hydrometer shaft also remove reference fluid.

Experimentation
For the hydrometer calibration, once the mass in the air is measured and the points of the scale to be calibrated are selected, the hydrometer is immersed in the reference liquid. Previously, the fluid temperature is set and control referenced to the same temperature specified in the hydrometer scale. For the immersion in the liquid, the hydrometer is held in the highest part of the shaft, which is fixed to a device that serves as a mechanical suspension whose length can be adjusted manually, then, it can be hanged beneath the weighing pan of the balance. During of immersion of the hydrometer in the reference liquid, it should be avoided getting wet the stem above the first calibration point, which is the lowest point in the scale. It must be left two hours for thermal stabilization before starting the measurements.
After the thermal stabilization period, adjustment in the suspension height must be carried out to manually locate by sight the point of the hydrometer scale at the same level of the liquid. From here, a vision system operates, which is adjusted by zooming and focus to see on the images three interest marks labeled as A, L and A'.
Later, a program acquires an image from the vision system, select the region of interest (ROI) covering the three marks of the hydrometer. Then a column vector is selected at the center of the ROI to detect the marks, and a least squares fitting is performed to fit a parabola of the marks; by doing this, the maximum points of the parabolas select the maximum can be used to measure the distances among them, to get the K meas value and compare it with the K calc value. In case that these values are not equal, the keypad is used to move the sinker immerse in the liquid on the adequate direction to adjust the liquid level, achieving that the d 2 distance change in respect to the position of mark A' (reflection of the mark A of the liquid surface).
To demonstrate the difference in the alignment process using the traditional method against the method with the vision system and the impact it has on the calibration uncertainty, a calibration was conducted with two hydrometers with different metrological characteristics, the first one is a high accuracy hydrometer and the second one is a medium accuracy hydrometer. Both hydrometers are commonly used in the industry for determining the density of liquids and are presented in Figure 8. Both hydrometers were calibrated at the midpoint of the scale, using two methodologies: the traditional calibration method (visual alignment), and calibration by the vision system method (semi-automatic alignment) [10,12].
Traditional calibration. The first calibration was done with the old method, i.e., using a magnifying glass and left to the judgment of metrologist to mark the location of the scale to calibrate the reference surface of the liquid. This procedure is carried out as can be observed on Figure 9. Calibration with the Vision System. The second calibration was performed using the vision system and image processing algorithm explained in previous sections and it can be observed on Figure 10. During the traditional calibration method, images of the hydrometer immersed in reference liquid were taken with the vision system, and once the metrologist considered it under assessment, the calibration mark was aligned to the level of the liquid surface. These images are analyzed using the same algorithm to determine the distances between the marks of interest and get K meas factor value. Tables 1 and 2 show the characteristics of the hydrometers that were calibrated using both methods:  For both high and medium accuracy hydrometers the calibration using the vision system the K calc was determined with the approximation of the system presented in Figure 3, measuring the distances x T , y 1 and y 2 , and using Equations (6)(7)(8)(9)(10). The results are presented in Tables 3 and 4. The K calc values have an associated uncertainty of 0.03 with a coverage factor of k = 2. This value is estimated applying the Guide to the expression of Uncertainty in Measurement (GUM) [14] to the mathematical models of Equations (6)(7)(8)(9)(10) in the pinhole model approach.

Results
In Section 2 was explained that the measurand in hydrometers calibration is the correction in the mark of its scale, C ρ n . Cuckow's method requires two measurements of the hydrometer; the first is the mass determination in air m a , and the second is the mass determination in the liquid m L when the hydrometer is immersed in the reference liquid until the calibration point of its scale.
The results of the measurements made to both hydrometers consider the next parameters: determination of the air mass m a , determination of the liquid mass m L , correction of the calibration scale point C ρ n , its uncertainty u(C ρ n ), and finally the alignment using the proposed image processing algorithm.
The vision system and image processing algorithm developed in this work are used to align the mark on the hydrometer scale at the reference liquid surface during the determination of the mass in the liquid m L .
For calibration of each hydrometer, six AB weighing cycles scheme were performed using the calibrated set of weights and the weighing instrument (balance) as mass comparator to determine the mass in air m a and the mass when the hydrometer is immersed in the liquid reference m L . A represents the mass value of the calibrated weights, and B represents the sample, that is, the hydrometer. The measurements for the determination of the mass in the air for both hydrometers are presented in Table 5. As in the determination of the mass in air, the mass when the hydrometer is immersed in the reference liquid m L is obtained by comparison against standard weights performing six AB weighing cycles. Table 6 presents the measurements performed with the balance to get the m L value and its standard deviation σm L for the high accuracy hydrometer (d = 0.1 kg/m 3 ). On the left side of Table 5, the values obtained with the traditional alignment method are shown, and on the right side, the values obtained with the vision system are shown. For the hydrometer of medium accuracy (d = 0.5 kg/m 3 ) the measurements and results of m L and σm L using both traditional and vision system alignment methods are shown in Table 7. From the measurement it can be seen that for the case of the high-accuracy hydrometer, the standard deviation obtained with the traditional alignment method is approximately 15 times the standard deviation obtained with the alignment method of the vision system and image processing algorithm; in the case of the medium accuracy hydrometer is about 71 times greater.
On Table 8 the results of calibration of the high accuracy hydrometer are presented (d = 0.1 kg/m 3 ) at the pointρ n = 805 kg/m 3 , the values were obtained with both the traditional and the vision system alignment methods.  Table 9 show the results of the calibration with both traditional and vision system alignment methods for the calibration point ρ n = 1,025 kg/m 3 from the medium accuracy hydrometer (d = 0.5 kg/m 3 ).

Uncertainty Budget
As was explained in Section 2, the measurand in the calibration of hydrometers is the correction C ρ n that must be applied to the selected calibration point n  of the hydrometer scale. This correction is obtained using Equation (14): where ρ x is the liquid density where the hydrometer freely float immersed at the mark ρ n , also, the ρ x value is obtained by calibration using the Cuckow's method given by Equation (15): Applying the GUM method [12] (see Equation (18)), the uncertainty of the correction of the hydrometer immersed at the scale mark ρ n is: Due to the fact that ρ n is a constant value (that is a nominal value from the scale point of the hydrometer under calibration, a constant value has no uncertainty) then the correction uncertainty is reduced to: According to the GUM and applying the uncertainty propagation law to the mathematical model of Equation (15), the correction uncertainty is: where: is the sensitivity coefficient of the input quantity x i   i u x is the uncertainty of the input quantity x i The input quantities x i for x  are shown in Figure 11. It can be observed from Figure 11 that the input values depend on other secondary variables like the reference liquid density ρ L , depends on the thermal expansion coefficient of the liquid  L and of the temperature of the liquid t L . Also in Figure 11, the main variables are distinguished with circles and blue font and the secondary variables in circles and black font. Secondary variables are described as: Thermal expansion coefficient of the reference fluid (pentadecane). m pa : Mass of the standards used to determine the air mass in the hydrometer, m a . σm a : Standard deviation of the measurements to get the mass in the air. ρm pa : Density of mass standards used to determine m a Dm pa : Drift of mass standards used to determine m a m pL : Mass of the standards used to obtain the mass in the hydrometer's liquid, m L ρm pL : Mass standards density used in determine m L Dm pL : Drift of mass standards used to determine m L p: Air barometic pressure during the calibration h.r.: Air relative humidity during the calibration The uncertainty contributions  d and σm L are distinguished in green font in Figure 11, those contributions corresponds to the scale division error or hydrometer resolution and also to the standard deviation in the measurements to obtain the mass of the hydrometer immersed in the liquid until the calibration point of the stem ρ n . These contributions are reduced significantly by using the vision system and the calibration mark alignment algorithm introduced in this work. Table 10 shows the  uncertainty budget calibration with the traditional alignment method, and Table 11 shows the uncertainty budget calibration using the vision system method together with the image processing algorithm. Both calibrations were applied to the high accuracy hydrometer (d = 0.1 kg/m 3 ).   The same procedure was applied for the medium accuracy hydrometer (d = 0.5 kg/m 3 ). Results for the uncertainty budget calibration with the traditional alignment method are shown in Table 12. The uncertainty budget calibration using the vision system method together with the image processing algorithm is shown in Table 13.   Tables 10-13, it can be observed that during the calibration of both hydrometers by the traditional method, the alignment "by eye" of the metrologist, at the scale mark of the hydrometer under calibration at the level of the liquid's surface, could not allow us to obtain a better hydrometer resolution, therefore the hydrometer resolution is equal to its scale division. The contribution of the uncertainty by the error due to the resolution ε d is in this case the dominant uncertainty contribution. It follows that if the hydrometer has a larger scale division (which results in a less accurate hydrometer), then the dominant uncertainty of the hydrometer calibration will be limited by its scale division, as long as the alignment process is done "by eye".

Considering the uncertainty budgets shown in
Putting aside the contribution due to the resolution ε d , other dominant sources of uncertainty in the hydrometer calibration with the traditional alignment method are the standard deviation of mass determination in the liquid σm L , the reference liquid surface tension γ L and the density of the reference liquid ρ L .
On the other hand, using the vision system and an image processing algorithm to align the mark on the scale to the liquid level, the uncertainty due to the resolution could decrease, because the vision system provides images of the hydrometer immersed in the liquid of such amplitude that divides the scale significantly by about 10 times or more the hydrometer scale division. In this case, resolution was considered as one tenth of the hydrometer scale division. A smaller value has no impact on the combined uncertainty. Also, the contribution due to the standard deviation of the measurements to obtain the mass in the liquid is reduced significantly because the alignment process is repeatable and reproducible, obtaining values of σm L less than 1 mg while the traditional method (by eye), σm L could take values until 10 mg.

Alignment Using Image Processing
The image processing algorithm to obtain the alignment of the mark in the calibration scale is presented step by step.
Step 1. Image acquisition with the vision system.
Here, the image is 1,026 × 1,288 pixels, whose values are between 0 and 255 (grayscale).
Considering the image in previous step, the image is normalized to take double precision floating point format values between 0 and 1 for the grayscale, as can be seen on Figure 12. Step 3. Negative image.
In this step the negative of the normalized image is obtained, in this way, the scale marks, originally black, are displayed in white. This is to approximate a concave downward parabola. Mathematically, a gray level 0 in the original picture, which represents the black color becomes 1 (white on the inverted image) and vice versa. Each original gray level becomes its complement in the negative. The negative image is shown in Figure 13. Step 4. Search the region of interest ROI.
In this section, we look for the three marks of scale hydrometer immersed in the liquid; these marks are easy to find by locating the ellipse that is adjacent to the hydrometer shaft (this ellipse is the base of the meniscus that the liquid form around the hydrometer shaft), as can be seen on Figure 14. Step 5. Column vector selection.
Here, a column vector is selected. This vector contains the information of the three interest marks, L-A-L'. This vector represents the profile or the gray level of the column vector selected and is shown on Figure 15. The profile which includes the interest marks is plotted on Figure 16.  Step 6. Mark detection.
In this process, the column vector is filtered to eliminate noise and leave the information of the three marks only; this is done by applying an appropriate threshold level to get the column vector without noise (generally 0.5 or 0.6). After applying the vector filtering, the profile which includes only the interest marks is shown on Figure 17.
Step 6.2. Mark separation and least square adjustment of each mark.
Here, each mark is isolated from the filtered column vector to apply the least square adjustment and fit to a second order polynomial, y = a 0 + a 1 x +a 2 x 2 . After the least square adjustment and fitting, the maximum and minimum values of each parabola are determined. In Figure 18  Step 7. Distances d1 and d2 measurement (in pixels).
Once the parabolas and its maximum values are obtained, the distance d 1 is measured (this distance is equal to the distance from the mark A to the mark L), and the distance d 2 (distance from mark A to mark L'). The distances are considered from the maximum points of the parabolas which were obtained from the gray levels of the filtered column vector. The distances d 1 and d 2 are shown on Figure 19.
K calc = 0.96 ± 0.03 (k = 2) (k = 2 represents a confidence level of approximately 95.45% in the uncertainty level from the best estimated K calc value) and K meas = 0.96, therefore, it can be stated that mark A (corresponding to the mark under calibration, ρ n ) is aligned to the same level than the liquid surface, because K meas is inside the confidence interval K calc .
Several tests with its corresponding alignments were carried out, and the summary of the K meas values are shown by applying the traditional alignment method and the vision system method.
The K meas values for each alignment method are compared with the K calc values obtained with the pinhole model approach, for both the high accuracy hydrometer (d = 0.1 kg/m 3 ) as well as the medium accuracy hydrometer (d = 0.5 kg/m 3 ) shown in Tables 1 and 2.

Results and Discussion
From Tables 5 and 6, the values of standard deviation in the determination of the mass in the liquid σm L were 0.12 mg by using the vision system for the alignment of the mark, which in comparison with the traditional alignment system, in the case of the high accuracy hydrometer is 15 times lower, and for the medium accuracy hydrometer is 72 times lower. In the uncertainty budgets the percentage contribution due to this component was reduced from 2.4% to 0.04% in the case of the high accuracy hydrometer calibration (see Tables 10 and 11), and from 21.28% to 0.08% in the case of the medium accuracy hydrometer (see Tables 12 and 13). From the above, it is concluded that the methodology developed in this work to align the mark on the scale calibration of immersion hydrometers at the same level of the surface of the liquid of known density using the vision system and the digital image processing algorithm was able to improve the measurement system, reducing by more than one order the standard uncertainty due to the repeatability of the mass determination in the liquid, m L .
Moreover, the contribution to the uncertainty due to the resolution of the immersion hydrometer was also reduced significantly, since the conventional alignment method and the resolution of the hydrometer is limited to the division of its scale, so the standard uncertainty error due to the resolution ε d is equal to √ , by considering a uniform probability distribution. The hydrometer scale division can be divided into ten units or more, since the amplification of the marks of hydrometer that is achieved with the vision system significantly distinguishes a better resolution compared to the scale division of the hydrometer. For the case of hydrometers calibrated in this work, the contribution to the standard uncertainty due to the resolution of high accuracy hydrometer, whose scale division is 0.1 kg/m 3 , was reduced from 73.32% to a 2.93% (see Tables 10 and 11), while for medium accuracy hydrometer with a scale division equal to 0.5 kg/m 3 , this contribution was reduced from 72.70% to a 10.76% (see Tables 12  and 13).
In the calibration method of alignment by the vision system, the resolution was taken as one tenth of the hydrometer scale division. A smaller value has no significant impact to the combined uncertainty of calibration which could have many effects in the uncertainty budget [15][16][17][18][19].
Since 2004 the automation or semi-automation of hydrometer calibration has been implemented in other national metrology institutes (NMIs), some of them based on image processing techniques [9][10][11]. The methodology exposed in this work is based on the approach of Lorefice and Malengo [9] however the vision system exposed in this work has a better spatial resolution, for example, the CCD camera of [9] is 604 H × 576 V pixels whereas CENAM CCD camera is 1,300 H × 1,030 V pixels. Digital images acquired with CENAM vision system allowed us to reduce the resolution of the hydrometer scale division from d to d/10 or better during the calibration, reducing considerably the uncertainty contribution due to the resolution of hydrometer, this point is not addressed in [9][10][11]. Moreover, the image processing algorithm for the detection of marks, the perspective errors, and the criteria for the alignment of the scale mark under calibration at the level of the surface liquid are different to the approaches of [9][10][11]; for example, Lee et al. [10] performed a binary threshold on the acquired image of the hydrometer stem and the alignment criteria is to locate the scale mark under calibration in line with the major axis of an ellipse that represents the meniscus formed around the stem in the acquired image. Another remarkable difference is the mechanical system employed to align the hydrometer scale mark to the liquid surface: the CENAM system uses a small motorized sinker allowing a well-controlled and soft adjustment of the level of the liquid without turbulence when the sinker is immersed. Other systems perform the adjustment of the mark by moving the whole system: thermostatic bath, the liquid container and CCD camera.
In metrology, it is mandatory to validate either a new measurement method or a modification with an already validated method [20,21]. In order to validate the methodology proposed in this work based on the aligning mark immersion hydrometer scale under calibration with the vision system and the algorithm of digital image processing [22], two international comparisons in the calibration immersion of hydrometers were carried out.
The first international comparison, identified as SIM.M.D-K4 "Comparison on the calibration of density hydrometers", is a key comparison among national metrology institutes that are members of the Inter-American Metrology System (SIM). In this comparison, CENAM was the pilot laboratory. Other participant countries were: Jamaica, Panama, Chile, Bolivia, Peru, Ecuador, Brazil, Argentina, Costa Rica, Uruguay, Colombia, United States of America and Canada [21]. The second international comparison, identified as SIM.M.D-S1. "Comparison of the calibration of hydrometers for liquid density determination (bilateral CENAM-INRIM) Supplementary Inter-American Metrology System Comparison (SIM)", was a bilateral comparison between CENAM-Mexico and Istituto Nazionale di Metrología di Ricerca Metrologica (INRIM)-Italy [23], and was organized to see the degree of equivalence on the hydrometer calibration between both countries. In both international comparisons, CENAM obtained satisfactory results.
Finally, the methodology proposed in this work for the alignment of the calibration scale mark with the vision system and the image processing technique helps to reduce the relative combined uncertainty calibration of hydrometers from 10 −4 to 10 −5 .