1. Introduction
Wave-averaged currents are a fundamental driver of numerous nearshore processes, including rip currents that claim lives [
1], alongshore currents impacting ecosystem health and pollutant transport [
2], and flow gradients altering nearshore morphology [
3]. Flows can be forced by breaking wave momentum [
4], pressure gradients, and low-frequency motions [
5]. Competition between forcing and dissipation yield varying velocities (decimeters per second) over large spatial scales (10
2–10
4 m). Flows are typically stronger in the alongshore than cross-shore, except at rip currents where locally strong flows can exceed 2 m per second [
6,
7]. Models based on radiation stress [
4] and vortex-force concepts [
8] can produce longshore currents and rip currents at appropriate magnitudes, and Boussinesq models can generate surf zone eddies and shear instabilities [
9]. However, available field data hinder further development of unified theories aiming to incorporate processes such as the injection of wave-scale vorticity cascading to low-frequency motions [
5,
10]. In situ measurements from moored instruments or fixed poles jetted into the bed are logistically difficult and costly to deploy, typically limiting coincident observations to only a couple points in space. The ability to remotely sense currents at high resolution in space and time could provide critical contextual data for both theoretical and applied nearshore studies.
Multiple remote sensing techniques have been applied to derive spatially varying surface currents, including optical video-based systems at both visible and infrared frequencies as well as marine radars [
11]. Standard (non-Doppler) marine radars do not directly measure currents, but algorithms are actively in development to infer flow patterns by tracking advection of wave-averaged spatially variable sea surface roughness patterns [
7,
12]. Alternatively, optical methods rely on contrasting surface features to act as targets that are assumed to move from frame to frame with the flow velocity. Foam is the predominant target traced within the surf zone; however, optical images will also sense light reflections from sloped water surfaces and turbidity that alters background water color. The wave-associated foam and light reflection signals are the dominant optical signal that previous coastal remote sensing studies have attempted to resolve using various techniques. Mean longshore currents have been estimated by extracting alongshore pixel timestacks from video [
13,
14]. Instantaneous velocities have also been calculated using particle image velocimetry (PIV), which tracks movement between two successive images by performing correlations of many small independent image segments [
15,
16,
17,
18,
19]. Similarly, global formulations known as dense optical flow approaches can solve for the entire flow field simultaneously by minimizing a predefined function between two or more successive frames [
20].
Each of these quantitative algorithms typically performs better with high-frequency, high-resolution images as input. Multiple images per second (>2 Hz) at small pixel sizes (<0.5 m) are common in previous efforts [
16,
17,
20]. Two drawbacks arise from such approaches; large data files are created (multiple gigabytes) that negate longterm monitoring, and the currents resolved include short-term foam behavior not coherent with wave-averaged motions. Foam is created during wave breaking by air entrained below the ocean surface [
21]. A foam mat is created as bubbles rise to the surface and either pop or are retained by surface cohesion. After passage of the wave front, the mat is morphed into coherent concentrated patterns and holes by turbulent processes such as obliquely descending eddies, self-organization by vertical momentum exchange due to drag induced by the largest rising bubbles, and bottom-generated coherent structures resulting in surface boils [
19,
22]. Subsequent wave fronts provide more air entrainment while introducing alongshore coherent overturning motions that elongate foam patches to more shore-parallel orientations. Persistent foam mats eventually propagate with the mean wave-averaged flow.
Present methods derived from high frame rates thus attempt to resolve a noisy surface expression of turbulent structures, generating, collecting, and advecting foam superimposed on wave-averaged flow patterns. Although present techniques can filter, average, and smooth velocities to retain realistic alongshore flows [
13,
17,
20], the data file sizes and associated computing power necessary for processing prohibits continuous monitoring, timely assimilation to now-cast hydrodynamic models, and real-time early warning systems of persistent and transient rip currents. The objectives of this work are (1) to define an alternate approach, referred to henceforth as WAMFlow, to remotely derive flow features at spatial and temporal scales larger than turbulent structures associated with individual waves (
Section 2), (2) to validate the method with drifter deployments that contextualize the spatial variability in flow (
Section 3), and (3) to highlight the potential for the technique to contribute new insights to surf zone hydrodynamics (
Section 4).
2. Methods: Remotely Sensed Currents
Coastal imagery used in this study was acquired from the U.S. Army Corps of Engineers’ (USACE) Field Research Facility (FRF) in Duck, NC, USA (described in
Section 2.1,
Figure 1).
Section 2.2 presents WAMFlow, a methodology based on a concept previously applied to X-band radar observations [
23] and coastal shelf imagery to identify internal waves [
24]. A rolling temporal average of movie frames was used to remove the surface waves and associated foam organization not coherent with mean flow patterns. These wave-average movies (WAMs) were then processed with a common, efficient dense optical flow technique to derive flow patterns with components in both the along- and cross-shore directions (details in
Section 2.3).
2.1. Field Site
The FRF shoreline is oriented −18.2° north-northwest of true north, composed of ∼0.2 mm mean grain size sand on a foreshore of 1:12.5 with one to two sandbars typically present [
25]. The FRF site is an active field observatory where beach topography and nearshore bathymetry data are collected at monthly intervals. In situ hydrodynamic gauges are deployed within or outside the surf zone providing nearly continuous, point-based data streams of wave spectra, currents, and tides. Remote optical observations of the surf zone are also made nearly continuously during daylight hours from a 6-camera array mounted on top of a 43 m high tower (known as the Argus Tower, [
26]). Ocean wave characteristics are measured by a directional pressure array in 8 m of water immediately offshore of the Argus Tower [
27]. Water levels, including semi-diurnal tides and non-tidal residuals are recorded at the National Ocean and Atmospheric Association’s Station 8651370, located at the end of the FRF pier.
Beyond the operational measurements, additional targeted field measurements were made coinciding with the
During Nearshore Event Experiment (DUNEX) pilot study carried out in Fall 2019 at the FRF. Bathymetric surveys were periodically obtained during DUNEX (representative survey from 17 October 2019 immediately offshore of the Argus Tower provided in
Figure 1e), identifying a single sandbar in −3 m of water depth and approximately 100 m offshore. The coordinate system presented in
Figure 1e is a local reference field particular to the cross-shore and alongshore axes of the FRF shoreline. The origin is located at the southern edge of the property (36.1776°N, 75.7497°S), with the y-axis oriented alongshore such that increasing yFRF corresponds to more northerly portions of the beach while increasing xFRF corresponds to distance from the dunes and thus deeper water.
2.2. Data Acquisition
The Argus station is composed of six separate high-resolution optical cameras [
26]. This particular platform has been in operation since 1986 (with the present cameras in operation since 2015) and has been utilized in many studies during the last four decades, including sandbar tracking [
25], shoreline variability assessments [
28], and the development of bathymetric inversion techniques [
29]. Each camera records 2048 × 2448 pixel images at 2 Hz for 17 min beginning every half hour (during daylight), which generates a total of >60 GB of data per half hour recording. Typically, the images are postprocessed to a set of standard products rather than saving the raw images, greatly reducing the necessary data storage and enabling continuous monitoring [
30]. For this study, a limited number of complete full-frame raw image recordings were saved during drifter deployments and processed following the steps outlined in
Figure 2.
Raw images were converted from 3-bands (RGB) to grayscale and rectified to 1 m by 1 m grid in local FRF coordinates using open-source software (Python interface to OpenCV [
31]) and by assuming the vertical location of the water surface to be the observed tide height. Co-incident images from all six cameras were then merged to create single frames with spatial coverage of 2 km in the alongshore and 0.5 km in the cross-shore (same spatial coverage as
Figure 1e: xFRF = −500 m to 1500 m and yFRF = 0 m to 500 m). Exposure was not postprocessed to match across all cameras or across all merged images (i.e., varying brightness due to passing cloud cover), and no image processing was performed to enhance image texture. Wave-averaged movies were created by a running average time window of twice the dominant wave period measured at the 8 m array to ensure about two individual wave breakers and passing bore fronts were included in each average. A time-step between frames of 5 s was then used to reduce movie file size and increase perceived motion of residual foam between frames. The effect of these user decisions are discussed further in
Section 4. An example frame from a WAM computed using this technique is shown in
Figure 3a. The image reveals where consistent wave breaking occurs by emphasizing regions of greater reflectance. In this example, higher foam generation occurs at the sandbar breakpoint (xFRF = 180 m) and in the swash zone (xFRF = 125 m). Although the product is comparable to the traditional timex (10 min averages, e.g., [
32]), the much shorter temporal window retains more ephemeral residual foam streaks. Foam streaks are observed in
Figure 3a in the sandbar trough (region with less breaking between xFRF = 125–180 m) and immediately north of the FRF pier due to flow separation around pilings.
2.3. Optical Flow Estimates
Computer vision technology has rapidly advanced over the last few decades, largely motivated by automation needs unrelated to oceanographic research. However, adaptation and leveraging of these emerging technologies has the potential to greatly enhance surf zone research. In this work, the application of a dense optical flow algorithm is explored to evaluate its ability to track the advecting foam patterns visible in WAMs. Numerous approaches have been developed to close the generic optical flow assumption that brightness is conserved:
where
I is the image intensity,
U is the apparent velocity,
x and
y are image dimensions,
t is time, and subscripts denote vector components. This study uses a polynomial expansion to identify gradients of consecutive images’ intensities [
33,
34] (code freely available in OpenCV). The selected method closes the number of equations to a number of unknowns by assuming that the displacement field is slowly varying such that information can be integrated over a local neighborhood (user decision). The number of previous frames to consider and an option to provide an initial flow field guess are additional user decisions not explored in this work. Velocities are ultimately derived at every pixel and every time step throughout the entire video.
2.4. Filtering Optical Flow Results
Similar to previous efforts estimating nearshore velocities, the resulting flow fields from this method contain noise in both space and time as a consequence of both natural processes and the wave-averaged image processing technique. Often the most common factor decreasing signal to noise ratios in optical tracking algorithms is the introduction of new targets and/or disappearance of old targets. In this application, “targets” are locally bright pixels relative to the background brightness (i.e., bright white foam against dark water). When targets are not consistently present, the basic assumption that image pixels can be correlated between subsequent frames or that intensities/gradients are congruent between frames is fundamentally broken. This potential error source becomes particularly relevant for WAMs: the spatial and temporal resolution reduction which aims to minimize the presence of wave and turbulence also effectively increases the percentage of frames with new targets present.
This issue has previously been addressed with high frame rates that reduce the ratio of frames with target discontinuties to frames with consistent targets [
15,
16]. Introduction and decay of tracers has also been accounted for in scenarios where the user systematically introduces targets by defined input functions with decay terms (i.e., periodic inputs of a specific magnitude with a known exponential decay rate of the tracer presence [
35]). However wave breaking is a chaotic, quasi-random process and the persistence of foam in the surf zone exhibits dependencies on the kind of wave breaking, water temperature, and biological/chemical content [
36], necessitating more research focused on these dynamics before properly constraining such functions in the present problem. Discontinuities in target presence are accounted for in this study by postprocessing with two metrics specifically related to elements of the WAM video prior to applying optical flow; large changes in mean local brightness, and low local brightness standard deviation. The metrics are efficiently obtained over the same size pixel area as the optical gradient calculation by applying 5 × 5 pixel convolution filters to every image in the WAM. When considering the distributions for brightness obtained in each local area, regions with no surface tracers result in narrow, peaked distributions (low standard deviation) and low means (note yellow distribution in
Figure 3b), while regions with surface foam exhibit wider distributions (high standard deviation) and high means (
Figure 3b).
Alongshore velocity estimates from an example region (green box in
Figure 3a) in the trough between the shoreline and sandbar are shown in
Figure 4 to highlight several trends between local intensity distributions and predicted velocities. Distributions with large changes in the local mean between successive frames can result in anomalous large velocities (note that the relatively rare large positive velocities all occur with large frame-to-frame changes in brightness). Local brightness changes greater than 5 are thus considered as a proxy for the introduction or disappearance of targets, and all such returns are removed in postprocessing. Low local standard deviations also consistently result in optical flow returns of zero velocity, indicating that foam tracers were not present but not necessarily ruling out that water was not flowing at that time. All velocity estimates occurring during instances of standard deviations less than 2 are discarded as potentially poor estimates due to not adhering to the underlying assumptions of the optical flow algorithm.
3. Results: Comparison to In Situ Observations
Drifters were deployed in the nearshore on three different days during DUNEX with varying degrees of wave height, period, and direction relative to shore normal (
Table 1). Each deployment contains enough tracks to discern flow patterns both within and outside of the breaker zone, capturing longshore currents, rip ejections, and circulation cells within the surf zone. Each drifter was 60 cm in length, 10 cm in width, and composed of PVC piping with water tight fittings, which follows a now common surf zone drifter design used at sites around the world [
37,
38,
39,
40] (
Figure 1d). GPS and IMU sensors were located at the top of the drifter with a cellular modem communicating its location in real-time back to shore personnel while also saving data to the cloud to prevent data loss if a drifter was damaged and flooded in the shore break. Buoyancy was adjusted to maintain near-consistent satellite signals and cell network reception (5–10 cm of the drifter piercing the surface). Drifters were deployed by dropping them in the water from the FRF pier at varying cross-shore locations and by collecting them after they had freely floated to shore and washed up in the shore break. Deployments lasted from one to three hours, each containing varying temporal and spatial coverage due to variability in drifter path, i.e., some drifters slowly meandered while others rapidly moved kilometers away from the FRF property during deployments with strong longshore currents. Drifters intermittently lost satellite and/or cell service due to submergence onshore of breaking waves; however, lost connections were rarely longer than 1–2 s and previous efforts have found reasonable results using linear interpolation to fill the data gaps [
41,
42]. Raw GPS returns were processed following the techniques of MacMahan et al. [
37].
3.1. Spatial Velocity Patterns
Surf-zone currents derived with WAMFlow from 17 min WAMs are compared side by side with drifter deployments in
Figure 5,
Figure 6 and
Figure 7. Estimated currents are temporally averaged velocities from the entire 17 min image recordings after removing returns identified by the steps discussed in
Section 2. Remotely sensed circulation patterns are presented as stream plots to facilitate comparison to in situ observations. Stream plots essentially highlight the expected flow paths that a drifter would follow if it were dropped anywhere within the remotely sensed domain. Note, however, that drifter deployments all occurred over time periods longer than 17 min and, thus, the derived WAM pattern may not have observed the specific conditions drifters experienced.
The time-averaged current prediction for 22 October 2019 at 15:30 (UTC) identifies a counter-clockwise gyre adjacent to the pier on similar alongshore length scales to the drifter behavior (
Figure 5). Predominantly positive alongshore velocities are also remotely sensed between yFRF = 700 m and 1100 m, where drifters consistently propagated in the alongshore within the trough between the sandbar and the shore break (
Figure 5). A convergence point is identified at yFRF = 1100 m and xFRF = 175 m, right in the vicinity of a stagnation point for a drifter, which consistently stayed within a 120 m × 60 m box for over an hour before being retrieved at the end of the deployment. Three drifters where ejected from the surf zone at yFRF = 1050 m, which is the only alongshore location within the optical current estimates where stream flow trajectories are pointed in the offshore direction at the outer edge of the surf zone.
Offshore directed stream trajectories are also resolved in the remotely sensed velocities for 30 October 2019 at 14:00 (
Figure 6) at a slight angle from north to south underneath the pier as well as at approximately equal alongshore distances away from the pier at yFRF = −100 m and yFRF = 1050 m. The angled rip under the pier matches the offshore trajectories of all of the drifters dropped into the water from the pier. After the drifters were ejected from the surf zone, they spent as long as 45 min in a region, where the optical estimates did not resolve velocities (outside of xFRF = 350 m between approximately yFRF = 400–500 m) but subsequently drifted back onshore across the sandbar and entered stronger alongshore flows in the trough. Divergences of alongshore flows at yFRF = 300 m and yFRF = 600 m are resolved in both the drifter trajectories and optical velocity estimates. Although the drifters rarely escaped the reciruclation cells north and south of the pier, the broader remotely sensed field highlights that the divergences in the trough are a consequence of feeder currents due to multiple rip currents in the domain.
Velocity estimates for 31 October 2019 at 17:00 further highlight that the method is capable of resolving complicated flow patterns inside of the breaker line (
Figure 7). Northward-directed longshore flows are resolved between the FRF pier and yFRF = 1100 m. Adjacent counter-rotating gyres are identified between yFRF = 1100–1300 m, in the same location that the drifters experienced a complicated recirculation before continuing in the alongshore. This particular WAM also reveals how the pattern returned is dependent on the assumption that the surf zone is saturated with residual foam. In this example, foam produced by the outer breaker is swept off in a swift longshore current before saturating the entire trough, resulting in few optical current solutions between xFRF = 150–200 m. Note that drifter tracks through this region show strong alongshore flows, highlighting the potential for false negatives from the optical flow measurements. However, in this case, our filtering mechanism correctly removes low confidence optical flow estimates in this region. Similarly, the deeper water under the pier results in less depth-limited breaking and less foam generation such that immediately 50 m north of the pier has less residual foam to track despite drifters in that region consistently being swept north at similar speeds to the rest of the surf zone.
Each of the drifter deployments in
Figure 5,
Figure 6 and
Figure 7 contain unique spatially varying behavior to assess the validity of WAM-derived surface currents. The optical flow algorithm clearly resolves 2D patterns spatially coherent with drifter tracks entrained in longshore currents, rip currents, gyres, and large recirculation cells. The similarities between flow field attributes and drifter behavior are striking. Even in regions devoid of drifter tracks, the remotely sensed product provides context for why drifters did not enter that region. For example, the stagnated drifter at yFRF = 1100 m in
Figure 5b is likely due to the southward directed currents resolved by the WAM between yFRF = 1100 and 1300. Similarly, the drifter tracks in
Figure 6b that end at yFRF = 200 m and yFRF = 900 m appear to be the due to convergences resolved in the remotely sensed pattern. It is noteworthy that the 1 m × 1 m pixel-sized WAMs capture both localized flow features on the scale of 10 s of meters and large-scale patterns on the scale of 100 of meters without any need for adaptive resolutions.
3.2. Velocity Magnitude Comparison
Figure 8 presents a velocity magnitude comparison for 22 October. Of the three days presented in
Section 3.1, this deployment included the greatest number of drifter tracks occurring within the shortest amount of time and co-incident with a WAM movie recording. Limiting the time-window of comparison to only while cameras were collecting reduced the drifter dataset by >75%; thus, it is assumed that the mean current patterns was consistent throughout the deployment. All observations during the drifter deployment were binned into a 15 m × 15 m grid regardless of time and averaged to obtain flow vectors. Optical flow current estimates were binned to the same grid to facilitate one-to-one comparisons (
Figure 8). Scatter within the one-to-one plots exhibits a correlation with respect to both cross-shore location and the number of drifter observations within each bin, suggesting that extremes are largely to blame for high error metrics (
Figure 8a–c). For example, if all alongshore velocities of the optical current are considered, then that results are biased lower relative to drifters by 40% and root mean square error (RMSE) of the total velocity magnitude is 0.22 m/s (
Figure 8a). However, longshore optical currents are consistently lower in magnitude relative to drifters outside of the surf zone (points greater than xFRF = 210 m in
Figure 8d–f), where trackable features such as residual foam are infrequent and optical flow often predicts zero velocities. Optical predictions also have greater residuals in the inner most portion of the surf zone; however, the large drifter velocities in this region reflect a higher frequency of drifters surfing waves due to the relatively shallower water depths and plunging breakers being the shore. The in situ drifter measurements considered as “truth” in this validation are thus unlikely a reflection of wave-averaged processes outside of the surf zone (points greater than xFRF= 200 m in
Figure 8d–f) and in the most inner portion of the surf zone (points less than xFRF = 150 m in
Figure 8d–f).
Velocity predictions from the middle of the surf (xFRF = 130–210 m) exhibit an alongshore RMSE of 0.15 m/s and a cross-shore RMSE of 0.13 m/s. Ultimately, the one-to-one comparison of wave-averaged processes is dependent on the degree to which the drifter measurements are truly representative of wave-averaged motions. More observations within a particular 15 m × 15 m grid cell result in a higher likelihood that the average is representative of mean flow, while bins with fewer observations tend to have greater discrepancies (
Figure 8d–f). Focusing on only those points with more observations (black dots) notably reduces the spread of the residuals. RMSE of only those total velocity magnitudes in the trough with more than 90 observations within the bin is 0.10 m/s (
Figure 8f).