Interactive comment on “ Automatic cloud top height determination using a cost-effective time-lapse camera system ”

Introduction Conclusions References Tables Figures


Introduction
Cloud forests are forest types the ecology of which is strongly affected by the frequent occurrence of ground fog (Bruijnzeel et al., 2011).Since they are often hard to access due to their location in mountainous areas, the mapping of cloud forest is difficult in many aspects.An appropriate method for mapping efforts is, however, satellite-borne remote sensing.Mulligan (2010) has shown that satellite derived ground fog frequency maps can be used to distinguish between cloud forest and other forest types by the simple application of a frequency threshold.
Different existing approaches for ground fog detection from the imagery of geostationary (GEO) and low earth orbit (LEO) satellite platforms do exist (cf.Cermak and Bendix (2011) for a GEO approach and Welch et al. (2008) for a LEO approach).In most cases they calculate the cloud base height (z CB ) for each pixel of an image and compare this value to the terrain height of the pixel (z DEM ) taken from a digital elevation model (DEM).If z DEM is equal to or below z CB , a pixel is considered as foggy because the cloud is assumed to touch the ground and consequently reduces the horizontal vis- Organization , 1992).z CB is calculated by subtracting the cloud geometrical thickness (∆z) from the cloud top height (z CT ) (cf.Fig. 1).However, the calculation of z CT , which is usually done based on the cloud top temperature under the assumption of a certain atmospheric profile, is still causing some problems regarding its precision (cf.Marchand et al. (2010) for a review).State-of-the-art methods for the retrieval of the cloud thickness and therefore of the cloud base height, for instance the one proposed by Cermak and Bendix (2011), are imposing even more uncertainties.This results in a distinction of foggy pixels that is far away from perfect.To overcome these problems an extensive validation of z CT and z CB values used in future fog detection algorithms will be helpful.
Typical data that can be used for this purpose are those of visibility sensors, ceilometers, and cloud radar devices.The data of visibility sensors, however, is of low informative value since it can only be used to decide whether a distinct point in space is immersed into clouds or not.Ceilometers and radar devices are expensive and thus, generally not available in remote areas like mountain cloud forests.This lack of cloud height data in remote regions is also an issue if it is needed for preliminary studies conducted to design a ground fog detection scheme that shall be used to map fog frequencies.If the inter-diurnal dynamic of cloud heights is high, the ground fog detection should be based on GEO data to prevent the resulting cloud frequency map from being heavily biased by the low temporal sampling rate of LEO satellites.Especially in complex terrain, however, the maps could strongly benefit from the high spatial resolution of LEO data.Therefore cloud top and base height data measured with a high temporal sampling rate directly in an investigation area is necessary as a base for solid decision making, whether to use GEO or LEO data for mapping purposes.Nair et al. (2008) and Welch et al. (2008) compared different approaches for the computation of cloud base heights from MODIS data and used them to map cloud immersion frequencies in their study area in the Costa Rican mountains.Because of the mentioned problems a comprehensive validation of the different approaches was performed using ceilometer data from US airports located in relatively flat terrain only.It is obvious that the validity of such an approach that transfers the validation results Figures from flat terrain in the US to complex terrain in tropical regions is limited.A validation in the study area itself was only possible on a much smaller scale: photos from cloud immersed mountains in the study area were taken and used to estimate the height of the intersection between the cloud base and the terrain based on expert knowledge about the area as well as GPS positions of visually prominent features.Due to this non-automatic approach only a small number of photos could be incorporated into the validation, the significance of which is therefore decreased.The necessity of manual evaluation of the photos makes the approach hardly applicable for any comprehensive statistical investigation as the mentioned preliminary studies for the design of ground fog mapping techniques.The authors have, however, stressed the suitability of camera footage for cloud height determination.
A semi-automated approach presented by Bendix et al. (2008) detects clouds in webcam footage by applying manually defined brightness thresholds on the images.The resulting cloud masks are compared to a digital elevation model (DEM) projected to the camera view so that z CT and z CB can easily be determined.This simple approach is not suited for complex lighting conditions and viewing geometries that entail greatly varying viewing distances to the different image pixels (cf.Sect.4.2.3).Although it still needs human interference, it shows the potential for further automation.
The aim of this paper is to develop and validate a cost-effective, fully automated method for z CT and z CB determination from camera footage in a cloud forest area of Taiwan.The method (cf.Sect.4) has been developed to be in principle suited for z CT as well as z CB depending on the position of the camera.For the current study the camera was placed above a frequently occurring cloud layer (cf.Sect.2).Therefore the method will be demonstrated for the cloud top height.Results will be presented in Sect. 5 and discussed in Sect.6. Figures

Back Close
Full 2 Study area and camera setup

Study area
The Taroko Gorge located in Eastern Taiwan is famous for a frequently (almost daily) occurring sea of clouds, which can be observed from higher terrain and is therefore well suited for cloud top height determination.Since cloud forest is present on the slopes of the gorge, the frequency of ground fog will be mapped using satellite data in a future study.Therefore the area is ideally suited to test a technique that can be used to design and validate methods for ground fog retrieval from satellite data.The area is accessible via roads but due to its sparse population electric power is not available in most parts.Since the terrain is mostly steep and therefore hardly accessible, only some places (mostly near roads) can be considered as suited for the installation of the cameras used for our cloud top height determination approach.

Camera setup
Two cameras of the type PlotWatcher Pro (Day 6 Outdoors, LLC, USA) were installed near the western end of the Taroko Gorge (cf.Fig. 2).The PlotWatcher Pro is usually used to observe game animals but it is also well suited for cloud top height determination purposes.The waterproof housing and a battery powered operation mode allow the installation independent of any infrastructure.Due to its construction the camera can easily be mounted on any pole.In our case, traffic sign posts were used.After setup the camera automatically takes images in an adjustable time interval for a given time span each day.The footage is saved to a SD card.The positions of the cameras were taken from differential GPS measurements.Their viewing directions were roughly determined using a compass.
The camera used for the determination of z CT (further referred to as main cam) was installed at 24  it oversees the gorge (cf.Fig. 3).The clouds usually form in different heights below the camera location, but sometimes the camera itself is immersed into clouds.
Another camera (further referred to as validation cam) is installed at 24 • 10 46.64 N, 121 • 21 33.95 E on the northern slope of the gorge.The validation cam is located at a height of 2377 m, that is much more often cloud immersed than the main cam height.Its location can be seen from the main cam viewpoint.The camera is facing northwestwards onto the valley slope.Because of a small recess in the slope (red line in Fig. 2) its viewing axis intersects the terrain in a distance of about 200 m.The validation cam is used to check whether its position is cloud immersed or not.The footage is needed to validate the cloud top heights derived from the main cam footage (cf.Sect.4.3.1).
Both cameras in the Taroko Gorge were set up to take pictures from 05:00 to 19:00 UTC + 8 each day in 1 min intervals (resulting in 840 captured frames each day).With these settings they can operate autonomously for several months until the batteries and SD cards need to be replaced.

Data
In this study camera footage from 14 March 2013 to 3 May 2013 has been used.For each day the cameras create a separate video file in a resolution of 1280 × 720 pixel.The video files are saved in 8 bit RGB color space ranging from 0 to 255.The footage is largely free of image distortions and can therefore be used without further image calibration (cf.Sect.4.1).An example image of the main cam is shown in Fig. 4.
The only data used in addition to the camera footage is the ASTER Global Digital Elevation Model (property of METI and NASA) as distributed via the USGS global data explorer (United States Geological Survey, 2013).The DEM has a horizontal resolution of 30 m per pixel and the 95 % confidence interval for the vertical accuracy is 20 m (Tachikawa and Hato, 2011)

Check for image distortions
The existence of image distortions in the PlotWatcher Pro footage was tested by taking pictures of checkerboard patterns and measuring the straightness of the lines between the rows and columns in an image editing software.Although the image distortion never exceeded about 2 pixels, a camera calibration as described in Zhang ( 2009) and implemented by Abeles (2012) has been performed for testing purposes.Since the calibration did not further enhance the straightness of the lines, the image is used without any image calibration.

Workflow for the retrieval of z CT
The basic idea of Bendix et al. ( 2008) is adopted in our approach: the DEM is reprojected to the view and resolution of the main cam (cf.Fig. 4, upper left) so that the height of the contact points between the cloud surface and the terrain (further referred to as cloud tops, cf.Fig. 1) that have been detected in the camera image can be read from the corresponding pixels of the DEM.The new approach should, unlike the method by Bendix et al. (2008), be suitable for batch processing.Therefore several video files (each consisting of 840 frames) need to be processed without human intervention.This higher degree of automation entails a more complex workflow (cf.Fig. 5).It also increases the computation time.Therefore each PlotWatcher Pro video that is used as input is split into groups of five successive frames (further referred to as "scene").For each group the mean image is calculated.The analysis of each video is performed on the base of these mean images instead of single frames.Therefore the output of the presented workflow are z CT values in a temporal resolution of 5 min.Scenes are discarded if the location of the main cam itself is cloudy (this results in a undifferentiated image.Therefore the coefficient of variation of the brightness of all pixels below the horizon of the projected DEM is below 0.8 for each color channel) or Figures

Back Close
Full the image is too dark to be analyzed (mean brightness of all pixels below the horizon is below 25).Otherwise the image analysis algorithm delineated in Sect.4.2.3 is used to detect cloud tops in the main cam imagery.The projection of the DEM to the camera perspective and other input derived from the DEM that is used for the image analysis as well as input that is derived from the mean image are described in Sects.4.2.1 and 4.2.2, respectively.

Input derived from the DEM
The projection of the DEM to the main cam view accounts for the curvature of earth.It is conducted under the assumption of a perfectly round geoid with a radius of 6370 km.
The reprojected DEM contains information about the distance to the camera calculated using Jcoord (Stott, 2006) and the terrain height for each pixel.The projection is performed using a virtual camera that is defined by the parameters position (longitude, latitude and height), orientation (rotation around the x, y and z axis) and its focal length.Ideally the parameters of the virtual camera would match those of the real main cam.While the position of the real camera is known from the GPS measurements (cf.Sect.2.2) with high precision, the rotation is based on the much more imprecise compass readings in the field.Therefore an interactive tool was written that allows to initially fine adjust the rotation of the virtual camera manually by using the main cam footage as an overlay over the reprojected DEM.
The rotation as well as the focal length of the real world main cam have, however, proven not to be stable over time.The footage shows that they change over the day depending on the sun position.This is most probably caused by thermal extension of the camera body.Additionally the camera could be slightly rotated when the SD card or batteries are replaced.To overcome these problems the virtual camera is automatically readjusted every 24th scene of the camera footage (this corresponds to a time span of Introduction

Conclusions References
Tables Figures

Back Close
Full regularly performed automatic adjustments the horizon in the real world camera image should always be located in the buffer area.For each column of pixels in the buffer the differences (euclidean distances in RGB color space) between every two pixels with a vertical distance of 3 pixels to each other is calculated.The ratio between the maximum value (which is high if the horizon is visible) and the mean value (which accounts for image characteristics as image noise and texture that are also affecting the maximum value) of these differences is calculated for each column and averaged over the whole buffer.If this value exceeds an empirically derived threshold of 6.4, the scene is regarded as usable for camera adjustment.Otherwise, the next suited scene is used.
To adjust the camera the fit between the virtual horizon and the horizon in the mean image is calculated.This is done based on an edge image that is generated from the mean image by calculating the sum of the euclidean distances in RGB space for each pixel to its neighboring pixels.For all N pixels p i of the virtual horizon the sum s i of all edge image pixel values ep xy in a 10 × 10 pixels window surrounding p i (with x, y ranging from −5, −5 to 5, 5) weighted by the reciprocal value of the distance to p i is calculated.The fit is then calculated as the average of all s i .fit The actual camera adjustment is done using an iterative algorithm: the virtual camera is rotated clockwise as well as counterclockwise around each of its three axes one after another by 0.05 • .Afterwards also the focal length is increased and decreased.The DEM reprojected to the view of the correctly adjusted virtual camera serves as an input for the image analysis that is used to determine z CT .Other inputs entirely or partially derived from the reprojected DEM are: -A mask (white area in Fig. 6, blue areas in Fig. 3) marks the areas of the camera footage that are not used for z CT determination.These areas include sky, foreground objects that are included in a manually created JPEG image, terrain with a distance of more than 10 km to the main cam and areas that are in a vertical buffer of 10 pixels around distinctive edges in the terrain.Edges in the terrain are defined as areas where the distance of a pixel of the reprojected DEM to its upper neighboring pixel exceeds a threshold of 400 (northern slope) or 200 (southern slope) meters (both thresholds are empirically determined).These edges could adulterate values for z CT since a small misfit of the virtual camera parameters could drastically influence the height that is attached to a main cam pixel in these areas.Also they could be mistakenly considered as cloud edges in the image analysis.
All other input images are calculated for areas that are not masked out only.
-The slope image is used to separate between the northern (greenish in Fig. 6) and the southern slope of the valley (reddish in Fig. 6).It is calculated by identifying the pixel with the lowest height of each row of pixels in the reprojected DEM.Every visible DEM pixel left of the lowest height pixel is marked as northern slope, every pixel right of it is marked as southern slope.This very simple approach needs to be corrected in order to achieve valid results by removing isolated islands with a bounding box size of less than 30×30 pixels of southern slope pixels surrounded by northern slope pixels and vice versa. of the slopes as seen from the camera as far as possible.In other words: it helps to prevent the view to each segment from being cutoff in some heights by terrain that is nearer to the camera.A fine segmentation as shown in Fig. 6 as well as a coarse segmentation with a drastically decreased number of classes (6 per slope) are performed to obtain both segment images.
-The height interval image is created by subdividing the DEM into several height classes of each 5 m.
-The combination of the height interval image and the fine segment image is further referred to as the DEM section image.It separates the DEM into several small sections, each of which is the intersection of a fine segment and a height interval.

Input derived from the main cam footage
Inputs for the image analysis algorithm derived from the main cam footage are the mean image for the current scene as well as a movement image.The movement image (which is for the sake of computational time calculated in a resolution that is degenerated by the factor of 4 in each dimension) shows the difference between the five frames a scene consists of.For the latter four of these five images the difference measured in terms of the euclidean distance in RGB space to the previous frame is calculated for each pixel.The movement image is the mean of the four difference images.Before the difference image can be calculated the latter four frames are histogram matched (Burger and Burge, 2008)  The SD images contain for each pixel p i the standard deviation of the pixel values in a vertical 1 × 40 pixel window surrounding p i .

Image analysis for the derivation of z CT
With the input described in Sects.4.2.1 and 4.2.2 the image analysis algorithm for the derivation of z CT is driven.
A simple threshold approach as used by Bendix et al. ( 2008) is not suited for this purpose.Despite the fact that it is only partially automated and therefore could not handle the amount of scenes the main cam produces over time, the viewing geometry in the Taroko Gorge is too complex to detect clouds by simply applying a brightness threshold.Since the nearest pixels of the mean image that are not masked out have a distance of about 2.5 km to the main cam while the furthest pixels are about 10 km away, the atmospheric signal that influences the pixel colors is greatly varying.As seen in Fig. 4 terrain generally appears to be darker than clouds.If the two pixels marked with the arrows are compared to each other, it becomes apparent that this is an optical illusion.The pixel denoted by 1 has a color value of (R: 137, G: 140, B: 149) while pixel 2, which is much nearer to the camera, has a color value of (R: 121, G: 126, B: 129).Obviously the distance depended influence of mist prevents a simple separation of fog and terrain based on one global brightness threshold for the whole image.This is the reason why the segmentation of the terrain into several distance classes (cf.Sect.4.2.1) is conducted.A valid separation based on thresholds, however, is not possible, even if in each segment an individual threshold is applied.This is caused by the fact that the sea of clouds often is illuminated irregularly due to its complex surface structure (this is especially of importance if the sun is low) as well as shadows of overlying cloud layers.These local differentiations in the brightness are not distant dependent.Thus, the problems they cause for a threshold approach cannot be overcome by segmenting the image into distance classes.Additionally the pixel colors of the terrain (e.g.green under sunny, conditions, dark gray under overcast conditions) and the Introduction

Conclusions References
Tables Figures

Back Close
Full clouds (e.g.white if the sun is high, reddish if the sun is low) are greatly varying over time, which would also complicate the application of thresholds.
The algorithm used instead is based on the idea that, in spite of small scale variations caused by lighting conditions etc., the mean pixel value of different input images (mean image (R, G and B channel), movement image and SD images of those images; cf.Section 4.2.1)differs between the cloudy part of a fine segment and the non-cloudy terrain.Therefore for each DEM section and each mentioned input image the difference between all pixels above and all pixels below or in the DEM section is calculated.The resulting differences are: diff R , diff G and diff B .These values contain the color difference between the pixels above and below the DEM section.They are high for cloud tops since clouds are overall brighter than terrain.
diff SD(R) , diff SD(G) and diff SD(B) can be considered as simple measures for texture differences between the area above and below a DEM section.Their absolute values are high for cloud tops due to texture differences between clouds and terrain.
diff movement and diff SD(movement) account for the degree and structure of movement that is much higher in cloudy areas than for the terrain.Therefore these values are also high in the peripheral area of clouds.
All these differences are non-local and therefore hardly disturbed by small scale variations in the input images.In addition the following local variables are calculated for each DEM section: mov local is the average movement at a distinct height level.It is high where the cloud surface is touching the terrain due to the billowing movement of clouds.Introduction

Conclusions References
Tables Figures

Back Close
Full and is high for height intervals that contain a cloud edge as well as for other edges in the image.
The local variables are high in the height of z CT as well as in some other areas of the image.Also the non-local differences are not necessarily high in cloud top areas only but all local and non-local variables have in common that their absolute value is high at least in DEM sections at z CT .Therefore the absolute values of all variables are combined to their geometric mean for each DEM section.Since its calculation involves multiplying all input variables, a high geometric mean is particularly obtained for the edges between clouds and terrain where each of the mentioned variables is high.Therefore the geometric mean is further referred to as edge value.It is calculated for each pixel that is not masked out.Since cloud tops are less distinct in distant terrain and therefore most edge values cannot be compared to each other, the standard score of the edge value is calculated for different distance classes.The result (further referred to as edge value z ) is shown in Fig. 7 for a scene that includes the frame shown in Fig. 4. The standardization is done on base of the coarse segments as many fine segments do no cover the whole height of a slope, and hence some of them would be entirely situated above or below z CT .Low edge values that are not caused by cloud tops would be exaggerated in these segments after standardization.
For each slope the height interval with the highest median of the edge value z is calculated.This height (red line in Fig. 7) can be considered as the mean z CT for each slope (further referred to as z CT slope ).This is, however, only true if clouds are present and if the maximum of the edge value in the corresponding height is actually caused Introduction

Conclusions References
Tables Figures

Back Close
Full by the cloud top instead of the cloud base.The latter is tested for each fine segment of the image using the absolute values of diff R , diff G and diff B .If more than 50 % of the fine segments of one slope are brighter (this means at least 2 of 3 color channels are brighter) below z CT slope than above this height, it is actually accepted as the height of the cloud top surface.Otherwise z CT slope is the height with the next highest median of the edge value for which more than 50 % of the fine segments are brighter below.If such a height does not exist, the slope is marked as cloudless.
Since the surface of the sea of clouds is more or less plain, for each fine segments the cloud top should be near to z CT slope .Therefore z CT for each fine segment (further referred to as z CT segment ) is assumed to be located inside a height interval around z CT slope (dashed line in Fig. 7).The more even the cloud surface is the smaller is this interval.For each slope its size is calculated from the root-mean-square deviation (RMSD) of the height of all N DEM sections to z CT slope .In the calculation of the RMSD the height distance of each DEM section to z CT slope is weighted by its edge value z : The weighted RMSD times 1.2 has proven to be a good size for the height interval in which z CT segment is determined.Fine segments that are not reaching z CT slope may also not reach their z CT segment .Therefore they are excluded from further analysis.Also the 1.2 RMSD interval may not necessarily contain the cloud top of each fine segment.z CT segment would be detected in a wrong height in these cases.Therefore the validity of each z CT segment is checked individually by using a linear regression between the height distance of the DEM sections of the associated fine segment to z CT segment and the image brightness (mean value of the R, G and B channel standardized on a fine segments base).This Figures

Back Close
Full regression is carried out for DEM sections that are located in a RMSD times 1.2 height interval around z CT segment only.Since clouds are overall brighter than non cloud covered terrain (if analyzed for each fine segment separately), fine segments for which the slope of the regression is above an empirically derived value of −0.01 standard deviations per height meter most probably do not contain cloud tops inside the 1.2 RMSD interval.For all other fine segments the height inside the interval around z CT slope with the highest edge value z is marked as the preliminary result for z CT segment .
In the calculation of z CT slope and the preliminary results for z CT segment the absolute (not standardized) edge value has not been respected.Therefore it is unclear if the detected edges are distinct enough to be cloud tops.In the absence of clouds they could also be any edge in the terrain.Consequently for each valley slope the validity of the detected edges as cloud top indicators is tested.For heights that are located in a RMSD times 1.2 interval around the preliminary z CT segment of each associated fine segment a linear regression between the height distance of each DEM segment to the corresponding preliminary z CT segment and the image brightness (mean value of the nonstandardized R, G and B channel) is performed.If the absolute value of the regression slope is above an empirically determined threshold of 0.1 per height meter, the edge can be considered as distinct enough to be a cloud top.Otherwise the corresponding valley slope is most probably not cloudy and therefore excluded from further analysis.
Every test described above is performed under the assumption that clouds in the Taroko Gorge occur as a more or less stratiform sea of clouds or do at least touch the terrain.In these cases it is valid to read the height and position of cloud tops that have been identified in the two-dimensional mean image from the three-dimensional reprojected DEM.In other cases this method would cause wrong results for z CT .Therefore scenes with a horizontal distance of less than 1 km between the two detected cloud tops that have the greatest distance to each other are classified as not applicable for further use.
For usable scenes the detected cloud top positions are marked in the mean images (cf.Fig. 8) and/or written to a CSV file for each scene of a video file.These CSV Figures

Back Close
Full files contain the heights as well as the geographical location of all detected cloud top positions and may be further processed in different ways.In this study the z CT values were spatially interpolated using inverse distance weighting (IDW) with an exponent of 2 (Shepard, 1968).The interpolation was conducted for the area of the bounding box of all detected cloud top positions (cf.Sect.5).

Adaptation of the method for the derivation of z CB
For the detection of z CB instead of z CT some minor changes in the method presented in Sect.4.2.3 are necessary.In detail these adaptations are: -The non-local difference values for each DEM section need to be calculated between all pixels below the section and all pixel in or above the section.
diff local needs to be calculated as follows: -While for each detected z CT slope a test is performed to check whether it is actually a cloud top height, for each z CB slope it has to be tested if it is the cloud base height.This is done by checking if more than 50 % of the fine segments of the corresponding slope are brighter above z CT slope than below this height.
-For the validity check of each z CB segment a threshold of 0.01 per height meter (instead of −0.01 per height meter for z CT segment ) has to be used on the slope of the regression.

Validation
Cloud top heights derived from daily camera footage taken between 14 March and 3 May 2013 were used to validate the method for cloud top height determination presented in Sect.4.2.This corresponds to a total number of 8400 scenes.For each of Introduction

Conclusions References
Tables Figures

Back Close
Full these scenes the cloud top positions were calculated and validated using two different approaches.This was done by summarizing the validation results in a confusion matrix for each validation approach.From these matrices the following statistical measures (Jollife and Stephenson, 2003) were calculated (see Appendix A for formulas): proportion correct (PC) bias

Validation using the validation cam
An automated validation of the cloud top positions that were calculated for each of the 8400 scenes has been performed using the approach shown in Fig. 9. Scenes that have been discarded as not usable for cloud top determination by the method described in Sect.4.2 are also excluded from the validation.For the remaining scenes it correspond to the current scene of the main cam is analyzed.In a first step it is checked if at least one frame is too dark for further analysis (mean brightness of the mean of all 3 color channels < 40).In these cases the whole scene is excluded from the validation.For usable scenes it is checked if the validation cam is cloud immersed in at least 3 of 5 frames of the scene.If this is the case, it is regarded as cloud immersed for the whole scene.
Depending on the height of the interpolated value for z CT (below or above the validation cam height?) and the information from the validation cam footage (cloud immersed or not?) each scene is registered as a "true positive", "true negative", "false positive" or " false negative" in the confusion matrix.This is done under the assumption (which is based on the manual analysis of several scenes as well as field studies) that the sea of clouds is thick enough too ensure that the validation cam is cloud immersed if it is located below z CT .
The test if the validation cam is immersed into clouds is based on the contrast in its image.As Fig. 10 shows, the contrast is low in parts where the view is obstructed by clouds, while it is high in areas where the image shows vegetation on the valley slope.Since nearby vegetation causing high contrasts is visible even under cloud immersed conditions, a tests for low contrast cannot be performed on the whole image.The vegetation cannot be masked out as it grows over the year and moves in the wind.The image is separated into boxes of 30 × 30 pixels instead (two of which are exemplarily marked in Fig. 10).For each of these boxes the coefficient of variation (c v ) is calculated for the red, the green and the blue channel.The maximum c v max of these three values is determined and the sum is calculated for all N boxes for which c v max is below an empirical threshold of 0.03.As c v max is low for boxes with a cloud obstructed view due to their low image contrast, s is Introduction

Conclusions References
Tables Figures

Back Close
Full high under cloudy conditions.Above a threshold of 0.5 the validation cam is regarded to be cloud immersed.The results of this analysis were manually verified.For a time span of 10 days (14 March to 3 May 2013) each scene of the validation cam footage was visually checked for cloud immersion.Discrepancies between the visual analysis and the algorithm's result did not occur.
The validation cam based approach does consider only one point in space, namely the validation cam position.Therefore it would not be known if clouds are completely absent or merely below the camera for scenes in which the validation cam image does not show cloud immersion.Hence, the over-and underestimation of cloud occurrence cannot be reasonably be derived from the validation cam footage.This is the reason why all scenes that were excluded from the cloud top height determination need to be excluded from the validation too.After this exclusion the validation results can be interpreted as the answer to the question if the top height of clouds is derived correctly if they have been detected.

Visual validation
Since the automatized validation has been performed under the assumption of correctly determined cloud presence a second, visual, approach has been conducted.10 % of the 8400 main cam scenes were randomly chosen and detected cloud top heights that were marked as shown in Fig. 8 were manually assessed.Only night scenes and scenes in which the main cam was cloud immersed were excluded from the analysis.The scenes were added to the confusion matrix as follows: -Cloud tops are present in the detection area (green area in Fig. 3).They were detected at the correct position: true positives.
-No cloud tops in the detection area.Therefore no cloud tops were detected: true negatives.Introduction

Conclusions References
Tables Figures

Back Close
Full Or: cloud tops are present and were detected, but they were detected in the wrong height: false positives.
-Cloud tops are present in the detection area but they were not detected: false negative.
The disadvantages of this manual validation approach are the decreased number of scenes that could be included as well the fact that it has been carried out on the base of two-dimensional images.Therefore it does not provide any information whether the height determination of the cloud tops detected in 2-D images using the threedimensional terrain is valid.

Results
An example output of the cloud top height determination algorithm is shown in by clouds (red areas) were correctly detected.The data gap between about 06:30 to 08:15 is caused by cloud tops that are too low to be detected.The algorithm also works for more complex lighting conditions (cf.Fig. 13) and -as long as the clouds are touching the terrain -in situations with a shattered cloud cover (cf.Fig. 14).

Validation results
Table 1 shows the result of the validation based on the validation cam footage.The PC calculated from this matrix is 0.9544.It is the only statistical measure described in Sect.4.3 that can be interpreted in a meaningful way for the validation cam approach.
The results of the visual validation are shown in Tables 2 and 3.These results show that the presence and absence as well as the height cloud tops in the two-dimensional camera footage was correctly determined in 87.56 % of the scenes (PC) while the frequency of cloud tops in the area of detection was slightly underestimated in general (bias).Cloud tops were detected in 82.02 % of the scenes in which cloud tops were present (POD) and in 8.14 % of the cloudless scenes.This corresponds to about 11.34 % of the determined cloud tops being mistakenly detected (FAR).

Discussion and conclusion
The results of the visual validation can be regarded as promising.The accuracy, the HKD and the POD are quite high and the POD and FAR are low.The Bias shows that the cloud frequency is only slightly underestimated.A method that is designed to provide validation data for another method should, however, be as near to perfect as possible.Due to the fact that the intended use of the presented method is the validation of a satellite algorithm this is not problematic at all.The presence or absence of clouds can already be determined from satellite data with a high degree of certainty (Reuter et al., 2009).For a fog detection algorithm thus only the cloud height retrieval and not Introduction

Conclusions References
Tables Figures

Back Close
Full the cloud detection needs to be validated.This can be done for periods of time in which clouds were detected by the satellite algorithm as well as the camera approach.False positives and false negatives of the camera approach would not be used.
The ability of the presented approach to determine the cloud top height for cases in which the presence of clouds is known was shown using the validation cam approach and can be regarded as very good.The detection of cloud top positions in the 2-D image as well as the projection onto the three-dimensional DEM work well for the camera location in the Taroko Gorge.
Since a valid cloud height determination depends on clouds touching the terrain, the approach does only work for selected locations, ideally with frequently occurring sea of cloud conditions.Since several thresholds used in the cloud height determination process have been derived empirically for the location in the Taroko Gorge and also the segmentation of the terrain into slopes and segments has been custom tailored to the view of the main cam, an adaptation of the algorithm to the footage of cameras on other positions would be necessary.The adaptation to the footage of cameras below the cloud base that are used to derive z CB (cf.Sect.4.2.4) could cause problems since cloud bases are often blurry.
For suited locations above the cloud top height, however, the presented method supplies data that is applicable for the design and validation of satellite algorithms for ground fog detection.The method is cheap and easy to setup, even in terrain that is difficult to access as it often is the case for cloud forest areas.It provides continuous daytime data in a temporal resolution of 5 min over several months without the need of maintenance.The data analysis is fully automated.While other techniques observe only one column of the atmosphere or one point in space, the newly developed method does provide data for a whole valley.This gives the opportunity to validate satellite derived cloud tops heights using interpolated z CT values for several positions all over a pixel of the satellite image.An extrapolation of one single point in space to a whole pixel is less valid than this procedure, especially for the low resolution imagery of GEO satellites.Introduction

Conclusions References
Tables Figures

Back Close
Full  Full  Full  Full ibility to below 1 km (which is the meteorological definition of fog, World Meteorological Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | 10 42.44 N, 121 • 18 14.18E at a height of about 2681 m on the eastern slope of the North Peak of Hehuan Mountain.The camera is facing eastwards so that Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | After each of these eight possible parameter changes the fit is calculated.If it has been increased, the parameter change is maintained and the whole procedure is done from the beginning.Otherwise the change is undone and the algorithm continues with the next parameter change.If every possible parameter change has been conducted without the fit being improved, the camera adjustment is done.Discussion Paper | Discussion Paper | Discussion Paper |

-
The segment images separate each slope into distance classes.These classes are not based on fixed intervals but they are the result of a k-means clustering of the distance of each pixel of the reprojected DEM to the main cam.This approach was chosen to ensure that each segment corresponds to the natural segmentation 2792 Discussion Paper | Discussion Paper | Discussion Paper | to the first frame of the scene.This helps to overcome the problem of exaggerated movement values that are caused by changes in the brightness of the whole images.The histogram matching is performed for the sky and the terrain separately since the brightness of both areas reacts differently to illumination changes.For the R, G and B channel of the mean image as well as for the movement image an image of the standard deviation (further referred to as "SD image") is calculated.Figures Back Close Full Screen / Esc Printer-friendly Version Interactive Discussion Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | diff local is the color difference between a DEM section and the next highest DEM section of the same terrain segment.It is is calculated as diff local = |R DEM section − R DEM section + 5 m | × |G DEM section − G DEM section + 5 m | × |B DEM section − B DEM section + 5 m | (2) Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | is checked if cloud tops in a horizontal radius of 600 m around the validation cam do exist.If that is the case, z CT for the location of the validation cam is calculated via IDW interpolation.Otherwise the scene is not used in the validation since the interpolation over long distances would cause too much error for accurate validation.Also scenes for which the interpolated height at the cloud cam position has a vertical distance of less than 50 m to the validation cam are excluded from the validation.Thus the validation results show to what extent the presented method is suited to determine z CT with a precision of 50 m.The interpolated value for z CT at the validation cam position is compared with the validation cam footage.For this purpose each of the five validation cam frames that Introduction Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper | Discussion Paper |

-
Discussion Paper | Discussion Paper | Discussion Paper | Despite the absence of cloud tops in the detection area, cloud tops were detected.

Table 1 .
Confusion matrix for the automated validation.

Table 2 .
Confusion matrix for the visual validation.

Table 3 .
Results of the visual validation.