Assessing the Performance of a Low-Cost Method for Video-Monitoring the Water Surface and Bed Level in the Swash Zone of Natural Beaches

A method to continuously measure bed and water levels along a cross-shore transect of vertical poles is evaluated. This remote sensing based method uses video imagery of swash flows propagating past an array of vertical poles buried on the beach face. Using datasets collected at two beaches in Chile, the method is compared against measurements obtained with conventional co-localized instruments: LiDAR and ultrasonic distance meters. The present video swash pole technique shows good skill in retrieving swash zone bed level and water levels, while providing the possibility to measure morphological variations at time scales varying from wave groups (tens of seconds) to hours. Discrepancies between video and ultrasonic distance meters are found when short time scales are used, for both depositional and erosion events, but longer duration trends are captured well. Water surface elevations at the wave-by-wave scale proved to be accurate for the backwash phase (root-mean-sqaure-error, RMSE down to 0.028 m, R2 up to 0.89), when compared against LiDAR. However, discrepancies have been found during the uprush phase (RMSE up to 0.062 m, R2 down to 0.71), when the influence of the pole on the swash flow generates an overestimation of the water surface. Overall, owing to its simplicity of deployment, low cost and reasonable accuracy, the technique is considered suitable for swash studies.


Introduction
The swash zone is the nearshore region that defines the transition between land and sea.
Incoming bores from the inner surf zone collapse and transform into a thin water lens, leading to a zone of alternately dry and submerged states.The swash zone is highly dynamic, with processes acting at multiple time scales, from the order of seconds (waves) to hours (tides) and days (storms).The majority of research efforts focusing on the swash zone have been devoted to linking time-averaged bulk characteristics of inner surf and swash hydrodynamics with morphological evolution at time scales ranging from hours to days [e.g.[1][2][3], with less focus on shorter time scales.
For instance, individual swash events at the wave-by-wave scale.However, there is consensus in that understanding swash zone processes at these short scales is crucial for understanding the overall morphodynamic response of the swash zone [4].
At short time scales, Hughes et al. [5] and Blenkinsopp et al. [6] showed that morphological changes caused by a single or short series of swash events can be greater than the total morphological change integrated over an entire tidal cycle.Consequently, Puleo et al. [7] suggested that ongoing effort should be made at understanding individual erosion and accretion events.To achieve this, it is essential to properly quantify the shoreface evolution at different scales, starting at the time scale of individual swash event cycles.In this context, swash instrumentation is of critical importance for coastal scientists [8].
Both in-situ and remote-sensing approaches are commonly used to measure water surface and bed elevations within the swash zone, using a wide variety of techniques.Holman and Guza [9], Holland et al. [10] used stacked resistance wires to measure the run up elevation on natural beaches, which allowed a continuous measurement along the beach face.Other researchers have installed pressure sensors at or in the bed to provide local (point) but indirect measurements of water depth [11,12] by typically assuming hydrostatic pressure and linear wave theory [13].However, the turbulent and dynamic behavior of swash flows may render these underlying assumptions invalid.
Nevertheless, dense arrays of buried pressure transducers have been employed to measure the water surface and bed level at the wave-by-wave time scale [e.g.3].This technique has been shown to work well at sandy beaches but may return uncertain measurements at gravel beaches.Among other disadvantages of buried pressure transducers is that they can be scoured out by erosive waves, or become clogged by sediments.More recently, improved conductivity-based sensors have been used to obtain the bed level fluctuations even during periods of submerged bed with an accuracy of 1 mm [7,14].
As an alternative to in situ sensors, remote sensing techniques can be used to directly estimate the position of the bed and water level.Ultrasonic distance meters (UDM) use the time-of-flight of sound waves to retrieve the location of either bed or water levels with millimetric accuracy [e.g.15,16].They are non-intrusive with either the beach face [16] or fluid flow, but can be affected by the presence of non-desired targets, such as residual foam [17].Similarly to pressure sensors, they provide only point measurements requiring multiple instruments and complex deployment logistics to increase spatial coverage.In contrast, 2D Laser Scanners (LiDAR) use time-of-flight of laser light to estimate water and bed levels.By using a scanning laser, this instruments enable measurements throughout the swash zone with centimeter accuracy and spatial resolution of O(10cm), at high sample rates O( 20Hz) [8,[18][19][20][21][22].However, LiDAR requires the presence of a turbulent and aerated water surface to scatter the incident beam.Thus erroneous measurements can be obtained for non-saturated waves with a non-aerated water surface, for instance, during the backwash phase.LiDAR can also be more sensitive to problems with the stability of the supporting platform, where standard deviations on bed levels of up to 4.2 (mm) have been reported by Vousdoukas et al. [18].
Remote sensing methods based on images within the optical range of electromagnetic wavelengths have been widely used to study nearshore processes.They offer the potential to extract diverse information at a wide range of frequencies over large spatial domains.Optical methods can be used to measure the variations of the bed or the water levels by contrasting their signal against a known reference, thereby allowing the interface to be tracked.For example, such methods have been used in the swash zone to track the run-up motion, the edge of which is determined by algorithms based on color contrast between water and sand [e.g. 9, 23,24] and recently [25]; or inserted poles (see below for details).Other methods rely on stereo-metric intersection.For instance, to map the shoreface elevation thus allowing morphology mapping with a vertical accuracy of 1 cm [e.g.26,27].
Similar techniques used under laboratory conditions yield more accurate and dense morphological measurements in-between individual swash events [e.g.28,29], although Chardón-Maldonado et al. [30] comment that it is not clear if this technique can be used in the field owing to the highly accurate instrument set up required.
A limited number of previous studies have attempted to use video images of in-situ poles to obtain wave measurements in the field.Mizuguchi [31] measured water surface elevations in the swash zone by photographing poles inserted into the beach face at 0.2 Hz, but did not study bed level variations in detail.The DUCK85 [32] and SUPERDUCK [33] experiments used vertical poles, visually aligned by an observer on-shore, to measure the water level in the surf zone at 5 Hz, assuming that each pole remained aligned in the vertical direction.
Partially buried poles have also been employed to measure morphological changes across the beach face.Weir et al. [34] measured the bed elevation against a set of poles every 15 minutes with a spatial spacing of 2 m, during almost a tidal cycle, claiming an accuracy of 1 cm.Larson et al. [35] used an array of iron poles on a modified beach to measure the beach profile change with a spatial spacing of 0.5 m.They used video cameras to register the bed level every minute with a vertical resolution of 1 mm, but they did not account for the local influence of the poles on the bed, nor the effect of incident waves on the deployment or stability of the poles.Similar set-ups have been used [e.g.[36][37][38][39] with a 1 cm estimated accuracy and sampling rates varying from 10 s up to 15 min and more.While these methods have been used by a range of authors, a quantitative assessment of their performance has not been carried out to date.
Considering the importance of the swash zone in controlling beach face morphology, and the cost and difficult logistics involved in deploying conventional instruments, a simple and inexpensive pole technique that derives the water surface and bed levels through a semi-automated analysis of optical imagery is valuable.The accuracy of the method is compared against established methods (LiDAR and UDMs), with the objective of assessing the performance and capabilities of this approach.
Advantages and drawbacks are discussed considering different time scales (wave-by-wave to hourly evolution).Finally, concluding remarks and guidelines for the use of this technique are provided.

Experimental Set Up
The experimental setup consists simply of establishing an array of partially buried metallic poles in the swash zone.Data collection is undertaken using video of the entire cross-shore transect using an off-the-shelf, high definition camera mounted on a tripod.For the experiments reported here, a SONY HDR-CX190 FULL HD (∼ US$250) video camera with an acquisition rate of 30 Hz was used.This allows for an inexpensive setup with minimal requirements.
While the spatial arrangement tested here uses poles deployed a cross-shore transect, other arrangements can be used provided they do not obstruct each other within the camera field of view.
A small diameter (∼ 3 cm) is required to reduce the influence of the pole on the hydrodynamics and minimise scouring while providing an identifiable surface to contrast against.The poles are buried vertically approximately 1 m below the initial bed level to ensure stability during acquisition.The poles protrude about 1.5 m above the bed.

Field Data
The technique was tested during two field experiments conducted in Chile, at Mataquito and Reñaca beaches, and the performance was compared against two other established techniques (LiDAR and UDM).The method was deployed for the first time in Mataquito ( 34  alongshore average slope of 0.05 in the intertidal zone, as obtained from beach surveys by Cienfuegos et al. [40].Data from December 9, 2012 are used here, when incident wave conditions (significant wave height H s = 1.4 m, peak period T p = 9.4 s) were measured using a Teledyne ADCP moored at 8 m water depth.An industrial LiDAR (SICK LMS511-10100) was deployed at the top of a scaffold, 7.3 m above the beach (Figure 1a) to provide measurements of the bed/water surface elevation along a single transect through the swash and inner surf zone at 35 Hz.A single cross-shore transect of six yellow painted poles with a spacing of 5 m was deployed at an offset of 3 m in the alongshore direction from the LiDAR cross-shore transect (Figure 1b).During the experiment, it was found that some of the poles insufficiently buried.This led to vibration and tilting of the exposed part of these poles with respect to their original vertical position .Therefore, only a 30 min time series from two cross-shore locations were deemed usable (Figure 1e, Landward Pole and Seaward Pole).The vertical elevation and position of each pole was measured with GPS at the beginning of the deployment, in order to reference the video series relative to LiDAR measurements using a common datum.
A second experiment was conducted in September 2015 at Reñaca Beach, Viña del Mar, Chile (32 •     58 S, 71 • 32 W), nearly 120 km west from Santiago.Unlike Mataquito, Reñaca is a steep, reflective beach, providing contrasting conditions for testing the photo pole method.Incident wave conditions during this field study were obtained from hindcast data due to malfunctioning of a moored ADCP.
Wave conditions of H s =1.31 m, T p =11.17 s were retrieved from a node of the Chilean database located offshore of Reñaca [41].An alongshore uniform swash slope of 0.1 was obtained from beach surveys undertaken during the experiment.To avoid the pole instability problems observed at Mataquito, the poles at Renãca were buried to a greater depth.Three poles were deployed on a cross-shore transect at 2 m spacing (Figure 1c, f).Two ultrasonic distance meters (MASSA M300-95, Figure 1d) were co-located with the landward and seaward poles at vertical distances of 0.8 m and 1.1 m from the initial bed level respectively.Ultrasonic and sampling frequencies were configured to be 95 kHz and 4 Hz respectively, with sub-millimeter vertical resolution.The alongshore distance between poles and the center of the ultrasonic beam was 0.19 m.At least 60 min of synchronized measurements are available for validation at both positions.Unfortunately, foggy conditions characterized the daylight hours of the Reñaca during the field experiment.The presence of fog reduces the image contrast required for accurate determination of the foamy water surface.Therefore, the analysis of this dataset focuses on the bed elevation validation only.

Image Processing
The rationale of the method is to extract the instantaneous location of a surface using by continuously tracking the interface between the surface and the pole.By having several poles within the field of view, synchronization is ensured, but the trade-off is that pixel resolution decreases as distance from the camera increases.
Each pole is analyzed independently of the others.To reduce data to a single pole, Hovmoller diagrams (henceforth termed time-space images) of optical intensities are stored by color channel (RGB, Red, Green, Blue).The time-space images are generated by extracting an array of pixels from each video frame along the pole axis and concatenating them in time.The duration of these images can be freely adjusted and it is assumed that the pole does not move enough to alter the mapping of a given pixel to the corresponding point in the pole.Here durations of 2 to 4 minutes are used to focus on individual event swash dynamics.To illustrate, Figure 2 shows 4 minute time-space images at three cross-shore positions.Incident bores from the lower swash zone (top panel, white and light color features) progress toward the upper part of the beach, while decaying in size and lifespan.Only a few bores reach this position (bottom panel).The pole-sand interface is easily identifiable.

Bed Level and Water Surface Detection
Bed and water surface levels are computed separately, but following the same approach.The basic assumption is that the bed level can be observed when water is absent, and that the water level can be observed when the pole is partially submerged during each swash event.In what follows, a swash event is defined as the interval between consecutive dry bed occurrences, following Blenkinsopp et al. [6].Therefore, it is necessary to separate dry and wet periods to identify the bed or water surface, respectively.While the procedure is conceptually the same, it involves the analysis of different sections of the image.Distinguishable color contrast between the pole and the water surface (or bed level) allows for the identification of the instantaneous location of the interface.By noting the strong contrast between the black color of the pole with the light or white colors of the, typically foamy, water surface; and the color of the sand, a simple thresholding procedure can be used used.
Once the interface is identified in pixel space, it is transformed to real world coordinates.RGB time-space images are first converted to intensity gray scale images, defined as I(ξ, t), where ξ is the vertical coordinate (in pixels) along each pole; and t is the time index coordinate (in frames).Next, the time-space image is averaged in time to yield a time-averaged pixel intensity profile, which is used to identify areas of interest for the subsequent analysis.An example is shown in Figure 3, where a clear change in pixel intensity is observed between the pole and the area of interest.
The middle section of the time-space image corresponds to the pole and is characterized by relatively constant low pixel intensity value, which fluctuates little due to changes in lightning conditions.The average pixel intensity I(ξ) increases gradually when the pole is partially immersed by swash flow (ξ = 500 − 650 ), followed by a sharp increase in pixel intensity at the sand level (magenta line).Note that the pixel coordinate increases towards the bottom of the pole.
The use of the time-averaged pixel intensity profile allows the identification of reference features in the image.The mean bed level, herein termed bed ( shown in magenta in Fig. 3b), is defined as the ξ coordinate which is detected by the abrupt change in optical intensity described above.Considering that bed changes should be confined around this mean level, an area of interest for bed tracking is bounded at the bottom of the time-space image by arbitrarily defining a location ny pixels below ξ = bed, where ny is a fixed value defined by the user.Here ny is set to 50 pixels, which in this case corresponds to 5-20 cm depending on distance of the pole to the camera.To identify the bed level, a new vertical location in the image is selected and termed bottom (c.f.Fig. 3, cyan dashed line), by selecting a time series 0.5ny pixels below the mean bed level.The pixel intensity time series at this location shows alternating periods of large and low pixel intensity, with sudden and sharp gradients in between.The periods of large intensity are expected to be due to water covering the pole and bed.Thus, a simple thresholding procedure can be used to discriminate these events.The threshold intensity I thrB is defined as: where α is a coefficient that varies depending on site and the cross-shore position, and σ is the pixel intensity standard deviation of the time series.Figure 4 shows the application of I thrB to a series collected at the lower swash zone at Renãca (Figure 2a), where swash events are relatively long in 164.4,estimated using Eq. 1, with α = 1.6.Continuous pixel intensities above the threshold, I > I thrB , are considered to be part of a single swash event.
Using this approach, I(ξ, t) is transformed into a matrix with identified intervals of bed level and swash events (Figure 4c).To minimize false detection due to splashing, a duration criterion is imposed assuming that swash events must last more than one 1 second.
Once swash events have been filtered out, the bed level is determined at each time interval by computing the gradient in pixel intensity along the pole axis, ∂I(ξ) ∂ξ .Due to color changes, the maximum gradient corresponds to the transition between the pole and the sand, thereby denoting the location of the bed level.Figure 4c, d and e show sample results over a 19 s window.The procedure detailed above is applied to each interval between swash events to determine the changing bed elevation on a swash-by-swash basis.
A similar procedure is applied to identify water surface but with a modified threshold.
where β defines the number of standard deviations above the mean of I(overbed, t) and overbed is a level which is offset 0.5ny above the mean bed level (Figure 3a, green dashed line).Due to potential splashing on the pole, an erosion-dilation morphological image filter is applied to reduce the effect of droplets or small scale features on the record.
Following the thresholding technique described above, I(ξ, t) is transformed into a binary map of ones (water pixels) and zeros (pole or bed pixels), as shown in Figure 5a. Figure 5b shows the binary matrix after application of the erosion-dilation filter, which successfully removes noise present in the signal due to splashing and foam, and allows for simple determination of the interface without affecting the main structure of the swash event.A transformation from pixel to real world coordinates is conducted by assuming a weak lens distortion, and that the pole belongs to a vertical plane parallel to the image plane.The validity of these assumptions is reviewed below.Hence, any known dimension of the pole can be used to estimate the pixel resolution and transform to world coordinates.Here a 30 cm painted section in the upper section of the pole is used to estimate the pixel resolution.Typical resolutions (pixel footprint) of O(10 −3 m/pixel) are obtained, decreasing with the distance to the camera.Table 1 shows the pixel resolutions obtained in the present study.Vertical levels are then geo-referenced to a common datum by referring to the position of the top of the pole which was measured using RTK GPS.

Comparison with LiDAR for the water surface and bed level
Raw LiDAR measurements were de-spiked to reduce outliers, and random noise was reduced using a filter with a moving time-average with a window of 0.2 s [e.g.20].LiDAR data were down-sampled to match the video frame rate.Bed and water levels were separated using a variance threshold Almeida et al. [19] at each pole location, and extracted using a threshold water depth of 0.02 m to distinguish from topography.for both the landward and seaward pole locations.An overall excellent agreement is observed, with RMSE differences of 0.023 m and 0.044 m, respectively (see Table 2 for a summary of statistics).Figure 6c, d show 5 min detail from both cross-shore positions.Errors arises primarily around the time of swash front arrival, when the pole method has a tendency to overestimate the water level.A comparison of the two techniques for the uprush and backwash phases separately can be observed in the scatter plots presented in Figure 7.In these plot, the best fit regression using a linear model η Video = a η LiDAR + b are also presented, where η is the water level.Regressions computed with the 95% confidence regression values are shown in cyan.For these cases, they are very similar to best fit regression, indicating a large confidence in the estimates of the latter.
Uprush-backwash separation was computed by identifying the turning point between increasing (uprush) and decreasing (backwash) values of a low-pass filtered water surface signal (frequency cut-off 0.5 s −1 ).This is considered appropriate for the bulk analysis here, although flow reversal might actually occur before this criterion.Uprush measurements at both poles exhibits a good correlation between LiDAR and video data, with a minimum R 2 = 0.71.The present method has a tendency to overpredict the elevation, particularly at the landward pole, which has a slope fit term exceeding unity.Backwash phases show an improved correlation, with maximum R 2 up to 0.89.
Better correlations and less scatter are found for backwash than uprush phases.   2 for a summary of error statistics.
Analysis of the bed elevations extracted from the photo poles indicates that the overall trend in bed elevation changes are captured well at both pole locations (Figure 8a,c).Differences in the absolute bed level elevations are comparable, with maximum differences of 1.2 cm between video and LiDAR.On a swash-by-swash basis, the correlation between the LiDAR and photo pole data is R 2 = 0.82 (RMSE=0.004m) and R 2 = 0.69 (RMSE=0.005m) for the landward and seaward poles respectively (Figure 8b,d).These regression parameters are comparable to those obtained for the water surface elevation.
With the aim of further demonstrating the capability of video for measuring the absolute bed level, the relative difference between common intervals of bed level, defined as were calculated, where z i,LiDAR is the mean value of the LiDAR time series during the i th bed level interval and z i,video , the corresponding bed level retrieved by video.101 and 56 intervals of common bed level exposures were found at the landward and seaward pole respectively.A large fraction of them, 82% and 71%, yield E < 5 mm, which is within the expected accuracy of LiDAR.
The cumulative bed level change relative to the number of waves (swash events) is shown in Figure 8a for the landward pole, where 100 waves were identified.Both LiDAR and video yield very similar trends with an overall consistency between erosion and deposition cycles.However, individual swash events can vary significantly and show opposite behavior on occasion.This is likely to be due to low resolution of video relative to the magnitude of bed level variations at the wave-by-wave scale and the 3 meter alongshore separation between both measurements.Similar trends are found for the seaward position (Figure 8c, 55 waves).

Comparison with ultrasonic distance meters (UDM) for the bed level
Bed level extraction for UDM data is commonly accomplished by comparing the rate of change of bed elevation to some threshold [e.g.15].However, in this work a variance threshold was used, similar to the processing used for the LiDAR data.obtained for the whole time series at both locations, the performance at the individual wave timescale shows more variability.
Histograms of wave-by-wave bed level changes ∆z are shown in Figure 10.It should be noted that the measurement resolution changes between poles according to Table 1, while it remains constant at 1 mm for the UDM's.At both locations, the histograms show a symmetrical distribution, with approximately equal numbers of erosion and accretion events.However, the video histogram is smoother than the UDM, which may be a result of the video accuracy and the sensitivity of the UDM sensor, as explained below.
The accumulated bed level evolution relative to the number of waves (swash events) is shown in 11a for the landward pole over a 90 min window, where 86 waves were identified.The two sensors yield very similar trends with an overall consistency between erosion and accretion.However, individual events can vary significantly and show opposite behavior on occasion, consistent with the large ∆z values.Similar trends are found for the seaward position (Figure 11b, 132 waves in 60 min), and for longer time scales, from the group scale to hourly records encompassing the complete duration of the experimental dataset.

Discussion
The previous results show that bed and water levels obtained from the video technique and those from two conventional methods, show good agreement, especially in recovering trends at a range of time scales.This suggests that the simple and inexpensive setup described here is appropriate for obtaining swash data.
However, differences of up to the centimeter scale have been found for both bed and water surface levels.Differences were found to be greater at positions farther from the camera, probably due to a decreasing resolution.The problem is compounded for the Mataquito dataset, as LiDAR resolution also decreases with increasing distance between target and scanner [18].
In broad terms, the errors can be the result of several factors.For instance, problems arising from improper system set-up, or variations in the geometry of the system.For example, the comparison of bed levels show moderate agreement for both seaward and landward positions measured with LiDAR and video.LiDAR is known to be potentially affected by instabilities and vibrations of the supporting platform when measuring stationary targets, leading to errors of 2.5 mm [8] and standard deviations of up to 4.2 mm [18].It is of note that RMSE errors fall within this order of magnitude.
The present method can be also affected by problems arising from installation.The method relies on the hypothesis that the poles belong to parallel imaginary planes; and that their short distance from the camera allows errors in collimation or lens distortion to be neglected.Finally, it is expected that the poles do not change their position relative to the camera.
To test these assumptions, checkerboards of known dimensions were placed atop the poles (landward and seaward poles, Figure 12a) during the Renãca experiments, and used as control points (Figure 12b).This enabled the errors in projecting a given pixel when the lens distortion is neglected to be assessed.A camera calibration routine to determine the intrinsic and extrinsic camera parameters was used, similar to the one proposed by Zhang [42] and implemented by Valentini et al. [43].For the conditions and zoom setting used in Reñaca this led to errors in placement that did not exceed 1 pixel.Therefore, for this particular case the original assumption is valid, but other installations should consider estimating and accounting for these errors explicitly.
The checkerboard control points also enabled and analysis of whether the vertical orientation of the pole was important.All image frames were subject to a projective 2D transformation which maps the images to the plane defined by the checkerboards.This rectification process ensures that the images comply with the orientation assumption (Figure 12c).Corrected time-space maps are then generated.
Bed levels were detected with the corrected time series and show a similar behavior than without rectifying (Figure 11a, b, red lines), with RMSE differences of 0.0015 m and 0.0028 m for the landward and seaward positions, respectively.Thus the assumption that the the pole does not move enough to alter the mapping of a given pixel to the corresponding point in the pole is validated for this dataset.
It should be noted that whether rectification is performed or not, the method implicitly assumes that the pole does not shift location or orientation relative to the camera.In case of slight movements, correcting for it using the transformative projection can be performed on a frame-by-frame basis.
This would require the top of the pole, or control points such as the checkerboard, to be tracked over time .
Slight pole rotations away from the vertical would not be expected to produce large discrepancies, because the vertical change would be proportional to the (1 − cos θ), where θ is the off-vertical rotation angle [e.g.32].To contextualize, a large 20 • rotation will reduce the pixel resolution by 6%.While there are situations where the poles are displaced or rotated considerably from their original position, especially under energetic wave conditions, this could be reduced by proper burying.In Reñaca, a burying depth of 1 m produced good results.It is also noted that the camera orientation itself can drift.Therefore, it is also recommended that a solid and fixed camera clamping systems (tripod) is used to ensure the stability of the camera during data collection.
The exact application of the algorithms used to detect the water and bed elevation can also cause some variability in the results.For example, while the water surface and bed level detection process becomes automatic once the values of the parameters α and β are determined, however these values need to be estimated manually at each cross-shore location owing to their dependency on the presence of foam or sand over the time series.At seaward locations (e.g. Figure 2a), the presence of water accounts for a larger fraction of the pixel intensity along ξ = bottom, increasing the mean and reducing the variance of optical intensity for I thrB , when compared with landward locations (e.g.

Figure 2c
).Thus seaward locations would require lower α values than landward locations.Here, a subset of the data (8 min) was used to manually estimating these values.This assumes that the sea state remains constant and thus swash frequency does not vary significantly over the course of the whole dataset.Within this subset, the number of bed level (dry) and water (wet) intervals are identified manually and numbered.The results are compared with those detected automatically  using a range of α values.The final value of the parameter is taken as the α value which minimizes the error between manually and automatically detected results, and this is typically smaller than 5 percent, as seen in Figure 13.For the cases studied here, β = α − 0.6 yield the best results for detecting the water surface.This is consistent with the expectation that the variance of the water level is larger due to the brighter colors of water, thereby requiring smaller thresholds.
One potential disadvantage of the video processing methodology is that the gradient of intensity between bed and pole comprises up to four pixels, therefore affecting the location of the maximum gradient.To analyze the sensitivity to this selection, the transition was modeled by fitting the time-averaged intensity to a sigmoidal function.The fitted expression is a logistic function where I(ξ) is the time-averaged pixel intensity during an interval of bed level, Ī∞ is the value of I(ξ) when ξ → ∞, ν is the decay constant and ξ ν is the coordinate defining the inflection and symmetry position of the function.We have carried out this analysis for the landward and seaward position of the Reñaca experiment due to greater availability of dry instants in between swash events.
For every bed level elevation found using the maximum gradient, a time series fitted with a logistic function is generated to compare ξ ν with the previous bed elevation.Figure 14a shows an example for the bed level detected using both approaches, and Figure 14b shows the fitted expression for one dry bed interval.
Figure 14c,d show bed level elevations obtained using the original video processing, using the logistic function (red lines) and also those derived from ultrasonic distance meters (magenta lines).
Additionally, 95% confidence intervals of the logistic regression are shown in light blue, to account for the uncertainty in bed level detection.
At the landward position (Figure 14c) a maximum difference of 2 pixels, (∼ 3 mm) is found between the two optical methods.The seaward position (Figure 14d) shows larger differences on occasion, which is attributed to reduced contrast due to foggy conditions, but also to the decreased resolution due to the longer distance to the camera.These factors hampered the fitting of a logistic function due to noise in the time averaged pixel intensity.Despite this, most of the bed level elevations obtained by the original method and the logistic function differ less than 4 pixels (0.0076 m).Therefore, the overall accuracy of the data processing implemented here can be defined to 4 pixels (up to 1 cm for the present data set) when analyzing bed level.
Comparison of the water surfaces measured with video and LiDAR showed moderately good correlation but differences are apparent locally.One possibility is that this is due to the use of the erosion-dilation filter.While the goal is to remove small scale features that might not be of hydrodynamic interest, detection without using the filter showed differences of up to 10 pixels, with the filter-less data yielding larger free surface elevations.Typical values were 3 pixels, and their overall occurrence was sporadic.The Erosion filter is necessary to eliminate splashes, while removing dilation filter leads to larger disagreement between the video and the water surface observed in the time-space map (cf.Fig. 5c), suggesting the use of the filter is appropriate.
More relevant appears to be the interference of the pole itself.Analysis of the full frame video shows that the pole affects the flow immediately local to it, producing a vertical flow structure around the pole's shaft that yields overestimation of the water surface detected with video.These secondary flows are an additional rise in the water surface level due to conversion of kinetic to potential energy at the stagnation point on either side of the pole that are particularly evident during uprush.It is also noted that the uprush tends to be foamier and more easily distinguishable than backwash.This behavior is consistent with the tendency of video to overpredict the LiDAR time series.Owing to its physical origin, this effect cannot be reduced and it should be acknowledged when using the data.

Conclusions
This work assesses the performance a video-based technique for monitoring bed and water surface levels of the swash zone at the scale of individual waves.The principle of the method is to monitor through video imaging, the elevation of the interfaces between water and sand against a known reference provided by several vertical poles buried in the sand.The method allows for different spatial configurations of the poles, provided each pole does not obstruct imaging of the others.Off-the-shelf video cameras can be used, mounted on tripods or other stable platforms, requiring minimal energy requirements and facilitating easy deployment.The main limitation of this system is the decreasing resolution as the reference is moved further away from the camera, which could reduce spatial coverage.
The results shown here indicate that ensuring a constant system geometry throughout data collection is beneficial.This can be achieved by proper burying of the poles, and by a stable camera support system.It is recommended that lens distortion effects are corrected for, and using checkerboards or other control points to track the camera and system geometry is suggested, although for short deployments where the poles remain stable this may not be required.
Regarding the expected accuracy of the method, measurements of water surface variations at the wave-by-wave scale proved to be accurate for the backwash phase (RMSE down to 0.028 m, R 2 up to 0.89), when compared against LiDAR data.However, larger discrepancies were found during the uprush phase (RMSE up to 0.062 m, R 2 down to 0.71), when the when the presence of the pole causes vertical flows generated upon the sudden arrival of the swash front.
Bed level evolution measurements compare well with conventional ultrasonic distance meters, reproducing erosion and deposition events at time scales ranging from wave groups to a longer (hourly) evolution.However, at the wave-by-wave scale, the method shows discrepancies principally attributed to a combination of the pixel resolution footprint and the identification of the bed level by image processing techniques, leading an estimated accuracy of O(1 cm).
As a result, when compared to other conventional techniques the method offers comparable resolution capabilities.Owing to its simplicity of deployment, very low cost and reasonable accuracy, this technique can be adopted for swash data collection in the field.

Figure 1 .
Figure 1.(a) LiDAR and a scaffold structure used for measurements at Mataquito.(b) Pole array used in Mataquito field study.(c) Instrument deployment at Reñaca Beach field study.(d) Detail of a co-localized UDM used at Reñaca.(e) Cross-shore profile during the Mataquito field study.(f) Cross-shore profile during the Reñaca field study.Black horizontal lines represent the maximum, mean and minimum water level during the experiment.

Figure 2 .
Figure 2. Example of RGB time-space images at three cross shore positions for the (a) lower swash (b) middle swash and (C) upper part of the beach.Each time series is 240 seconds in duration.Data are from Reñaca beach.

P i x e l i n t e n s i t yFigure 3 .
Figure 3. (a) Sample time-space image of approximately 240 seconds recorded at Reñaca.The colorbar corresponds to the grayscale pixel intensity, I(ξ, t).Dashed lines represent the following ξ coordinates.Blue: pole top, green: overbed, magenta: bed and cyan: bottom.(b) Time-averaged gray scale intensity over the complete timestack.

Figure 4 .
Figure 4. (a) Sample time-space image in the lower swash zone at Renãca.Cyan dashed line denotes the pixel coordinate ξ = bottom.(b) Pixel intensity time series at ξ = bottom.The blue solid line indicates the threshold I thrB = 164.4(c) Sample time-space image after application of I thrB filter.Red dashed line is the bed level of the first dry interval between t=0 and t=19 seconds.(d) Example of bed level detection for the first dry interval, showing the time-averaged pixel intensity over t=0 and t=19 seconds.The red dashed line represents the maximum gradient ∂I(ξ) ∂ξ .(e) Along-pole distribution of the gradient, ∂I(ξ) ∂ξ , estimated between t=0 and t=19 seconds.Red square denotes the maximum value.

Figure 5 .
Figure 5. (a) Sample time-space map upon application of I thrW .(b) Noise and splashes are reduced after the application of an erosion-dilation filter.(c) Final detection of the bed level (red dashed line) and water surface (magenta dashed line).In addition, water surface detected using only an erosion filter is shown in yellow solid line.(see Discussion below).

Figure 6a, b show 30
Figure 6a, b show 30 min time series of LiDAR (red dashed line) and video (black solid line)

Figure 6 .
Figure 6. 30 minute time series of LiDAR (red dashed line) and video (black solid line) measured in Mataquito Beach at the (a) landward position and (b) seaward position.5 minute subsets of the data are also shown at the (c) landward position and (d) seaward position.

Figure 7 .
Figure 7. Scatter plots of the water surface elevation obtained with LiDAR and the pole method at Mataquito, with the uprush and backwashes phases separated.Blue solid lines are the fitted regression lines, cyan lines are the regression lines with 95% confidence interval; and black dashed line denotes perfect fit (1:1).(a) Uprush landward pole R 2 = 0.71.(b) Backwash landward pole R 2 = 0.85.(c) Uprush seaward pole R 2 = 0.81.(c) Backwash seaward pole R 2 = 0.89.See Table2for a summary of error statistics.

Figure 8 .
Figure 8. Cumulative bed level change as a function of the number of waves (swash events) measured at both cross-shore positions (a) landward and (c) shoreward.Red and black solid lines are bed level evolution derived from LiDAR and video, respectively.Bed level evolution starts from the 0 m elevation for the first wave.Scatter plots of the bed level elevation in between swash events are shown for the (b) landward and (d) seaward positions.Blue solid lines are the fitted regression lines, cyan lines are the regression lines with 95% confidence interval; and black dashed line denotes perfect fit (1:1).

Figure 9a ,
Figure 9a,c show 90 and 60 min synchronized time series of raw UDM (black dashed line) data along with extracted bed levels from the UDM (magenta solid line) and video (blue dashed line) data at the landward and seaward poles, respectively.The evolution of the bed level shows periods of erosion interrupted by periods of accretion.While a very good correlation between bed elevations measured by both instruments (cf.Table 2, R 2 = 0.89 − 0.93) and a low RMSE (0.0041 -0.009 m) are

Figure 9 .
Figure 9.Comparison between UDM and video records.Black solid lines are the raw UDM measurements.Bed levels for the video method (blue dashed line) and UDM (magenta solid line) are also shown for the (a) landward (90 min) and (c) seaward (60 min) poles.Only 60 min of synchronized measurements are shown for the seaward position but 90 min are present for the UDM measurements to match with the duration of the landward position.Scatter plots of the bed level elevation in between swash events are shown for the (b) landward and (d) seaward positions.Blue solid lines are the fitted regression lines, cyan lines are the regression lines with 95% confidence interval; and black dashed line denotes perfect fit (1:1).

Figure 10 .
Figure 10.Histograms of bed elevation changes at the wave-by-wave timescale ∆z for the (a) landward and (b) shoreward pole position.

Figure 11 .Figure 12 .
Figure 11.Cumulative bed level evolution as a function of the number of waves (swash events) recorded at both cross-shore positions (a) landward and (b) shoreward.Magenta lines represent the UDM data, blue lines show the video method as proposed in this work and the red line presents the results for the rectified video method outlined in the discussion.

Figure 13 .
Figure13.Selection of α value (solid red circle) that minimizes the relative error between the number of automatically detected and manually selected bed intervals at the cross-shore positions (a) low swash zone (Figure2a), α = 1.6(b) middle swash (Figure2b) α = 2 and (c) upper part of the beach (Figure2c) α = 2.4

cFigure 14 .
Figure 14.Bed level detection using two approaches.(a) Timestacks and bed level detected by means of the maximum ∂I(ξ) ∂ξ (red dashed line) and by fitting a sigmoidal function of the averaged pixel intensity I(ξ) for each dry interval (green dashed line).(b) Sample detection for a bed level interval in between swash events.Black solid line is the pixel intensity I(ξ) and the magenta dashed line is the corresponding sigmoidal fit.The red circle is the position of maximum gradient, while the green circle is the inflexion point of the fitted function.For this example both methods yield the same results.Light blue solid plot is the logistic regression fit with 95% confidence interval.The bed level elevation derived from the original video method (bed lines), logistic function (red line) and UDM (magenta lines) are shown for the (c) landward and (d) seaward position.Light blue solid envelope are the 95% confidence interval of the bed level derived from the logistic function.
• 52 S, 72 • 09 W ), nearly 300 km South-West of Santiago de Chile.The beach is dissipative to intermediate, with an

Table 1 .
Vertical pixel resolutions for both experiments.

Table 2 .
Summary of statistical analysis for both experiments.a and b are the slope and intercept of the fitted regression η Video = a η LiDAR + b