Analysis of emergent patterns in crossing flows of pedestrians reveals an invariant of ‘stripe’ formation in human data

When two streams of pedestrians cross at an angle, striped patterns spontaneously emerge as a result of local pedestrian interactions. This clear case of self-organized pattern formation remains to be elucidated. In counterflows, with a crossing angle of 180°, alternating lanes of traffic are commonly observed moving in opposite directions, whereas in crossing flows at an angle of 90°, diagonal stripes have been reported. Naka (1977) hypothesized that stripe orientation is perpendicular to the bisector of the crossing angle. However, studies of crossing flows at acute and obtuse angles remain underdeveloped. We tested the bisector hypothesis in experiments on small groups (18-19 participants each) crossing at seven angles (30° intervals), and analyzed the geometric properties of stripes. We present two novel computational methods for analyzing striped patterns in pedestrian data: (i) an edge-cutting algorithm, which detects the dynamic formation of stripes and allows us to measure local properties of individual stripes; and (ii) a pattern-matching technique, based on the Gabor function, which allows us to estimate global properties (orientation and wavelength) of the striped pattern at a time T. We find an invariant property: stripes in the two groups are parallel and perpendicular to the bisector at all crossing angles. In contrast, other properties depend on the crossing angle: stripe spacing (wavelength), stripe size (number of pedestrians per stripe), and crossing time all decrease as the crossing angle increases from 30° to 180°, whereas the number of stripes increases with crossing angle. We also observe that the width of individual stripes is dynamically squeezed as the two groups cross each other. The findings thus support the bisector hypothesis at a wide range of crossing angles, although the theoretical reasons for this invariant remain unclear. The present results provide empirical constraints on theoretical studies and computational models of crossing flows.


Introduction
Collective motion in groups of humans, as well as other social organisms, has increasingly become a subject of analysis and modeling [1][2][3][4][5][6][7]. Currently, characteristic patterns of collective motion are understood as emergent behavior resulting from the collective dynamics of interactions between individuals. Studies of human crowd dynamics have important applications to improving pedestrian traffic flow, safety management, and the prevention of crowd disasters [8][9][10][11][12]. Analyses of real-life mass events have been used to model crowd behavior in situations such as religious gatherings, rock concerts, sporting matches, and transportation hubs [13][14][15][16], with a critical goal of averting life-threatening crushes, stampedes, and trampling [14,17,18]. A first step to successful modeling is a better understanding of actual crowd behavior by analysis of crowd dynamics and pattern formation in human data. In this paper, we develop a computational analysis of spontaneous stripe formation in crossing flows of pedestrians.
Pedestrian traffic flow has been studied empirically in a wide variety of situations, using both experimental methods and motion tracking of real crowds. The simplest case is unidirectional flow in a corridor, in which properties such as the dependence of speed on density have been analyzed [19][20][21][22][23][24]. Collision avoidance between pedestrians has been investigated in pairs of walkers [25,26] and multiple walkers [27]. Bottlenecks occur when a large group attempts to pass through a narrow opening [21,[28][29][30][31][32][33], as in Black Friday sales or fire emergencies, which can lead to jamming and crushes. Other empirical studies have examined pedestrian flow through a T-junction [34,35], bidirectional flows [36], multi-directional flows [37,38], a pedestrian crossing through a dense static crowd [39,40], and a bottleneck leading to a 1D corridor [41].
Crossing flows can be described as two streams of pedestrians walking in different directions, passing through each other at a crossing angle α > 0˚(where 0˚is walking in the same direction). Many real-world situations produce crossing flows, such as streams of pedestrians crossing at a sidewalk intersection, or subway commuters passing each other when entering and exiting a metro car. A special case of crossing flows, called counterflow, occurs when the crossing angle is 180˚. Self-organized spatial patterns have been observed when two groups cross each other. In counterflow, the formation of stable lanes is regularly reported in both human experiments [3,38,[42][43][44][45][46] and numerical simulations [47][48][49][50][51][52][53][54][55][56][57][58][59], in which alternating lanes of pedestrian traffic are aligned with the walking directions of the two groups (180å part). A jamming transition can occur above a critical flow density [49,53,56,57]. More generally, at other crossing angles the formation of stripes is observed, but the alternating stripes are not aligned with the walking directions of the two groups. The familiar case of orthogonal flows (α = 90˚) has been widely studied [60], and the formation of diagonal stripes is found in human crowds [55,61] and in simulation [42,54,55,[62][63][64][65][66][67]. In a recent study, body orientation of crossing flows of agents has been explicitly measured to study its dependence on density [68]. However, the analysis of striped patterns in crossing flows of humans at other crossing angles remains underdeveloped.
Naka [61] first reported stripes at acute and obtuse crossing angles in pedestrian crowds, and hypothesized that stripes form at an orientation that is perpendicular to the bisector of the crossing angle. Abstractly, a stripe is a traveling wave that moves in the mean direction of the two flows, such that individual pedestrians travel forward with a stripe and laterally within it [43]. A striped pattern facilitates overall pedestrian flow by reducing collision-avoidance maneuvers, thereby increasing the average walking speed. Only a few subsequent human studies have tested oblique crossing angles [69][70][71], but stripe patterns were not analyzed. The bisector hypothesis thus remains to be tested experimentally.
Striped patterns in oblique crossing flows have been reproduced in simulation, consistent with the bisector hypothesis [43,72]. In one system, the inclination of the stripe to the bisector was found to increase with the velocity difference between two orthogonal flows [54]. The mechanism responsible for the formation of self-organized stripes in orthogonal flows has been studied theoretically [64][65][66][67]. A mean field analysis shows the underlying mechanism to be a linear instability of the randomly uniform state in the intersecting region compared to the formation of diagonal striped patterns [64,66,67]. The 'wake' of a pedestrian has been proposed as the microscopic mechanism for stripe formation, a density perturbation created in the perpendicularly moving flow [65]. The inclination of the striped patterns was related to the velocity difference between the two groups, producing a 'chevron' effect [64,66]. Absence of striped patterns has also been observed when three or more groups of people intersect [73][74][75].
The purpose of the present research is to experimentally test the bisector hypothesis by analyzing stripe formation at a variety of crossing angles, without spatial constraints. We seek to answer several theoretically-motivated questions: (i) Can stripe orientation be predicted as perpendicular to the bisector for all crossing angles? (ii) Do other stripe properties depend on crossing angle? (iii) What are the stripe dynamics during crossing flows? (iv) Does spontaneous stripe formation generalize from continuous crossing flows in defined corridors to small crowds without boundary conditions on spatial position, density, or visibility?
We addressed these questions as part of the PEDINTERACT Project [39], in which two different sets of subjects participated (36 on Day 1, 38 on Day 2). The setup appears in Fig 1 (also see S1 Video). In the experiment, two groups of participants (18 or 19 per group) walked through each other at seven different crossing angles (0˚to 180˚, at 30˚intervals); there were approximately 17 trials per angle. On each trial, the groups were positioned in two starting boxes oriented at the designated crossing angle, and were instructed to walk in the direction they were facing to the other side of the room. To investigate whether striped patterns would emerge in the absence of spatial boundary conditions, we did not use opaque corridors as in many previous studies [43,62,64,70]. Head position was recorded with a motion-capture system at 120 Hz. Sample traces for all pedestrians in a typical trial appear in Fig 2. Because the empirical analysis of crossing flows is quite underdeveloped, we describe a number of computational methods for analyzing the characteristics of stripes in human data.
In particular, we present a novel approach to identify the formation of stripes, called the Edgecutting algorithm. Using this algorithm we were able to measure the local properties of individual stripes such as their orientation, width and size. We also use an independent method to characterize global stripe properties, a pattern matching technique that fits a two dimensional sinusoidal function (e.g. Gabor function) to the positions of pedestrians in the two groups. This method assumes the existence of a periodic pattern of stripes and then finds the geometric properties of the pattern from a fitting procedure. The two methods are complementary, in the sense that the edge-cutting algorithm requires the whole history of the crossing and provides the full dynamics of the stripes, whereas the pattern matching method can be performed on a single snapshot. The stripe orientations obtained by the edge-cutting algorithm and the pattern matching technique are compared to each other, and to the hypothesis that the stripes are perpendicular to the bisector of the crossing angle.
In sum, the present paper makes two major contributions: (i) we present experimental data on crossing flows of pedestrians that support the bisector hypothesis, and (ii) we introduce  and discuss methodological tools to detect the formation and presence of striped patterns and to estimate their geometric properties.

Results
When two groups of people cross each other, striped patterns emerge, as schematically illustrated in Fig 3. The primary goal of the present research was to characterize the properties of these emergent stripes, based on numerical analysis of participant trajectories. The actual crossing angle α between the mean walking directions of the two groups was measured from the data. The properties of stripe orientation γ relative to the crossing angle bisector, and stripe spacing λ are illustrated in Fig 3 (right). We begin by introducing two independent computational methods devised to analyze the geometric properties of the stripes, (i) the Edge-cutting algorithm and (ii) the Pattern-matching technique.

Identifying stripes using edge-cutting algorithm
For purposes of the first method, we define a stripe as a subset of participants from one group that is not penetrated by participants from the other group. Specifically, the virtual connections or edges between the participants in a stripe are never crossed or 'cut' by the trajectory of a participant from the other group. The principal output of the Edge-cutting algorithm is the identification of the participants who belong to each stripe (see Materials and method for details). This analysis indeed revealed the spontaneous emergence of striped patterns and the stripes were successfully identified. The dynamics of stripe formation was also observed, as illustrated for two typical trials in Fig 4. The Edge-cutting algorithm also yields the time of the initial edge-cut T i at the start of crossing (left column of Fig 4) and the time of the final edgecut T f at the end of crossing (right column of Fig 4). Animations of the Edge-cutting process for these two trials appear in the supplementary material (S2 and S3 Videos). Formation of stripes as a consequence of two groups crossing each other. In this schematic diagram the crossing angle between the two groups is α. The figure has been shown for three instances viz. before crossing (T 1 ), during crossing (T 2 ) and after crossing (T 3 ). The two groups before crossing are denoted by blue and red squares, whose direction of motion is denoted by arrows of the same color. The green dotted arrow denotes the bisector of the crossing angle. The orientation γ of the stripes is measured counter-clockwise from the bisector. λ is the spatial separation between two stripes from the same group. For specific definitions of γ and λ see Fig 6. https://doi.org/10.1371/journal.pcbi.1010210.g003

Characterizing stripes using pattern-matching technique
The Pattern-matching technique estimates the orientation and width of a set of stripes, assuming that the stripes are parallel and equally spaced. This method fits a two-dimensional spatial frequency function f, based on a sinusoidal Gabor function, to the positions of pedestrians at a time T. The free parameters of orientation γ, wavelength λ, and phase ψ, are chosen by maximizing C, the fit of the function to pedestrian positions, where positive values (peaks) are assigned to one group and negative values (troughs) to the other (see Materials and methods for details). The fitting can be applied to all pedestrians or to a subset (e.g. one group). The output of this fitting procedure for all pedestrians in two representative trials appears in Fig 5, where � g and � l refer to the orientation and wavelength of stripes in the whole crowd. The two methods are complementary. The edge-cutting algorithm requires the whole history of the crossing event and yields in return the full dynamics of stripes. It estimates the local spatial properties of individual stripes at each time point, without assuming any prior knowledge about them. The pattern-matching technique requires only a single snapshot, and recovers the global spatial properties of orientation and wavelength. The prior assumptions of parallel, equally spaced stripes help to match the instantaneous pattern, as long as the actual stripes are close to this ideal. We will see now how both approaches allow us to gain insight into the striped structure.

Stripe orientation
Based on previous empirical observations and modeling, there are reasons to expect that the observed stripes would be parallel and perpendicular to the bisector of the crossing angle, as illustrated in Fig 3. This bisector hypothesis thus predicts γ = 90˚for all crossing angles α.  However, it is possible that the stripes for one group (blue in Fig 3) are not parallel to those for the other group (red), such that γ blue 6 ¼ γ red ; also that individual stripes within a group are not parallel. We thus estimated the orientation of stripes using the global and local methods: (i) the Pattern-matching technique allowed us to estimate the overall stripe orientation � g (Fig 6a), as well as the orientation for each group separatelyg L andg L , (Fig 6b); (ii) the Edge-cutting algorithm enabled us to estimate the orientation of individual stripes γ L and γ R , (Fig 6c). We report each of these measurements of stripe orientation in turn. Global stripe orientation � g andg using the Pattern-matching technique. In the first analysis, we estimated the overall orientation of all stripes � g to the bisector, on the assumption that the stripes for the two groups were parallel and equally spaced (see Fig 6a), using the pattern matching technique. The analysis was performed at a suitable time T between the crossing midpoint (T i + T f )/2 and the final crossing point T f , when the periodic pattern of stripes was most clearly defined (see Discussion). The resulting values of � g are represented in box plots in Fig 7a (blue bars). Note that the median values are very close to the predicted angle of 90˚for all crossing angles, with deviations less than 3˚in all conditions. A set of t-tests comparing the mean value of � g to 90˚at each crossing angle was significant only for α = 63.8˚, t(17) = −2.550, p = 0.0207; no other conditions were significant. Overall, this finding is consistent with the bisector hypothesis. A one-way analysis of variance (ANOVA) on � g was also performed, with crossing angle α as the factor (excluding the 0˚condition). The result found that stripe orientation did not depend significantly on crossing angle, F(5, 99) = 2.301, p = 0.0504, η 2 = 0.1.
The second analysis added one degree of freedom by estimating the orientation of the stripes to the bisector for each group separately ðg L ;g R Þ, on the weaker assumption that only the stripes within one group are parallel. We thus fit the sinusoidal function f to the pedestrian positions separately for the two groups, yielding estimates of stripe orientationg L for the The arrows in blue and red represents the direction of motion of the two groups. The schematic diagrams are shown for an arbitrary crossing angle. The dashed green arrow indicates the bisector of the crossing angle between the two group direction vectors. The lines in blue and red show the stripes from the two groups. γ is the angle between the direction of stripes and the bisector of crossing angle, always measured counterclockwise. (a) Estimation of orientation � g of the stripes and physical separation � l between two stripes from the same group using the parametric sinusoidal fitting. In doing this calculation it was assumed that stripes from the two groups are parallel to each other and are equispaced, as shown in the figure. (b) Orientation of the stripes from the two groups when we assume that stripes from the same group are parallel to each other and are equispaced.g L andg R denote the orientation of stripes whose group direction vectors are left and right to the direction of bisector respectively. Using the same convention,g L andg R are the spatial separation between the stripes in those cases. This calculation was also done by fitting the two dimensional sine curve. (c) Estimation of orientation of the individual stripes that were found using the edge-cutting algorithm, for the two groups. γ L or γ R denote the orientation of individual stripes whose group direction vector is left or right to the direction of bisector respectively.
https://doi.org/10.1371/journal.pcbi.1010210.g006 group heading to the left of the bisector, andg R for the group heading to the right (Fig 6b). We first estimated these values at the same instant that the overall orientation � g was estimated, and the results appear in the boxplots in Fig 7a (brown and orange bars). The median values are again close to 90˚for all but one crossing angle, although the variability is greater because only half the pedestrian data contributed to each fit. One-way ANOVAs found no influence of crossing angle ong L , F(5, 100) = 0.614, p = 0.689, η 2 = 0.029, or ong R , F(5, 100) = 0.521, p = 0.76, η 2 = 0.025. The within-trial difference betweeng L andg R is represented in Fig 7b. The median values at each crossing angle lie close to 0˚, and the deviations are less than 5˚. A set of t-tests comparingg L Àg R to 0˚at each crossing angle found no significant differences (all p's > 0.1), indicating that the stripes for the left and right groups tend to be parallel within a trial.
We then calculatedg L andg R as a function of time, and obtained the time-average of these quantities, hg L i t and hg R i t , during the interval (T i + T f )/2 to T f for each time frame of our data (see Discussion). Boxplots of the time-averaged values appear in Fig 8a. Median angles are again close to the expected value of 90˚for both left and right groups, with deviations less than 8˚for acute crossing angles and less than 2˚for obtuse angles. One-way ANOVAs did not find a significant effect of crossing angle α on either hg L i t , F(5, 100) = 0.934, p = 0.462, η 2 = 0.045, or hg R i t , F(5, 100) = 0.399, p = 0.848, η 2 = 0.019. A set of t-tests comparing hg L Àg R i t to 0˚at each crossing angle found no significant differences (all p's > 0. 16). A series of one-sample Kolmogorov-Smirnov tests have also confirmed that hg L Àg R i t follows a normal distribution (all p's > 0.47). The data for hg L Àg R i t has been shown as boxplots in S8 Fig. Together, these results indicate that the stripes formed by the two groups are generally parallel and perpendicular to the bisector of the crossing angle, as measured by the pattern-matching technique.
Individual stripe orientation (γ L and γ R ) based on the Edge-cutting algorithm. Finally, we performed an analysis of each individual stripe based on the output of the Edge-cutting algorithm. The orientations of stripes in the left and right groups are denoted γ L and γ R , respectively (see Fig 6c). We first measured these values at the same instant that the overall orientation � g was estimated, and the results appear in the boxplots in Fig 7a (light-green and dark-green bars). The medians for individual stripes are again close to the expected value of Because the configuration of stripes changed over time (e.g. Fig 4), we also measured the individual stripe orientations at different time points and computed time-averaged values, hγ L i t and hγ R i t , during the interval (T i + T f )/2 to T f for each time frame of our data. The results of this analysis appear in the boxplots in Fig 8b. Although there is much more variability in individual stripe orientations than in the pattern-matching estimates (Fig 7a), the median values for both left and right groups are again quite close to the expected value of 90˚, consistent with the bisector hypothesis.

Other stripe properties
We also used the global and local methods to estimate other geometric properties of the observed stripes, including their physical spacing, width, number, and size (number of pedestrians per stripe).
Stripe spacing (λ) using the pattern-matching technique. We used the Pattern-matching technique to estimate the spacing of stripes, on the assumption that the stripes in the analysis are parallel and equally spaced. The physical separation between the centers of stripes corresponding to the same group was estimated by the wavelength λ of the sinusoidal function f, which was fitted to the pedestrian position data as described in the previous section. The first analysis fit the data from the whole crowd to obtain � l, the overall spacing between stripes from the same group (see Fig 6a), at the same instant that the overall orientation � g was estimated.
The results appear in the boxplot in Fig 9a (blue bars). The median is near 2m at most crossing angles, but drops to 1.3m in the counterflow condition. A one-way ANOVA found that � l depended significantly on crossing angle α, F(5, 100) = 3.426, p = 0.0067, η 2 = 0.15. A trend analysis revealed significant linear through 5 th -order trends (all p's < 0.01), indicating that the relationship was irregular, not monotonic (see S3 Fig). In the second analysis, we fit each group independently to estimate the stripe spacing for the left and right groups,l L ,l R (see Fig  6b), at the same instant. These results also appear in Fig 9(a) (brown and orange bars), and exhibit a similar drop in stripe width in the counterflow condition. One-way ANOVAs found a significant effect of crossing angle onl L , F(5, 100) = 3.817, p = 0.0033, η 2 = 0.16, but not onl R , To compare the overall spacing of the crowd with the separate spacing in each group, we computed the absolute difference between them on each trial, j � l Àl L j and j � l Àl R j. The median differences (Fig 9b) are generally between 0.5m and 1m for acute and orthogonal crossing angles, but less than 0.2m for obtuse crossing angles. One-way ANOVAs confirmed that these differences significantly depended on crossing angle: for j � l Àl L j, F(5, 100) = 3.648, p = 0.0045, η 2 = 0.154; for j � l Àl R j, F(5, 100) = 5.796, p < 0.001, η 2 = 0.224. Finally, we compared the stripe spacing in the left and right groups on each trial by computing the time-average of the difference hjDlji t ¼ hjl L Àl R ji t , during the interval (T i + T f )/2 to T f for each time frame of our data. The results suggest that stripe spacing differed between groups by more than 0.6m at acute crossing angles, but by less than 0.4m at larger angles (Fig 9c). A one-way ANOVA on hjDlji t confirmed a significant dependence on crossing angle, F(5, 100) = 4.26, p = 0.0015, η 2 = 0.175.

Stripe width, number, and size based on the edge-cutting algorithm
To characterize the dynamic behaviour of the stripes as the two groups crossed, we analyzed the variation in stripe width as a function of time. Precisely, we wanted to investigate the dynamic adjustments made by the pedestrians within a stripe to accommodate the incoming pedestrians from the other group. Once individual stripes were identified with the Edge-cutting algorithm, the width of each stripe was estimated by constructing a minimum bounding box for the stripe and taking its width dimension (see Materials and methods). The dynamic variation in stripe width is plotted as a function of scaled time in Fig 10 for two different trials. Stripe width decreases at the onset of edge-cutting (time = 0) to a minimum before the last edge is cut (time = 1) and then increases again, as if the stripes are 'squeezed' in space during the crossing interval.
The Edge-cutting algorithm also enables us to analyze the number of stripes that emerged during group crossing. The mean number of stripes decreased monotonically as the crossing angle α increased, as represented in Fig 11. This finding implies that stripe size (number of pedestrians per stripe) conversely increased with crossing angle, as suggested by the graph in S5 Fig. Overall, the size of the identified stripes ranged from 1 to 15 participants in this study.

Discussion
In this section we discuss the formation of striped patterns and their geometric properties as observed and estimated from our experimental data. This is followed by an evaluation of the two computational methods we used to derive our findings.

Did we observe stripe formation?
Analyzing the formation of stripes was the main goal of this research. In our experiments, we found that stripe formation occurs even in small groups of pedestrians with fewer than 20 members, crossing in different directions without spatial constraints. This demonstrates that continuous flows in constrained channels are not necessary for self-organized pattern formation, which can be attributed to local interactions. We should point out that, there could have been a number of outcomes. For example, the two groups could have avoided without even penetrating each other, resulting in no formation of stripes. Large difference in velocities of the two groups could result in this scenario; thus the velocity of the two groups plays a crucial role in this context. Another possibility might be that crossing groups produced single isolated pedestrians, i.e., all the virtual connections between the pedestrians from one group were destroyed by pedestrians from the other group. This situation would also result in absence of stripe formation. The two groups avoiding each other and the isolation of single pedestrians are the two extreme possibilities of outcomes from our experiments. In reality we saw that the two groups indeed penetrate each other. The edge-cutting algorithm revealed the groups of around 20 participants, divided into 4 to 7 subgroups, as shown in Fig 11. This confirms that not all pedestrians from a group end up being isolated as a consequence of crossing. The identification of the participants belonging to a stripe was then used to calculate the orientation and width of the stripe. Several examples of the edge-cutting process are shown in Figs 4 and 12.

Do the stripe properties depend on crossing angle?
We were primarily interested in the effect of crossing angle on the orientation γ of the stripes with respect to the bisector of the crossing angle. Based on previous observations and simulations, the expected value of γ = 90˚should be invariant over different values of crossing angle α. The results obtained from our experimental data using several methods of measurement are shown in Fig 7a. The deviation of the median value of γ remained less than 3˚at all crossing angles, which is in good agreement with the bisector hypothesis.

PLOS COMPUTATIONAL BIOLOGY
Spatial separation λ between two stripes from the same group was output from the pattern matching technique. We compared the values of λ estimated using whole-crowd and separategroup analysis in Fig 9a as a function of α. Estimations of individual stripe properties based on the Edge-cutting algorithm revealed that the mean number of stripes that emerges from a group decreases with α, as shown in Fig 11. This implies that the mean size of a stripe should show an increase with α. In S5 Fig we  have shown the plot of mean size of a stripe as a function of the crossing angle α. The mean stripe size indeed increases with α. Thus the edge-cutting algorithm is very useful to establish the dependence of individual stripe properties on the crossing angle.

Comparison of assumptions and results for the whole-crowd and separategroup analyses using the pattern matching technique
To perform pattern matching using a two dimensional sinusoid we make two different assumptions about the formation of stripes. In our analysis of finding � g and � l, we assumed that the orientation of the two groups are parallel to each other and the stripes formed are periodic and equispaced. However we kept in mind that in reality this might not always be true. The orientation of the stripes for the two groups could be different and have different spacing. Thus, in a preliminary analysis we estimated stripe orientationg and their physical separatioñ l for the two groups separately as a function of time. In this approach we assumed that the stripes within one group are parallel to each other and equispaced. The time window which was selected for this analysis was from T i to T f . The two timescales T i and T f were estimated from the Edge-cutting algorithm, and they approximately denote the beginning and end of interaction, between the two groups.
g andl for each groups show some fluctuations near T i i.e. when the stripes have just started to form (see S4 Fig). The fluctuations reduce with time and the values ofg andl approach a more steady value near T f i.e. when the stripes have been formed. Thus we calculate hg L i t and hg R i t , i.e., the time averages ofg L andg R (shown in Fig 8(a)) and the time-averaged difference hjDlji t ¼ hjl L Àl R ji t (shown in Fig 9c) from (T i + T f )/2 to T f i.e. wheng andl remain approximately steady.
The differences of median values of hg L i t and hg R i t from the expected value of 90˚are less than 2˚for cases with an obtuse angle, and less than 8˚for cases with an acute crossing angle with no statistical effect of crossing angle. This approximately justifies our earlier assumption about the orientation of stripes from two groups being parallel to each other. The time averaged difference in stripe spacing between the two groups hjDlji t also shows low median values-less than 0.8 m for all the crossing angles. This also justifies our assumption of equispaced stripes from two groups when using the pattern matching technique.
We also make a comparative analysis of the differences in values of physical spacing of the stripes at the same time instant obtained by whole-crowd and separate-group analyses under the pattern matching technique. The results for j � l Àl L j and j � l Àl R j are shown in Fig 9b. The median values of the differences are less than 0.2 m for obtuse crossing angles, but are higher for acute crossing angles.
There was a possibility of 'chevron' effect to create the differences in observed values ofg L andg R . But due to the small size of our groups, the pedestrians might tend to move faster while leaving the crossing region-resulting in the absence of chevron effect. The non-uniformity in the velocities of the agents both within the group and across the groups could also lead to deformation of stripes. One explanation could be the duration of time when the two groups keep interacting with each other. For lower values of α this duration is higher (see S6 Fig), which results in deformation in the symmetric structure of the stripes. There could also be an effect of the size of the environment where the experiments were performed. Because of limitation of space used for the experiments, the two groups start interacting immediately after the commencement of trials for lower crossing angles. So there is a possibility that the agents participating for trials with acute crossing angle (e.g. 30˚) are still accelerating when reaching the crossing region, which clearly is not the case for trials with higher crossing angles. To investigate this further one needs to perform an analysis with larger number of people in a bigger environment and eventually, with a flow of people-not just two groups crossing each other.
To analyse the statistical dependence of obtained results on the two methods under pattern matching technique we performed ANOVAs for each of the crossing angles separately. For � g, g L andg R ANOVAs reveal no dependence of these quantities on the two methods for each of the crossing angles. For each of the cases the p-value is greater than 0.145. For � l,l L andl R , the results were seen to be statistically independent of the two methods except for the case α = 89.8˚, as could also be seen from

Comparing results between pattern matching technique and the edgecutting algorithm
Using the edge-cutting algorithm we have conducted a per-stripe analysis, where properties of individual stripes were studied. This helps us in a minimal way to explore the apparent asymmetry in the stripes from the two groups, which has been discussed earlier. The edge-cutting algorithm gives us the knowledge of stripes formed viz. the pedestrians belonging to a stripe. Using this output we compute the orientation and width of each of the stripes by implying rotating calipers algorithm (see Materials and methods). The orientations γ L and γ R were computed as a time series. The time averaged orientation hγ L i t and hγ R i t were computed in the time interval (T i + T f )/2 to T f . The boxplots over all the stripes and all the trials are shown in Fig 8b. The difference of the median values of these average quantities from the expected orientation (90˚) are less than 5˚for obtuse crossing angles, but are a bit higher for acute crossing angles-a trend similar to previously discussed observations. The values of γ L and γ R computed at the same instant as when � g were computed, are shown in Fig 7a. In all the cases we observe that for obtuse crossing angles the stripe orientations obtained by the edge-cutting algorithm are not very different from that obtained by the pattern matching technique. However, for the acute crossing angles the differences are a bit higher-possible for reasons which have already been discussed. The width of the stripes as estimated from the per stripe analysis are not actually comparable to the physical separation of the stripes as computed by pattern matching technique. The stripes consisted of different numbers of people-this causes an irregularity while we attempt to compute their individual orientation. As a consequence, it would be inappropriate to compare these values with the outputs of the pattern matching technique, where the symmetry and periodicity of the stripes were assumed. However, we see that the median values of the average quantities hγ L i t and hγ R i t are not very far (approximately within 10˚for all crossing angles) from the expected value (90˚), which was computed assuming the symmetry and regularity of the stripes. This shows consistency across the methods that we have used to study stripe properties.

Why did we use two different methods?
The two computational methods that we present in this paper have never been used before to study striped patterns in crossing flows, to the best of our knowledge. We used the two methods, viz. the edge-cutting algorithm and pattern matching technique, to study the formation and geometric properties of the stripes. The edge-cutting algorithm takes into consideration the entire trajectories of the pedestrians, whereas for the pattern matching technique the instantaneous positions of the pedestrians are sufficient. Only the edge-cutting algorithm can identify a stripe and the pedestrians belonging to it. This yields a better definition of individual stripes and allows refined analysis of individual stripes, and is thus a spatially local method. Besides, this algorithm provides the full dynamics of individual stripes, and is the most appropriate to study dynamical effects such as the 'squeezing effect' of Fig 10 that we shall discuss shortly after. When the stripes are very small (less than 3 participants) or are not sufficiently elongated (see Materials and methods), their geometric properties are not well defined and we excluded them from our per stripe analysis. On the other hand, the pattern matching technique uses a two-dimensional parametric sinusoid and is thus a spatially global method. This idea was inspired by Gabor functions, which have been used to model the spatial frequency response of the mammalian visual system [76]. We assume the existence of a periodic pattern of parallel stripes and then use this method to look for it; these assumptions have been borne out by the similarity of orientation and spacing when measured in the whole crowd and separately for the two groups. For our small-scale data the pattern matching technique is essential to study the orientation of the stripes.

How efficient is the pattern matching technique?
The pattern matching technique that we have used to find the orientation γ of stripes and their spacial separation λ, was based on maximising C. C is obtained by fitting a two-dimensional sinusoid f on the coordinates of the pedestrians (see Materials and methods). Therefore C could be treated like a scoring function which indicates the quality of fitting. For the case when we assume that stripes from the two groups are parallel to each other and alternately equispaced (to find � g, � l), the maximising function is denoted by � C and when we fitted the two groups separately (to findg,l), this function was denoted byC.
Importance of C and λ. For best fittings one would get � C ¼ � C max ¼ 2 andC ¼C max ¼ 1, and for the worst case (disordered input points) the sinusoidal function would not fit-it would either over-fit or under-fit the data points. Over-fitting or under-fitting could be identified by the obtained value of spatial separation λ between the stripes. The obtained value of λ was therefore very crucial to justify the pattern matching technique. From edge-cutting algorithm one could have an approximate idea of the spatial separation between two stripes for a trial (see Materials and methods). λ would be very low or very high compared to this approximate value in case of over-fitting and under-fitting respectively. The quality of the pattern matching technique is therefore estimated both in terms of C and by the optimised value of λ. Estimating residual error of the fitting. To study the accuracy of the pattern matching procedure to find � g and � l, we calculate the residual errors. Ideally one would expect all the data points to lie within the distance À � l=4 to � l=4, where � l is the wavelength of the fitted sine curved f. We calculated the residual error of pattern matching technique as the distance of the data points from the crest or trough of the fitted sine function f. The results are shown in Fig 14. The normalised distribution of this distance shows a Gaussian peak at the origin. We fit the data for each of the cases using the functional form of Gaussian distribution. From the fittings, we estimate the standard deviations. For α = 179.9˚the standard deviation of the fitted curve was 0:134 � l and for the remaining crossing angles this value is 0:184 � l on average. From the data of residual error, we found that for α = 179.6˚, 92.4% of the data points are accumulated between the distances À � l=4 and À � l=4, and for the remaining crossing angles, on an average 85.3% of the data is within this range. This surely establishes the efficiency of pattern fitting to a great extent. Besides, this also underlines a difference in stability between lanes and stripes (discussed later).
Periodicity of the two groups. The periodic arrangement of stripes that are seen to form in our experiments have been a point of concern for the pattern matching technique. An important aspect of our pattern fitting procedure is to choose the instant of time for which the position of pedestrians are considered and fitted. For higher values of α this instant is usually when all the edges have been cut and all possible clusters have been formed, which is T f -an output from the Edge-cutting algorithm. However, for lower values of α the periodicity of the two groups of pedestrians appears to be destroyed at T f . For such trials, a suitable time is chosen which is less than T f but higher than (T i + T f )/2. The principal motivation of choosing such a time-scale is to protect the periodicity of the two groups and to ensure the formation of stripes up to such an extent that the position of pedestrians could be considered for sinusoidal fitting (see Materials and methods). In Fig 5 we have shown pedestrian positions from the two groups for two typical trials and the fitted sine curves f, demonstrating the periodicity of the stripes.

Comparison of lanes and stripes
The striped patterns that are seen for counter flows (i.e. α = 179.6˚for our case) are known in the literature as lanes. Our results confirm that lanes (which are parallel to the direction of motion) are more stable than stripes (which in general are not aligned with the direction of motion). From Fig 9, we see that all λ measurements coincide better for counter flows and for this structure, the pedestrians accept a lower distance between the lanes (minimum of λ). Typically the distance between neighboring stripes is of the order of 0.8 to 1.1 m when the motion of pedestrians is not parallel to the direction of the stripes. While for lanes, the distance between the centers of lanes is rather 0.6 m-which, given the width of pedestrians, seems close to the minimum possible value if pedestrians intend to avoid collision. Higher stability of lanes compared to the stripes was also established when we estimate the residual error of sinusoidal fitting. We found that, 7% more of data points lie between the expected range for counter flows, than compared to the other crossing angles, as could also be seen from Fig 14. In Fig 15 we show all the stripes for a typical trial of counterflow. We also show the minimum bounding boxes of each stripe that has been computed using the Rotating Calipers algorithm for per-stripe analysis (see Materials and methods for details).

Squeezing behaviour of the stripes: Future investigations
The macroscopic dynamics of the stripes, accessible thanks to the edge-cutting algorithm, also show intriguing behaviour. When the two groups cross each other, the stripes that are formed get 'squeezed' in order to accommodate in space the incoming group. Microscopically, each of the pedestrians within a stripe adjust their motion when they encounter a pedestrian from the opposite group. In Fig 10 we  decreases, attains a global minimum and then increases again. This indicates some interesting underlying microscopic behaviour of the agents, which results in the squeezing behaviour as a macroscopic property of the stripes. In our subsequent research we would be interested to determine the underlying mechanism responsible for this behaviour. It would also be appealing to find out whether a following behaviour is present among the pedestrians leading to the formation of stripes, which we plan to work in our next research.

Conclusion
We conducted experimental trials for crossing flows of pedestrians without any spatial constraints of motion. In spite of having small number of participants we observed the formation of emerging striped patterns for each value of the crossing angle. Edge-cutting algorithm was implemented to detect the formation of stripes. Striped patterns for counter flows i.e lanes are seen to be more stable than those for other crossing angles. We have used a pattern matching technique and the edge-cutting algorithm to study a few properties of the stripes formed and compare them with each other and with hypothesized effects. The observed values for the orientation of stripes from edge-cutting algorithm are in good agreement with the expected result which justifies that our assumption about the regularity and symmetry of the striped patterns are reasonable enough. The maximised values of � C as obtained by us signify the regularity of the striped patterns from the two groups. While performing numerical simulations to model the scenario of crossing flows, the quantity � C would act as a parameter to evaluate the effectiveness of the simulation technique in reproducing the observed behaviour. We not only confirmed that stripe orientation is predicted by the bisector hypothesis at all crossing angles, but we also discovered several unexpected effects. First we showed that the average number of stripes within a group decreases with the crossing angle alpha. Second, we found that the spacing, number, and size of stripes depended significantly on crossing angle. Third, we observed a squeezing effect visible in the time evolution of the stripes. The macroscopic dynamics of the stripes motivates us to study the microscopic behaviour of the individual pedestrians as our next investigation.

Ethics statement
The ethical approval for using live participants was obtained from The Operational Committee for the Evaluation of Legal and Ethical Risks (COERLE-n˚2016-008). The document could be found at S1 Document. Written consents were taken from the participants who volunteered for the experimental trials.

Experimental details
The participants of the experiments were divided into two groups (with similar spatial densities). They were instructed to move along a direction which was announced before the commencement of each trial, such that the two groups cross each other at a particular angle. For 7 different expected values of crossing angles, viz. [0˚, 30˚, 60˚, 90˚, 120˚, 150˚and 180˚], we performed approximately 17 trials at each angle, a total of 116 trials (See Table 1). During each trial the head trajectory of each pedestrian was recorded as a time series. Each trial lasted about 15-25 seconds. The experiment was performed in a rectangular hall (20m × 30m) with a tracking area of 15m × 20m. The positions of the pedestrians were recorded at 120 Hz using VICON-an infrared camera system. The pedestrians were equipped with head-mounted reflective markers detectable by the VICON motion capture system. The center of the tracking was considered as the origin of a two-dimensional Cartesian coordinate system, which was used as a reference to represent the position of the pedestrians at every time step. Table 1 summarizes the various details of the experiments, i.e. the number of pedestrians and number of trials for each value of the crossing angle. In Fig 16 we have schematically shown our experimental set-up.
For our experiments, we searched for participants on campus of University of Rennes, France. The participants had no visual or locomotive impairments. The experiments were performed over 2 days. On the first day, we could gather 36 participants and on the next day the number was 38. These two numbers are very close to each other and we did not find any effect of this on our results. If the size of the groups were much larger, the characteristics of the stripes formed would be different too. But 36 compared to 38 is so little, that we can assume that it makes no difference. It would certainly be interesting to bridge between our small-scale study and with a larger group of people or even a continuous flow of people.
The participants were unaware of the actual motivation of the experiments. The participants were recruited using a mailing list that is usually utilized to search for volunteers, mostly from the campus. It is indeed true that we could not eliminate the possibility that some participants might know each other. Importantly, however, they were not allowed to communicate during the experimental trials, and we did not observe any obvious sign of communication between the participants. At the beginning of each day we assigned a random number to each of the participants and then they were divided into groups based on ranking. After half of the trials, we switched the group assignment strategy depending on odd or even numbers. This was done to minimize the likelihood that familiarity would influence stripe formation. In addition, participants were instructed not to stand near their friends, although we could not verify whether this request was obeyed. Thus the random partition of groups was crucial to reduce the effect of familiarity on our results.
The direction of motion was facilitated by visual references that were drawn by tape on floor of the hall. For each trial, the two groups of participants were initially located within a square shaped region. These squares on the floor of the hall were drawn by dashed lines and could be seen in Fig 1 (also see S7 Fig). The participants were instructed to 'walk straight across the room and pass through another group of participants'. The orientation of the departure square of each group was giving a complementary hint about the direction to follow. In Fig 16 all the square shaped boxes are shown which were drawn on the floor of the hall to act as visual references for the motion of groups.
The data obtained from the experiments were low-pass filtered to reduce oscillations due to the gait movement of the walking pedestrians. We used a forward-backward 4-th order

Observed values of crossing angle α
During the experiments the participants followed visual references for their movement, instead of a secluded corridor. As a consequence the actual direction of motion of the groups and hence the actual value of the crossing angle is a bit different from what it was expected i.e. the expected values. Therefore we calculate the observed values of crossing angle α (see S1 Fig), and show all of our findings in terms of them. To calculate the observed values of the crossing angle α we consider the two barycenters of the initial and final positions of all the participants in a group for a trial. The line connecting these two points gives the actual direction of motion of a group, from which we evaluate the observed crossing angle α. We then compute medians over all the trials and use these median values in all of our analysis. In Table 1 we mention the median values of the observed crossing angle α. We also expect the individual pedestrians to make some personal adjustments in their trajectories to reach their goal. Thus we measure how much a pedestrian actually deviates from his/her originally assigned trajectory. The normalised distributions of this measurement show Gaussian behaviour (see S2 Fig). The mean value of the angular deviations in each case is less than 2˚.

Edge-cutting algorithm: Detection of the stripes
In the beginning of the trial, at time t = 0, we assume that each group of pedestrians forms a complete graph with clustering coefficient = 1 i.e. all the individuals are connected to each other within the group by an 'edge'. The basis of such an assumption is the correlated movements of pedestrians in a group [77]. With the progression of time, when the two groups meet and cross each other, the edge between two pedestrians from one group may be cut by a pedestrian from the other group. This situation is detected by the edge-cutting algorithm. Once all the probable edge-cuttings are over, each group is left with more than one cluster having a complete graph. The size of these clusters are �1.
where the angle β is defined in Fig 17. Simultaneous satisfaction of these three conditions detects the edge-cutting. Conditions (i) and (ii) ensure that the pedestrian R is able to cut the edge between P and Q. When these two conditions are satisfied, the angle β between PQ �! and PR �! is measured as a time series, and if it changes sign we confirm that the edge is destructed.
Condition (iii) allows us to detect the time of edge-cutting as well. For a trial, the instant when the first (initial) edge-cut takes place is denoted by T i and the instant of the last (final) edge-cut is denoted by T f . The two timescales T i and T f are outputs from the Edge-cutting algorithm, and they have been used extensively in the analysis of stripe orientations.

Pattern matching: Fitting 2D parametric sinusoidal curves
To estimate the orientation of the parallel stripes and their physical separation we implied a pattern matching technique. We use a two dimensional parametric sinusoidal function f for this method and fit this function on the pedestrian positions. The goal of the pattern matching technique was to (i) estimate the angle γ between the stripes and the bisector of the crossing angle and (ii) to estimate the physical separation λ between the stripes from the same group. In all the cases discussed in this paper, the orientation γ of the stripes were measured counterclockwise from the bisector of the crossing angle α. The data obtained by experiments were given a transformation such that x 0 , the new x-axis coincided with the bisector of the crossing angle, this is illustrated in Fig 18. This transformation was applied so that the orientation γ could be directly evaluated from pattern matching. The function f was fitted on the transformed coordinates of the pedestrians (x 0 , y 0 ). The fitting was achieved by maximising a function C, which is the mean of sum of values of f as fitted on the pedestrian positions. For the pattern matching procedure when we assume that the stripes from the two groups are parallel to each other and are equispaced, we denote quantities with a bar as a way of representation. In this case the sinusoidal function f was given by the form where, X ¼ x 0 sin� g À y 0 cos� g, � l is the wavelength of the sine function and ψ denotes the phase offset. To find the orientation � g of the parallel stripes, we fit f to the position (x 0 , y 0 ) of the pedestrians. The fitting was performed using an optimisation strategy, where we maximise � C, which is defined as where � N is the total number of pedestrians. The first summation sign denotes the sum over the position of pedestrians from one group and the second summation for the position of pedestrians from the other group. The maximum possible value of � C is 2, which occurs for the ideal case when the position of pedestrians from the two groups could be fitted exactly on the crests and troughs of the sinusoidal curve respectively. Maximisation of � C by fitting f on pedestrian positions gives us the orientation � g of the stripes and spatial separation � l between two stripes from the same group. Evaluation of � g and � l is done under the assumption that the stripes from the two groups are parallel to each other and are equispaced. Pictorial representation of � g and � l is shown in Fig 6a. For a randomly oriented set of points, the pattern matching technique would over-fit or under-fit the data-that could be detected by the obtained value of � l. In our case, before performing the pattern matching procedure, we imply the edge-cutting algorithm to obtain the number of stripes that are formed in a trial. Combining this knowledge with the width of the crossing region, we get an approximate estimate for the value of spatial separation � l. This helps us to identify any over-fitting or under-fitting. For the trial with α = 89.9˚shown in Figs 4 and 5, the width of the crossing region is 8.06 m. From the edge-cutting algorithm we get that the two groups of this trial gets divided into a total of 9 subgroups. Therefore, approximate estimate for the wavelength of fitted sinusoid is 2 � 8:06 9 ¼ 1:79 m. From the pattern fitting we obtained � l ¼ 1:865 m, which is quite close to the approximate estimate. The fitted sine functions f for two typical trials and variation of � C as a function of � g and � l for the same trials are depicted in Fig 5. To find the orientation of stripes for the two groups in a trial separately, we used the same fitting function f as in Eq (1) and the function which was maximised to obtain the fitting in this case wasC where the summation was performed over the position of pedestrians from one group at a time.Ñ is the number of pedestrians in the group. The maximum possible value ofC is 1, which in this case occurs for the ideal situation when the pedestrian positions from the group under consideration fall exactly on the crests of the sine curve represented by f. This analysis was performed as a time sequence between (T i + T f )/2 and T f . Maximisation ofC by fitting f on the pedestrian positions gives us the orientationg of the stripes and the spatial separationl between the stripes from the same group. This computation was done under the assumption that the stripes from the same group are parallel to each other and have equal spacing between them.
While fitting the parallel stripes from the two groups separately we differentiate them by using the notationsg L andg R .g L denotes the orientation of the stripes whose group direction vector lies to the left (L) of the direction of bisector and similarly,g R for the one whose group direction vector lies to the right (R) of the direction of bisector. Similarly, we use the notationsl L andl R to denote the spatial separation between the stripes from the same group, according to the orientation of its group direction vector with respect to the bisector. Pictorial demonstration ofg L ,g R ,l L andl R are shown in Fig 6b. Following the same convention, the functions that were maximised to obtain (g L ,l L ) and (g R ,l R ) were denoted asC L andC R respectively.
For the segregation of the groups according to whether they lie to the left or right of the bisector of the crossing angle, it is therefore important to determine the direction of the bisector. This direction is estimated using the two group direction vectors. But for the case of crossing angle 180˚, determining the direction of the bisector is not possible. However we realise that the experimentally observed value of the crossing angle α is never exactly equal to 180˚. Thus estimating the direction of bisector for these cases is also pretty straight-forward.

Finding individual stripe width and orientation
From the Edge-cutting algorithm we could successfully identify the stripes that are formed. In our attempt to find the individual stripe orientations at each instant we construct the minimum bounding box of the stripes using Rotating Calipers algorithm [78,79]. The orientation of the stripe was calculated along the length of the box. The width of the rectangular box gives an estimate of the width of each of the stripes. The aspect ratio of the minimum bounding box for a stripe, calculated as the ratio of its width to length, gives an idea of the suitability of that stripe to be considered for the estimation of orientation. The value of aspect ratio closer to 1 denotes a uniformly shaped stripe. Whereas, lower value of aspect ratio indicates a sufficiently elongated stripe suitable for finding the orientation. In Fig 19, we show two typical stripes with their respective minimum bounding boxes calculated using the Rotating Calipers algorithm. We applied a cut-off on aspect ratios of the stripes and considered only those stripes which had an aspect ratio less than 0.5. Choosing this cut-off lets us consider almost 90% of the stripes, and they are all sufficiently elongated (see S9 Fig). The time window which was selected for this calculation was from (T i + T f )/2 to T f . The orientation of individual stripes were also estimated as the angle between the stripes and the bisector of the group direction vectors, as depicted in Fig 6c. The angle is measured counterclockwise from the bisector. We use the notations γ L and γ R to differentiate the orientation of stripes whose group direction vector lie to the left and right of the bisector respectively.
Supporting information S1 Table. Results of ANOVAs for � γ,γ L andγ R for each α. Table summarizes the results of the ANOVA tests that were performed for each α with � g,g L andg R to check their statistical dependencies on whole-crowd and separate-group analyses under the pattern matching technique. (PDF) S2 Table. Results of ANOVAs for � λ,λ L andλ R for each α. Table summarizes  Median values of hg L Àg R i t for each crossing angle are seen to be very close to 0˚.g L andg R are the orientations of stripes in a given trial as obtained from separate-group analysis using pattern matching technique. One-sample Kolmogorov-Smirnov tests confirm that the data is normally distributed. A series of t-tests have confirmed that the mean values are not significantly different from 0˚.