IR-camera method to determine urine puddle area in

Ref: C0603
IR-camera method to determine urine puddle area in dairy
cow houses
Dennis Snoek and Peter Groot Koerkamp, Farm Technology Group, Wageningen University,
P.O. box 317, 6700 AH Wageningen
Hans Stigter, Biometris, Wageningen University, P.O. box 100, 6700 AC, Wageningen
Nico Ogink, Wageningen UR Livestock Research, P.O. box 65, 8200 AB, Lelystad
Abstract
Dairy cow houses are a major contributor to ammonia (NH3) emission in many European
countries. A better insight in the emission process is required to develop mitigation measures
to control environmental pollution. To understand and predict NH3 emissions from cubicle
dairy cow houses a mechanistic model was developed and a sensitivity analysis was performed to assess the contribution to NH3 emission of each input variable related to a single
urine puddle. Results showed that NH3 emission was most sensitive for five puddle related
input variables: pH, depth, initial urea concentration, area and temperature. However, cow
house data of these variables are scarce due to a lack of proper measurement methods. In
this study we focussed on a method to quantify the urine puddle area. Our objective was to
assess the urine puddle area on the floor in commercial dairy cow houses with an accuracy
of 0.01 m2, and to develop a measurement method for this variable. In this study we explored
measurement principles and we performed a preliminary experiment. The results were assessed in order to define a measurement method to obtain absolute puddle area and to
compare floor designs in commercial dairy cow houses. We measured 30 water puddles at
an experimental setup and 35 fresh and warm urine puddles at two commercial dairy farms.
Measurements were carried out with a measurement grid and a thermal infrared camera (IRcamera). The IR-images were analysed with vision software. We used IR-images of complete urine puddles directly after urination, since puddle temperature drops quickly to floor
temperature. The centre of a puddle in the image was warm and the temperature gradually
decreased to floor temperature at the edges. It was difficult to distinguish precisely the edges
of a puddle from the floor, because it appeared to be impossible to appoint exactly what was
puddle and what not. We concluded that the measurement grid cannot be used as reference
method. With the IR-camera it was possible to see the puddle. With a threshold value pixels
were appointed to be puddle or not, but to estimate an accurate absolute puddle area the
threshold value has to be validated with a reference. We concluded that we can determine
urine puddle area on the floor in commercial dairy cow houses with an IR-camera and vision
analysis in a very reproducible way. So we can compare puddles and thus floor designs. To
determine an accurate absolute puddle area to use in ammonia emission modelling a validation with good reference is needed. We are confident to obtain an accuracy of 0.01 m2 with
the IR-camera method in future.
Keywords: puddle; area; cow; urine; ammonia
Proceedings International Conference of Agricultural Engineering, Zurich, 06-10.07.2014 – www.eurageng.eu
1/8
1
Introduction
Ammonia (NH3) emission can cause environmental pollution, is a precursor of fine dust particles and is an indirect source of nitrous oxide. To lower NH3 emission a National Emission
Ceiling (NEC) is set for each EU member states. The 2010 NEC set by the European Commission was met by twenty-five of the 27 EU member states, inclusive the Netherlands. Further mitigation of NH3 emission will be necessary in the EU, since the expected NECs set for
2020 will be lower than the NEC 2010. In 2010, 94% of all NH3 emission from the 27 EU
member states originated from agriculture. Of this, livestock production systems were responsible for 80%. In the Netherlands NH3 emission from typical dairy cow houses emits for
about 70% from the slatted floor. A typical house consist of a living area with cubicles, plus
walking and feeding-alleys and a slurry pit underneath the whole house.
To understand and predict NH3 emissions from a dairy cow house a mechanistic model was
developed (Monteny, Schulte, Elzing, & Lamaker, 1998) and a sensitivity analysis was performed to assess the contribution to NH3 emission of each input variable related to a single
urine puddle (Snoek, Ogink, Stigter, & Groot Koerkamp, 2012; 2014). We concluded that NH3
emission was most sensitive for five puddle related input variables: pH, depth, initial urea
concentration, area and temperature. However, cow house data of these variables are
scarce due to a lack of proper measurement methods. In this study we focussed on a method to assess the urine puddle area.
Different methods for quantification of puddle size area have been used in earlier research.
In pens of rearing and fattening pigs trained observers were used to record fouling of the pen
floor by drawing on paper (Aarnink, Berg, Keen, Hoeksma, & Verstegen, 1996). This was
done once a week during the first and second period and twice a week during the third and
fourth period. Daily mean values were used in the analysis. They discussed that their method
was not accurate and that the time of day caused the largest variation. The urine puddle area
can also be determined with a 1 m x 1 m frame or grid with steel bars equally spaced at 0.1
m at right angles (Braam, Smits, Gunnink, & Swierstra, 1997). They determined urine puddle
area on a double-sloped floor in a dairy cow house. Reported areas ranged from 0.89 m2 to
1.23 m2, but no reference was measured and they did not discuss the method. Finally, puddle area on a slatted floor in a pig house was determined by drawing a rectangle around the
wetted top surface and then estimated the wetted part within (Aarnink, Swierstra, Berg, &
Speelman, 1997), but again there was no reference and they did not discuss the method.
The above described quantification methods were tested within this study to use as reference method. Main similarity of these methods was that a puddle was appointed visually by a
person. It appeared to be impossible to distinguish a complete puddle on the floor, especially
droplets and the edges. This was caused by the presence of old puddles; floors were continuously wet and a new puddle cannot be distinguished completely. We concluded that these
methods can only be used at completely dry floors, which was not the case in this study.
Our objective was to assess the urine puddle area on the floor in commercial dairy cow
houses with an accuracy of 0.01 m2, and to develop a measurement method for this variable.
In this study we explored measurement principles and we performed a preliminary experiment. The results were assessed in order to define a measurement method to obtain absolute puddle area and to compare floor designs in commercial dairy cow houses.
First we developed the calibration of the measurement method, second we tested the method with water puddles and finally we applied it in two commercial dairy cow houses.
Proceedings International Conference of Agricultural Engineering, Zurich, 06-10.07.2014 – www.eurageng.eu
2/8
2
2.1
Materials and methods
Thermal infrared camera method
The urine puddle area was measured with a thermal infrared (IR) camera (FLIR SC660) that
can make IR-images of 640x480 pixels, with an accuracy of ± 1°C or ± 1% of reading, given
in one decimal. The camera was mounted on a trolley at a fixed height (1.90 m) and angle
(35°) for easy movement, called the camera-trolley, see Figure 1.
IR-image calibration
To calibrate the real-world area in the IRimages an aluminium rectangle plate of 1.0 m
x 0.6 m and a circle plate with a radius of 0.5
m were used. The dimensions were checked
with a ruler. Before use, a plate was heated
and placed on the floor (Figure 1), and then
we made an IR-image. With use of Labview
Vision Assistant® we executed a ‘point coordinate’s image calibration’ to link pixel coordinates of the corners of the rectangle plate in
the IR-image to real-world coordinates. Then
we determined the area of both plates and
compared it with the actual area, we adjusted
the point calibration if necessary. Finally we
saved the image calibration file to use in the
puddle image analysis (section 2.6).
2.3
1.90 m
2.2
Figure 1. Schematic representation of the thermal
IR-camera at a trolley, with dead weight and aluminium, rectangle plate for calibration in the indicated view.
Puddle start time definition
We defined the puddle start time, t = 0 s, as the moment that a dairy cow finished a urination.
From just before t = 0 to 10 s after this moment we took an IR-image every 1 s. The image at
t = 0 was selected to determine the puddle area.
2.4
Floor types
We used the welfare floor 2 in our experimental setup (Snoek, Haesen, Groot Koerkamp, &
Monteny, 2010) for water puddles and a slatted floor and a grooved floor both in a commercial dairy cow house to test the IR-camera method in practise (Table 1).
Table 1. The used floor types with name, description, groove depth and number of measured puddles.
Name
Description
Groove depth [mm] Puddles [#]
Sloped main grooves middle to sides (1%),
Welfare floor 2
5 - 12 and 5
30
crossing grooves, rectangles (0.08 m x 0.03 m)
Slatted floor
No grooves, levelled slats
19
Grooved floor
Levelled grooves, slats pattern
30
16
2.5
Measurement protocol
To take IR-images of urine puddles among dairy cows we executed the following procedure:
1. Execute camera calibration procedure (section 2.2)
a. Measure temperature and relative humidity at 3 different locations in the dairy cow
house to set the object parameters of the camera.
b. Take IR-images of the two aluminium plates.
2. Take position with the camera (Figure 1) at a safe and strategic location on the floor
among the dairy cows to be able to go quick to varying locations.
Proceedings International Conference of Agricultural Engineering, Zurich, 06-10.07.2014 – www.eurageng.eu
3/8
3. When a cow starts to urinate, decide whether to capture the urine puddle or not and go,
or do not go. Try not to disturb the cows.
4. Press start, stop and save IR-images.
2.6
Image processing
We saved each selected IR-image as a table with temperature values, in which each cell
represented one pixel. Then we converted each table to a grayscale ‘I16’ image with Labview®, of which the pixel value range was set from 0 to 32768 (216/2), representing a temperature range of 0.0°C to 40.0°C, resulting in a pixel step size of 82 per 0.1°C. Then we
determined the puddle area by analysing the I16 images in Labview Vision Assistant® with
the following procedure:
1. Insert calibration file, based on the aluminium plates (section 2.2).
2. Create and execute an ‘Image Mask’ to remove dairy cow legs, if present.
3. Execute a ‘Threshold’ to select the range of pixel values that represent the urine puddle.
4. Execute ‘Particle Analysis’ to display the calibrated real-world area represented by the
selected pixels.
The IR-images obtained at the experimental setup contained background IR-images from
just before the start of each urination. We subtracted these background IR-image from the
IR-image with the puddle prior to step 3 in the above described procedure to get clearer cut
temperature differences on the edges of a puddle.
2.7
Criteria to define absolute puddle area
To estimate real-world puddle area with the IR-camera method we need to know exactly for
each pixel in an image whether this pixel represents the puddle or not. To do this we set a
threshold value for an image, values above this threshold were puddle and below not. To get
correct, absolute puddle area values, the threshold values had to be validated. In this study
we planned to compare the estimated puddle area with the real-world puddle area measured
with a second method. As described in the introduction (section 1) the tested measurement
methods found in literature cannot be used.
3
3.1
Results
IR-image calibration
6
x 10000
Frequency [#]
5
4
3
2
1
23.2
23.4
23.6
23.8
24.0
24.2
24.4
24.6
24.8
25.0
25.2
25.4
25.6
25.8
26.0
26.2
26.4
26.6
26.8
27.0
27.2
27.4
27.6
27.8
28.0
0
Temperature [°C]
Figure 2. Left the IR-image of the rectangle aluminium plate with dots and real-world coordinates in
meters to indicate the ‘point coordinate’s image calibration’. Right the histogram of this IR-image.
Figure 2 shows the grayscale IR-image of the rectangle aluminium plate, with dots and related real-world coordinates in meters to indicate the ‘point coordinate’s image calibration’ on
the left side and the histogram of this IR-image on the right side. With the set coordinates the
software knows what the distances were in between the four points, and there was directly a
correction for the IR-camera angle towards the plate. The histogram shows a clear cut be-
Proceedings International Conference of Agricultural Engineering, Zurich, 06-10.07.2014 – www.eurageng.eu
4/8
tween the background, represented by the left peak, and the aluminium plate, represented by
the right peak. In this example the threshold was set in between the peaks at the mean image temperature of 25.1 °C that resulted in an estimated area of 0.60 m2, which was equal to
the real-world area of 0.60 m2. With the same threshold value, the estimated area of the circle was 0.78 m2, which was almost equal to the real-world area of 0.79 m2.
3.2
Puddle area of water puddles at experimental setup
Figure 3 shows an overview of images of one water puddle on the welfare floor 2, as example. First the original, and related background IR-images in grayscale, then the grayscale IRimage of the outcome of the original minus the background IR-image, followed by three black
and white images from the image processing (section 2.6): a threshold of 1.0°C resulted in a
puddle area of 1.00 m2, 1.5°C = 0.89 m2 and 2.0°C = 0.81 m2. At higher temperatures for the
threshold, fewer pixels were appointed to be urine puddle. For each of the 3 thresholds there
were hardly droplets visible, the sloped main groves were clearly visible (vertical), and the
levelled crossing grooves were only visible at the centre of the floor element. The floor was
clean and levelled, so the water puddle spread equally in all directions.
A: Original IR-image grayscale
B: Background IR-image grayscale
2
D: Threshold = 1.0°C = 1.00 m
2
E: Threshold = 1.5°C = 0.89 m
C: A – B grayscale
2
F: Threshold = 2.0°C = 0.81 m
Figure 3. Overview of images of a urine puddle on the welfare floor 2 on the experimental setup. Image A shows an original IR-image, B the background IR-image and C show A-B, all three converted to
grayscale ‘I16’ format. Images D to F show the outcome of the image processing with a threshold of
1.0, 1.5 and 2.0°C respectively.
Table 2 shows the mean area (m2) of all 30 water puddles on the experimental setup. We
determined the area in the IR-images with three threshold values; threshold of 1.0°C resulted
in an average of 0.99 m2, 1.5°C in 0.87 m2 and 2.0°C in 0.79 m2.
2
Table 2. Mean and SD of the area (m ) of 30 water puddles of approximately 32°C at the experimental
setup determined with a threshold of 1.0°C, 1.5°C and 2.0°C.
2
Area (m )
Threshold
1.0°C
1.5°C
2.0°C
Mean (SD)
0.99 (0.04)
0.87 (0.04)
0.79 (0.03)
3.3
Puddle area of urine puddles in two commercial dairy cow houses
Figure 4 shows an overview of images of one urine puddle on a slatted floor in a commercial
dairy cow house, as example. First the original IR-image in grayscale with Tmin = 19.9°C
(dark) and Tmax = 38.4°C (light), followed by three black and white images from the image
processing (section 2.6): a threshold of 24.0°C resulted in a puddle area of 0.82 m2, 24.5°C =
Proceedings International Conference of Agricultural Engineering, Zurich, 06-10.07.2014 – www.eurageng.eu
5/8
0.70 m2 and 25.0°C = 0.61 m2. At higher temperatures for the threshold, fewer pixels were
appointed to be urine puddle. For each of the 3 thresholds there were droplets visible, but the
number of visible droplets varied. The cow legs in the top left corner were excluded by an
image mask. The dark lines in image A were the openings to the slurry pit underneath the
floor. Each opening was partly obstructed by faeces.
A: Original IR-image
Tmin=19.9°C;Tmax=38.4°C
B: Threshold = 24.0°C
2
= 0.82 m
C: Threshold = 24.5°C
2
= 0.70 m
D: Threshold = 25.0°C
2
= 0.61 m
Figure 4. Overview of images of a urine puddle on a slatted floor in a commercial dairy cow house.
Image A show an original IR-image, converted to grayscale ‘I16’ format. Images B to D show the outcome of the image processing with a threshold of 24.0, 24.5 and 25.0°C respectively.
A: Original IR-image
Tmin=20.5°C;Tmax=32.8°C
B: Threshold = 22.5°C
2
= 1.02 m
C: Threshold = 23.0°C
2
= 0.80 m
D: Threshold = 23.5°C
2
= 0.68 m
Figure 5. Overview of images of a urine puddle on a grooved floor in a commercial dairy cow house.
Image A show an original IR-image, converted to grayscale ‘I16’ format. Images B to D show the outcome of the image processing with a threshold of 22.5, 23.0 and 23.5°C respectively.
Figure 5 shows an overview of images of one urine puddle on a grooved floor in a commercial dairy cow house, as example. First the original IR-image in grayscale with Tmin = 20.5°C
(dark) and Tmax = 32.8°C (light), followed by three black and white images from the image
processing (section 2.6): having a threshold of 22.5°C resulted in a puddle area of 1.02 m2,
23°C = 0.80 m2 and 23.5°C = 0.68 m2. At higher temperatures for the threshold, fewer pixels
were appointed to be urine puddle. For each of the 3 thresholds there were droplets visible,
but the number of visible droplets varied and compared to the images in Figure 4 there were
fewer. The cow legs on the left side were excluded by an image mask, which is visible in image B. The levelled grooves contained fresh and warm urine, represented by the light lines in
image A. Where the urine lines stop, there were drainage points present to transport urine to
the slurry pit underneath the floor. Each groove and drainage point contained faeces, and it
seems that the drainage point in the groove in the middle of image A was completely closed
by faeces, since urine flowed over this point.
4
Discussion
The design of the cow house, especially the presence of selection gates, fences or manure
scraper guidance strips, limited the possibilities to move fast among the dairy cows with the
camera-trolley. In both commercial cow houses a strategic location was found among the
cubicles, but only half of the cow walking area was within reach. So, it was not possible to go
to each urination. However, quite a lot of urinations took place in this area in a day, so it was
possible to collect 35 IR-images of puddles in 2 days.
It was difficult to get near a urinating cow in time or to obtain a good spot towards the puddle,
as most cows were curious about the activities going on and therefore came close by. This
Proceedings International Conference of Agricultural Engineering, Zurich, 06-10.07.2014 – www.eurageng.eu
6/8
resulted in IR-images that contained one or more cow legs that disturbed the view on the
complete urine puddle, as shown in Figure 5. However, this problem was solved when we
worked with two persons, in this case it was possible to keep the cows away from the puddle.
Therefore, we think it is possible to collect IR-images of complete urine puddles in a commercial dairy cow house if at least two persons do the measurements.
At the experimental setup it was easy to obtain a background IR-image, just before the start
of a urination. In a commercial dairy cow house this was impossible since it is unknown on
beforehand where and which cow starts to urinate. However, for three puddles in the commercial cow houses and five at the experimental setup we obtained time series of IR-images
up to 10 minutes. It appeared that the temperature of a puddle dropped to the surrounding
floor temperature within this time period. So, it will be possible to collect an IR-image of the
background rather quick after a urination took place to use in the analysis later on.
In this study we set a fixed threshold value manually for each IR-image of a puddle. To compare puddles the threshold and temperature values has to be the same for each image. For
the aluminium plates and the water puddles at the welfare floor 2 this was the case, taken
into account the small SD in Table 2. These SD values resulted from the slightly varying water temperature values among the puddles and not from the IR-analysis. In case of the slatted and grooved floor in commercial dairy cow houses a comparison was not possible since
temperatures were different among the recorded puddles and a fixed threshold do not represent the correct puddle area within each IR-image. To overcome this problem we could subtract the background image that we can obtain after about 10 minutes as described above to
get similar temperatures in each puddle. Another option would be to obtain the background
temperature directly from the IR-image of a puddle. The background temperature is present
in each corner of an IR-image since a puddle will never fill the whole image. As shown in the
histogram in Figure 2 there may be a clear cut between background and puddle temperatures within one IR-image. An average temperature of for example 20 pixels, or all pixels,
could be determined and together with one or two times the standard deviation this may can
be taken as threshold value. This so called dynamic or automatic threshold method would
make it possible to directly obtain the puddle area from an IR-image without manual adjustments, it would be equal for each puddle, and calibration of the method with a reference
measurement method would be easier.
The tested measurement methods found in literature were not usable to validate the IRcamera method. Another option would be to use so called ground truth images. In these images the value of each pixel is known exactly. In our situation a ground truth image would
contain the exact information whether a pixel represent the puddle or not. However a similar
problem occurred: a pixel have to be appointed visually by a person. A method to overcome
this problem have to be developed. An idea is to use a standard RGB-camera next to the IRcamera in combination with lightning. In this case the puddle will reflect the light and is visible
in the RGB-image and pixels can be appointed.
To obtain precise and accurate temperature values with the IR-camera, the object parameter
settings have to be adjusted. These parameters among others are local air temperature and
relative humidity. Since the puddle temperature was not part of this study we did not include
these object parameters here.
Proceedings International Conference of Agricultural Engineering, Zurich, 06-10.07.2014 – www.eurageng.eu
7/8
5
Conclusions
We conclude that we can determine urine puddle area on the floor in commercial dairy cow
houses with an IR-camera and vision analysis. We developed a very reproducible method,
so we can compare puddles and thus floor designs. The threshold value is the most critical
factor to estimate accurate absolute puddle area values.
To determine an accurate absolute puddle area to use in ammonia emission modelling, additional validation measurements and image analysis are required to correctly appoint a pixel
to be puddle or not. We are confident to obtain an accuracy of 0.01 m2 with the IR-camera
method in future.
6
Acknowledgements
The authors acknowledge the use of the IR-camera of M. Kluivers-Poodt and the two dairy
farmers for access at the floor among the cows.
7
References
Aarnink, A., Berg, A. Van Den, Keen, A., Hoeksma, P., & Verstegen, M. (1996). Effect of
slatted floor area on ammonia emission and on the excretory and lying behaviour of
growing pigs. Journal of Agricultural Engineering Research, 64, 299–310.
Aarnink, A., Swierstra, D., Berg, A. Van Den, & Speelman, L. (1997). Effect of type of slatted
floor and degree of fouling of solid floor on ammonia emission rates from fattening
piggeries. Journal of Agricultural Engineering Research, 66, 93–102.
Braam, C., Smits, M., Gunnink, H., & Swierstra, D. (1997). Ammonia emission from a doublesloped solid floor in a cubicle house for dairy cows. Journal of Agricultural Engineering
Research, 68(4), 375–386.
Monteny, G., Schulte, D., Elzing, A., & Lamaker, E. (1998). A conceptual mechanistic model
for the ammonia emissions from free stall cubicle dairy cow houses. Transactions of the
American Society of Agricultural Engineers, 41(1), 193–201.
Snoek, D., Haesen, G., Groot Koerkamp, P., & Monteny, G. (2010). Effect of floor design in a
dairy cow house on ammonia emission - design, test and preliminary results with an
experimental set-up for run off experiments. In International Conference on Agricultural
Engineering. Clermont-Ferrand, France: Cemagref.
Snoek, D., Ogink, N., Stigter, J., & Groot Koerkamp, P. (2012). Sensitivity Analysis of a
Mechanistic Model for the Ammonia Emission of Dairy Cow Houses. In 2012 IX
International Livestock Environment Symposium (ILES IX). Valencia, Spain.
Snoek, D., Stigter, J., Ogink, N., & Groot Koerkamp, P. (2014). Sensitivity analysis of
mechanistic models for estimating ammonia emission from dairy cow urine puddles.
Biosystems Engineering, 121, 12–24. doi:10.1016/j.biosystemseng.2014.02.003
Proceedings International Conference of Agricultural Engineering, Zurich, 06-10.07.2014 – www.eurageng.eu
8/8