# Efficient Crowd Anomaly Detection Using Sparse Feature Tracking and Neural Network
## 3 Materials and Methods
### Crowd Representation and Behaviour Descriptors
#### 3.1.4 Visual Descriptors
To calculate the cross ratio, we use Equation (13):  
\[c_{i\alpha}=f_{c\sigma}\left(f_{o}\left(V_{\alpha},v_{i\alpha}^{\prime},v_{i \alpha^{\prime}}^{\prime},V_{\alpha^{\prime}}\right)\right) \tag{13}\]  
The cross ratio is used to measure the shape difference since it is invariant to a projective transform. For a triangle \(r_{i\alpha}\), it is computed using the two ends of the boundary edges \(\left(V_{\alpha}\text{ and }V_{\alpha^{\prime}}\right)\), and the projections \(\left(v_{i\alpha}^{\prime}\text{ and }v_{i\alpha^{\prime}}^{\prime}\right)\) of the midpoints of two sides (\(\left[V_{i}V_{\alpha}\right]\) and \(\left[V_{i}V_{\alpha^{\prime}}\right]\)) on the boundary line. Since the cross ratio is not affected by a projective transformation, it can be used to quantify the degree of shape dissimilarity between two figures. This ratio is calculated for a triangle \(r_{i\alpha}\), by locating the endpoints of the boundary edges \(\left(V_{\alpha}\text{ and }V_{\alpha^{\prime}}\right)\) and the projections of the midpoints of the two sides (\(\left[V_{i}V_{\alpha}\right]\) and \(\left[V_{i}V_{\alpha^{\prime}}\right]\)) onto the boundary line \(\left(v_{i\alpha}^{\prime}\text{ and }v_{i\alpha^{\prime}}^{\prime}\right)\). * Collectiveness The collectiveness property in crowd analysis refers to how pedestrians move together as a group. In [14], this property is quantified by computing each individual's directional deviation from the group's global motion. Traditionally, coherent motion has been determined using predefined collective transitions. However, an alternative approach is used in this work by utilising cliques for the local computation of this descriptor [37]. Specifically, the collectiveness of a set of seed points is defined based on the degree of motion deviation from the global motion exhibited by their neighbouring points, all moving cohesively towards a common goal, as defined by the clique. By considering the local interactions within the clique, we can capture the collectiveness of the pedestrians, providing valuable insights into their coordinated movement patterns and group dynamics. The collectiveness can be computed using the following Equation (14): \[D^{\text{collec}}\left(V_{i}^{k}\right)=\frac{1}{\left|C_{n}\left(V_{i}^{k} \right)\right|}.\sum_{V_{i}^{k}\in C_{n}\left(V_{i}^{k}\right)}h\left(\overline {V_{i}^{k-\tau_{1}}V_{i}^{k}},\overline{V_{j}^{k-\tau_{1}}V_{j}^{k}}\right)\] (14) where \(h(a,b)=\left\{ \begin{array}{cl}d_{\theta}(a,b),&\text{if }d_{\theta}(a,b)<T_{1}\\ 0,&\text{otherwise.}\end{array} \right.\)
* Conflict Conflict is an important property that captures human interactions in crowded environments, particularly when individuals are near each other. Like the approach used to compute the collectiveness descriptor, the conflict property is also computed locally [37]. A neighbour point from the corresponding clique is considered as a potential conflict point candidate for each seed point only if both of their motion vectors converge, indicating movement towards their origins. Consequently, the set of conflict points, denoted as \(C_{n}^{n}\left(V_{i}^{k}\right)\), forms a subset of the neighbours. Once the set of conflict points is determined, the conflict level of the central point is calculated by considering the angular difference and distance from the other points. The calculation of the conflict level is represented by Equation (15), in which the angular difference and distance from the other points are used to determine the conflict level of the central point. This helps to gain insights into the level of interpersonal interaction and potential congestion in crowded scenes, enabling a more comprehensive understanding of the dynamics and social behaviours within the crowd.