Methods and systems for determining group motion patterns

A lightweight on-board approach for UAVs using H.264 video encoding and Laplacian-based flow diagrams addresses the limitations of existing crowd pattern recognition systems, enabling real-time adaptive crowd management with improved safety and efficiency.

WO2025189118A1PCT designated stage Publication Date: 2025-09-11RUTGERS THE STATE UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/US2025/018948
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-08
Filing Date
2025-03-07
Publication Date
2025-09-11

AI Technical Summary

Technical Problem

Current crowd pattern recognition systems for UAVs are limited by unreliable connectivity, limited on-board resources, and complex coordination, making centrally located control room-based monitoring untenable and unscalable, especially in dynamic urban environments where real-time anomaly detection and crowd density prediction are challenging.

Method used

A lightweight, on-board approach for UAVs using existing video encoding processes (e.g., H.264) and numerical solvers to identify macroscopic crowd patterns in real-time, incorporating spatiotemporal awareness and Laplacian-based flow diagrams for adaptive crowd management.

Benefits of technology

Enables real-time, adaptive crowd pattern recognition on UAVs, reducing computational load and enhancing safety by providing local decision-making capabilities, with performance improvements of up to 45 times faster execution time compared to existing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US2025018948_12092025_PF_FP_ABST
    Figure US2025018948_12092025_PF_FP_ABST
Patent Text Reader

Abstract

An embodiment provides a lightweight approach to real-time crowd pattern identification, and motion pattern determination using processes of existing video compression standards. An embodiment obtains a plurality of motion vectors, each motion vector indicating movement of a macroblock from a first frame of video data to a second frame of video data. Based on the plurality of motion vectors, a polygonal contour surrounding a subset of motion vectors from the plurality of motion vectors is determined, wherein the polygonal contour represents at least part of the group. A motion pattern of the group is identified based on the determined polygonal contour and the subset of motion vectors from the plurality of motion vectors.
Need to check novelty before this filing date? Find Prior Art

Description

5431.1030001 Methods And Systems For Determining Group Motion Patterns RELATED APPLICATION

[0001] This application claims the benefit of U.S. Provisional Application No. 63 / 563,006, filed on March 8, 2024. The entire teachings of the above application are incorporated herein by reference. GOVERNMENT SUPPORT

[0002] This invention was made with government support under Grant Number 1937403 awarded by the National Science Foundation. The government has certain rights in the invention. BACKGROUND

[0003] In recent years, Unmanned Aerial Vehicles (UAVs) have transitioned from niche gadgets to ubiquitous tools, finding use in diverse fields such as agriculture, cinematography, and public safety [1] (bracketed numbers in this document refer to the enumerated list of references hereinbelow). SUMMARY

[0004] The unique aerial perspective of UAVs offers an unparalleled advantage, particularly regarding monitoring scenarios like mass gatherings, protests, and public events, amongst others. UAVs, also known as drones, can both observe and guide crowds in the event of an emergency. However, there are challenges unique to UAVs, including unreliable connectivity (in contrast to wired fixed cameras), limited on-board resources, and complex coordination. While potential advantages of UAVs include mobility, adaptability, and distinct Points of View (POVs). Given these challenges and opportunities, a traditional centrally located control room-based monitoring approach becomes untenable and unscalable for drones [2].

[0005] As such, there is a need for a lightweight approach to crowd pattern identification which can be performed on the drone itself, thereby eliminating the need for a centrally located control room. Therefore, a hierarchical management approach is needed in which each drone has some real-time capability on board for local situational awareness, and there - 1 - 4131307.v15431.1030001 exists a central server that can deploy and direct drones to certain Regions of Interest (ROIs), and issue directives.

[0006] Embodiments provide such functionality.

[0007] Improved group analysis and pattern detection methods are particularly beneficial in crowded, e.g., urban, environments, such as dense cities. In urban environments the mitigation of overcrowding is a major problem. Excessive crowd congestion encourages chaotic body collisions and unpredictable foot traffic, potentially resulting in trampling or in extreme circumstances even death. These overcrowding dangers pose a risk to lives and unforeseen destruction to fragile city infrastructure. The complexities of dynamic crowd sizes, unique location contexts, unpredictable movements, and rapid clustering limit accessible solutions from closed circuit television (CCTV) networks and standard emergency services, necessitating an adaptive crowd pattern recognition solution. Current approaches promote and require massive data collection from a myriad of sensors and data-driven machine learning algorithms to evaluate unstable crowd behaviors. However, challenges of real-time anomaly detection, inaccessible crowd density prediction, and mobile computation constraints limit these solutions’ effectiveness and adaptiveness. Furthermore, urban planning research desires mobile tools that can simplify sociological group behavior into macroscopic sections rather than pinpoint abnormalities. Thus, a scalable and mobile sensor network for real-time crowd pattern recognition remains an open problem. Embodiments provide solutions to these problems.

[0008] One such embodiment is directed to a computer-implemented method for determining a motion pattern of a group in video data. The method includes, by a processor, obtaining, in memory of the processor, a plurality of motion vectors, each motion vector indicating movement of a macroblock from a first frame of the video data to a second frame of the video data. Based on the plurality of motion vectors, the method determines a contour shape of macroblocks of the video data, wherein the contour shape represents at least part of the group. In turn, the method identifies a motion pattern of the group based on the determined contour shape and a subset of motion vectors from the plurality of motion vectors, wherein the subset of motion vectors correspond to the macroblocks of the determined contour shape.

[0009] In an embodiment, the video data is captured using at least one of: an optical device coupled to an unmanned aerial vehicle, an internet of things connected device, a mobile device, and a stationary optical device. - 2 - 4131307.v15431.1030001

[0010] In another embodiment, the processor applies a magnitude decay factor to the subset of motion vectors.

[0011] In yet another embodiment, the processor applies a temporal moving average filter to the subset of motion vectors.

[0012] According to an embodiment, determining the contour shape based on the plurality of motion vectors includes, from amongst the plurality of motion vectors, identifying a contiguous grouping of motion vectors, wherein the identified contiguous grouping of motion vectors is the subset of motion vectors.

[0013] In another embodiment, based on the plurality of motion vectors, the processor determines multiple contour shapes of macroblocks of the video data, wherein each contour shape of the multiple contour shapes corresponds to a respective group.

[0014] In another embodiment, the processor identifies a motion pattern of each group based on (i) a corresponding contour shape, from amongst the determined multiple contour shapes and (ii) a respective subset of motion vectors, from amongst the plurality of motion vectors, wherein each respective subset of motion vectors corresponds to macroblocks of the corresponding contour shape.

[0015] In another embodiment, the plurality of motion vectors obtained are inter- prediction motion estimation data.

[0016] According to an embodiment, identifying the motion pattern of the group based on the determined contour shape and the subset of motion vectors includes determining the subset of motion vectors based on the determined contour shape, identifying dominant directional movements of the group based on a classification of each motion vector of the subset of motion vectors, and identifying the motion pattern of the group based on the identified dominant directional movements of the group.

[0017] In another embodiment, the processor determines the classification of each motion vector of the subset of motion vectors as being one of: rightward, leftward, upward, and downward.

[0018] In yet another embodiment, the motion pattern of the group is identified as any one of a lane, an arch, or a turn. Further, according to such an embodiment, identifying the motion pattern of the group based on the identified dominant directional movements of the group includes (i) responsive to the identified dominant directional movements of the group being in a same direction, identifying the motion pattern as a lane; (ii) responsive to the identified dominant directional movements of the group comprising a second directional - 3 - 4131307.v15431.1030001 movement connecting a first directional movement and a third directional movement, where the first directional movement and the third directional movement are in opposite directions, identifying the motion pattern as an arch; and (iii) responsive to the identified dominant directional movements of the group comprising two perpendicular directional movements, wherein an average magnitude for each perpendicular directional movement is above a threshold value, identifying the motion pattern as a turn.

[0019] In embodiments the group can represent any mobile congregation of subject matter. For instance, the group can be composed of at least one of: humans, animals, bacteria, and stars, amongst other examples.

[0020] Another embodiment is directed toward a computer-implemented method for determining a motion pattern of a group in video data. The method includes, by a processor, obtaining, in memory of the processor, a plurality of motion vectors, each motion vector indicating movement of a macroblock from a first frame of the video data to a second frame of the video data. Based on the plurality of motion vectors, a polygonal contour surrounding a subset of motion vectors from the plurality of motion vectors is determined. The polygonal contour represents at least part of the group. In turn, a motion pattern of the group is identified based on the determined polygonal contour and the subset of motion vectors from the plurality of motion vectors.

[0021] According to an embodiment, the video data is captured using at least one of: an optical device coupled to an unmanned aerial vehicle, an internet of things connected device, a mobile device, and a stationary optical device.

[0022] In an embodiment, determining the polygonal contour includes (i) processing the plurality of motion vectors with a neural network, where an output of the processing is a plurality of bounding boxes representing the subset of motion vectors from the plurality of motion vectors from the plurality of motion vectors and (ii) generating the polygonal contour based on the plurality of bounding boxes.

[0023] Another embodiment further comprises, by the processor, solving for a gradient solution of an equation for the polygonal contour. The gradient solution indicates an optimal motion of the group based on the polygonal contour. Further, such an embodiment may classify, based on a structure of the gradient solution, the optimal motion of the group as any one of a lane pattern, an arch pattern, and a turn pattern. In an embodiment, the equation is a Laplace equation. - 4 - 4131307.v15431.1030001

[0024] In an embodiment, the method further comprises, by the processor, comparing the optimal motion of the group to the identified motion pattern of the group. Responsive to the comparing determining the identified motion pattern of the group is not equal to the optimal motion of the group, such an embodiment determines an anomaly is present in the identified motion pattern of the group. Embodiments may take real-world remedial action responsive to identifying the anomalous movement. For example, announcements can be made and crowd control actions may be made responsive to anomalous movement.

[0025] In an embodiment, solving for the gradient solution of an equation for the polygonal contour includes, by the processor, identifying at least one exit location on the polygonal contour and solving for the gradient solution of the equation using the at least one exit location identified.

[0026] In another embodiment, based on the plurality of motion vectors, the processor determines multiple contour shapes of macroblocks of the video data, wherein each contour shape of the multiple contour shapes corresponds to a respective group.

[0027] In another embodiment, the processor identifies a motion pattern of each group based on (i) a corresponding contour shape, from amongst the determined multiple contour shapes and (ii) a respective subset of motion vectors, from amongst the plurality of motion vectors, wherein each respective subset of motion vectors corresponds to macroblocks of the corresponding contour shape.

[0028] In another embodiment, the plurality of motion vectors obtained are inter- prediction motion estimation data.

[0029] In yet another embodiment, the group is composed of at least one of: humans, animals, bacteria, and stars.

[0030] According to an embodiment, determining the polygonal contour based on the plurality of motion vectors comprises, from amongst the plurality of motion vectors, identifying a contiguous grouping of motion vectors, wherein the identified contiguous grouping of motion vectors is the subset of motion vectors.

[0031] According to an embodiment, identifying the motion pattern of the group based on the determined polygonal contour and the subset of motion vectors includes determining the subset of motion vectors based on the determined polygonal contour, identifying dominant directional movements of the group based on a classification of each motion vector of the subset of motion vectors, and identifying the motion pattern of the group based on the identified dominant directional movements of the group. An embodiment may determine the - 5 - 4131307.v15431.1030001 classification of each motion vector of the subset of motion vectors as being one of: rightward, leftward, upward, and downward.

[0032] In yet another embodiment, the motion pattern of the group is identified as any one of a lane, an arch, or a turn. Further, according to such an embodiment, identifying the motion pattern of the group based on the identified dominant directional movements of the group includes (i) responsive to the identified dominant directional movements of the group being in a same direction, identifying the motion pattern as a lane; (ii) responsive to the identified dominant directional movements of the group comprising a second directional movement connecting a first directional movement and a third directional movement, where the first directional movement and the third directional movement are in opposite directions, identifying the motion pattern as an arch; and (iii) responsive to the identified dominant directional movements of the group comprising two perpendicular directional movements, wherein an average magnitude for each perpendicular directional movement is above a threshold value, identifying the motion pattern as a turn.

[0033] Another embodiment is directed toward a computer-implemented method for solving a Laplace equation for a polygon. The method includes, by a processor, receiving an indication of a polygon and at least one boundary condition, where the polygon is composed of a plurality of vertices and a plurality of edges. The method continues by generating a first set of circles covering the polygon by: (i) at each vertex of the plurality of vertices, defining a respective circular sector, wherein each respective circular sector defined covers a first portion of the polygon, (ii) for each edge of the plurality of edges not covered by the respective circular sectors defined, defining a respective half-circle, wherein each respective half-circle defined covers a second portion of the polygon, and (iii) defining one or more full- circles based on points of the polygon not covered by the respective circular sectors defined and the respective half-circles defined, wherein the first set of circles is composed of the respective circular sectors defined, the respective half-circles defined, and the respective full- circles defined. In turn, the method generates a second set of circles based on the first set of circles and a multiplier. The method then solves a Laplace equation for the polygon using the first set of circles, the second set of circles, and the at least one boundary condition.

[0034] Yet another embodiment is directed to a computer-based system for determining a motion pattern of a group in video data. The system includes a processor and a memory with computer code instructions stored thereon. The processor and the memory, with the computer - 6 - 4131307.v15431.1030001 code instructions, are configured to cause the computer-based system to cause the system to implement any embodiments or combination of embodiments described herein.

[0035] Another embodiment is directed to a non-transitory computer program product for determining a motion pattern of a group in video data. The computer program product includes a computer readable medium comprising program instructions which, when executed by a processor, causes the processor to implement any embodiments or combination of embodiments described herein.

[0036] It is noted that embodiments of the methods, systems, and computer program products may be configured to implement any embodiments, or combination of embodiments, described herein. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The foregoing will be apparent from the following more particular description of example embodiments, as illustrated in the accompanying drawings in which like reference characters refer to the same parts throughout the different views. The drawings are not necessarily to scale, emphasis instead being placed upon illustrating embodiments.

[0038] FIG.1 depicts a conceptual implementation of an embodiment for drone-based crowd management.

[0039] FIG.2 is a flow diagram of a computer-implemented method for determining a motion pattern of a group in video data, according to an embodiment.

[0040] FIG.3 is a flow diagram representing a framework for processing video frames and detecting motion patterns according to an embodiment.

[0041] FIG.4 is a qualitative comparison between existing approaches, and an embodiment, for recognizing motion patterns in video data.

[0042] FIGs.5A-C are plots showing Gaussian-smoothed raw F1 scores from applying embodiments across a sample of frames.

[0043] FIGs.6A-C are plots showing Gaussian-smoothed raw F1 scores from applying embodiments to marathon datasets stitched together.

[0044] FIG.7 is a table showing average angular errors and their respective standard deviations for a plurality of different group pattern recognition techniques.

[0045] FIG.8 is a table showing frames per second (FPS) on embedded graphical processing units (GPUs) for a plurality of different group pattern recognition techniques. - 7 - 4131307.v15431.1030001

[0046] FIGs.9A – 9C show example polygons illustrating block coverings, according to an embodiment.

[0047] FIG.10 shows interior angles of a portion of an example polygon and overlapping blocks within the polygon, according to an embodiment.

[0048] FIG.11 shows interior angles of a portion of a polygon illustrating an example covering by blocks, according to an embodiment.

[0049] FIGs.12A – 12C are plots illustrating percentage change in total number of blocks used for complete block coverings as a function of radial heuristic values, according to an embodiment.

[0050] FIGs.13A – 13F are polygons illustrating a qualitative comparison of block placement methods according to an embodiment.

[0051] FIGs.14A – 14H are polygons illustrating block coverings and corresponding plots of approximate solutions for embodiments implemented using varying radial heuristic values.

[0052] FIG.15 is a plot on a log scale illustrating a comparison of means squared error (MSE) vs. a natural number parameter (n) for different radial heuristic according to an embodiment.

[0053] FIG.16A is a scatter plot illustrating computational runtime over the total number of blocks for a variety of quantized points on curvilinear boundaries of blocks, according to an embodiment.

[0054] FIG.16B is a box plot illustrating a comparison of the solution error over the number of blocks for a variety of quantized points on curvilinear boundaries of blocks, according to an embodiment.

[0055] FIG.17A is a diagram illustrating a square room with two exits connected via hallways that may be analyzed by embodiments.

[0056] FIG.17B is a plot illustrating a solution to a Laplace equation of the square room from FIG.17A.

[0057] FIG.17C is a plot of mean squared error versus maximum iterations for a variety of block coverings implemented with varying numbers of quantized points on curvilinear boundaries of blocks used in the solution of FIG.17B, according to an embodiment.

[0058] FIG.18 depicts a computer network or similar digital processing environment in which embodiments may be implemented. - 8 - 4131307.v15431.1030001

[0059] FIG.19 is a diagram of an example internal structure of a computer in the environment of FIG.18. DETAILED DESCRIPTION

[0060] A description of example embodiments follows.

[0061] Through recent advancements, UAVs have shifted from being utilized only as reconnaissance tools to being capable of implementing scalable surveillance networks for agricultural, entertainment, and public safety applications, amongst other examples. The multi-modal sensors and unique aerial perspective of UAVs provides formidable benefits when closed caption televisions (CCTVs) and people cannot observe nuances in partially occluded mass assemblies or public gatherings. By collaborating with Internet of Things (IoT) sensors, UAVs utilize their nuanced perspectives to aggregate images and bolster existing convolutional neural network (CNN) machine learning model training accuracy. UAVs enable opportunities for crowd safety, control, and marshaling during an emergency. In contrast to current crowd pattern management, UAV implementations rely on both automated observation and control, whereas preexisting machine learning techniques can only warn existing emergency services. Nevertheless, the unreliable connectivity and coordination of UAVs, i.e., drones, presents challenges for crowd safety solutions. The potential advantages of 3-dimensional navigation, adaptation to location, and distinct Point of Views (POVs) address the open problem of scalable real-time crowd pattern recognition. Based on these disadvantages and opportunities, a centrally localized room-based control for drone observation is an untenable and insufficient solution.

[0062] In order to eliminate the dependence on traditional centrally located control room- based crowd monitoring (e.g., UAV-based crowd monitoring that relies upon a central control room), embodiments provide a novel, lightweight, on-board approach to classifying and monitoring crowd patterns by leveraging onboard computing systems. Embodiments are lightweight, in part, by using the processes of existing video compression standards, e.g., H.264 (Advanced Video Coding (AVC)) or MPEG-4, as well as numerical solvers. By piggybacking on the H.264 video-encoding inference algorithm, embodiments provide implementations of macroscopic and mesoscopic crowd pattern recognition and identification methodologies that can identify macroscopic patterns in a computational time as low as two- milliseconds (on, for example, a NVIDIA TX2 computing device), resulting in a forty-five- times reduction in execution time when compared to existing approaches. Furthermore, - 9 - 4131307.v15431.1030001 embodiments introduce a spatiotemporally aware approach to pinpoint and adapt to crowd movement patterns, continuously recalibrating as a drone’s POV varies or observed motions diverge. Embodiments also provide a Laplacian-based generated flow diagram, regularizing continuous motion divergences and accounting for crowd cluster anomalies.

[0063] By assessing embodiments through public datasets with varying crowd sizes and perspectives, the robust performance and computational benefits of embodiments is highlighted, especially during scenarios of real-time observational shifts. Embodiments elegantly bridge the gap between crowd safety imperatives and the challenges of UAV monitoring, heralding a new era of real-time drone-centric crowd management intelligence. Embodiments are well suited for managing mobile crowds, whose intent and direction can change depending on time, location, and type of event [3]. Embodiments address the necessity for crowd safety solutions and the current limitations of UAV observation and advance fundamental improvements that will revolutionize real-time drone-centric crowd management intelligence. By mitigating overcrowding in public assemblies and observing crowd motion patterns, embodiments may transform public assembly regulations and contribute to saving a significant number of lives.

[0064] Although embodiments described herein refer to video captured from a UAV, such as a drone, it should be understood by a person of ordinary skill in the art that the same teachings apply to video captured from a multitude of optical devices, such as, but not limited to, an optical device coupled to an internet of things (IoT) connected device, a mobile device, and a stationary optical device, amongst other examples.

[0065] To maximize a drone’s capability for crowd motion identification, it may be helpful to leverage the drone’s mobile and aerial tools with creative monitoring approaches, as described herein in relation to FIG.1. An example embodiment provides a hierarchal management solution through targeted drone deployments that can perpetuate directive observation of Regions of Interests (ROIs) and local situational awareness. Absolving mobile computational restrictions, real-time aberrations can be processed by the collective drones’ on-board computational resources. This methodology enables the opportunity for a central server to handle global coordination, while adapting for local human emergency responses and mercurial mobile crowds. This management approach also accounts for changes in time, location, and events, which provides a practical tool for urban planning research. Further, real-time surveillance increases resolution for sociological human behaviors, especially in - 10 - 4131307.v15431.1030001 estimating and predicting crowd motion, which is helpful for ensuring safety and efficient crowd regulation.

[0066] A hierarchal management approach may require several laborious solutions and significant drone infrastructure. As the solution is enormous and multi-staged, an example novel algorithmic approach is constrained to a drone’s crowd motion pattern recognition, which can be expanded to future contributions in crowd management regulation and overcrowding notifications. Effectively, an embodiment’s approach contributes to an overall solution of rapid, mobile, and adaptive crowd monitoring amid unreliable connectivity, while still providing an essential tool to study sociological patterns at a macroscopic level. Addressing the drone’s limited computational and battery resources, an algorithmic answer should ensure public safety, by reducing duress on the drones and maximizing its utility for real-time scenarios of crowd motion. Therefore, an embodiment’s proposed solution enhances crowd safety by relieving stress on the drones and providing local decision-making capabilities.

[0067] Embodiments present a novel lightweight approach that makes conscious use of the onboard resources available in a UAV for the detection and identification of dominant crowd motion patterns in real time, taking only a few milliseconds to run on small, embedded modules. A thorough analysis was performed and showed that embodiments achieve great performance at a negligible cost. The presented results described hereinbelow have been evaluated for videos with predominant crowd motion. Embodiments provide a significant step in the direction of drone-centric intelligence for crowd surveillance, which can be built effortlessly.

[0068] To implement embodiments, several innovations were needed, both in terms of algorithmic solutions and physical infrastructure. For example, embodiments disclose a novel approach to crowd motion pattern recognition and identification that can be extended to crowd behavior recognition, management, and overcrowding prevention. Due to the nature that on-board resources for a drone, such as the drone’s battery and computing power, are limited, a compelling need for embodiments to be lightweight emerges as existing approaches put undue pressure on the device and jeopardize public safety. Therefore, embodiments can help improve safety by minimizing stress and providing local (on-board) decision-making capabilities.

[0069] FIG.1 shows a conceptual use case 100 for drone-based crowd management, according to an embodiment. In the example use case 100, a drone 101 captures images 102a- - 11 - 4131307.v15431.1030001 d and the drone 101 processes the images 102a-d using the functionality described herein, e.g., method 200, to predict 103 crowd movements in real-time. This allows the drone 101 to focus on potentially anomalous areas and issue local warnings. The drone 101 can also stream 104 images 102a-d to a central server 105, from which, global monitoring as well as coordination can be executed.

[0070] Achieving real-time decision-making on resource-constrained platforms such as drones is challenging. Consequently, it has given impetus to a growing body of research that focuses on offloading computation to nearby powerful nodes which may be strategically placed in vehicles close by or connected to the grid, known as Mobile Edge Computing (MEC) [4]. While an offloading approach might be faster than local processing in some scenarios, offloading during crowd monitoring involves competition with requests from users in the crowd itself, thwarting real-time decision-making. On the other hand, implementing an exclusive communication infrastructure for drones is not only not scalable, but also limits the mobility of drones, which is one of the key advantages of drone usage. With these challenges in mind, an embodiment provides a lightweight approach for on-board, real-time, crowd pattern recognition and identification, taking advantage of video encoding processes (e.g., H.264 or MPEG-4 [5]) already running as the drone records video.

[0071] Furthermore, drones can perform data collection and image processing with assistance from existing IoT networks so as to reduce a substantial portion of the drones’ computational load. However, crowd monitoring and capricious motion patterns require immediate inferences, which make offloading infeasible for real-time decision-making. Therefore, the drones’ local computational awareness must handle real-time requests through its on-board computers, but the drones’ collective processing faces difficulties, since the drones’ communicative infrastructure is not scalable for real-time higher traffic densities. The accessibility of IoT networks is also not definite, since a location’s available bandwidth, placement of sensors, and network connectivity can fluctuate immensely at any moment. Since this limits the drones’ key advantage of adaptation to location, a lightweight approach should rely upon every individual drone adapting to its own local crowd environment. As such, embodiments provide a lightweight flexible solution for on-board real-time crowd pattern recognition and identification through the incorporation of the video encoding processes (e.g., H.264 or MPEG-4) that the drones already utilize for streaming video.

[0072] Embodiments introduce a novel algorithm for macroscopic crowd pattern detection and identification that incorporates the internal motion estimation done for video - 12 - 4131307.v15431.1030001 recording and streaming. Embodiments also introduce a spatially and temporally aware approach to identify macroscopic crowd movement that adapts its output as the drone changes its POV, or augmentation of motion, e.g., as the observed motion changes, in the current POV. In addition, embodiments introduce a spatio-temporal method that relies on a Laplacian numerical solver to generate a macroscopic flow diagram, regularizing sparse motion vectors and providing real-time anomaly detection. Embodiments were evaluated against existing systems with publicly available datasets, highlighting the performance and practical computational savings of embodiments.

[0073] FIG.2 is a flow diagram showing a computer-implemented method 200 for determining a motion pattern of a group in video data, according to an embodiment. The method 200 may be implemented using any computing devices or combination of computing devices known to those of skill in the art. Further, the method 200 may be implemented on board UAV devices and IoT devices, amongst other examples. The group may be any congregation of mobile subject matter. For example, the group may be composed of people, bacteria, animals, and stars, amongst other examples.

[0074] The method 200 begins at step 201 by obtaining, in memory of a processor, a plurality of motion vectors. According to an embodiment, each motion vector indicates movement of a macroblock from a first frame of video data to a second frame of the video data. The method 200 continues at step 202 by determining, based on the plurality of motion vectors, a polygonal contour surrounding a subset of motion vectors from the plurality of motion vectors, wherein the polygonal contour represents at least part of the group. In turn, at step 203, the method 200 identifies a motion pattern of the group based on the determined polygonal contour and the subset of motion vectors from the plurality of motion vectors.

[0075] According to an embodiment, the motion vectors obtained at step 201 are inter- prediction motion estimation data. According to an embodiment, the obtained motion vectors are a by-product of an encoding process, however, it is noted that embodiments are not limited to obtaining the motion vectors from an encoding process and the motion vectors may be obtained at step 201 from any source.

[0076] The video data may be captured using any technique known to those of skill in the art. For instance, the video data may be captured using at least one of: an optical device coupled to a UAV, an internet of things connected device, a mobile device, and a stationary optical device, amongst other examples. - 13 - 4131307.v15431.1030001

[0077] Determining the polygonal contour at step 202 may include, according to an embodiment, processing the plurality of motion vectors with a neural network, wherein an output of the processing is a plurality of bounding boxes representing the subset of motion vectors from the plurality of motion vectors. In such an embodiment, the polygonal contour is generated based on the plurality of bounding boxes. According to another embodiment, determining the polygonal contour at step 202 based on the plurality of motion vectors, may include, from amongst the plurality of motion vectors, identifying a contiguous grouping of motion vectors, wherein the identified contiguous grouping of motion vectors is the subset of motion vectors.

[0078] Identifying the motion pattern of the group based on the determined polygonal contour and the subset motion vectors, may include, at step 203 (i) determining the subset of motion vectors based on the determined polygonal contour, (ii) identifying dominant directional movements of the group based on a classification of each motion vector of the subset of motion vectors, and (iii) identifying the motion pattern of the group based on the identified dominant directional movements of the group. Further, an embodiment of the method 200 may determine the classification of each motion vector of the subset of motion vectors to be one of rightward, leftward, upward, and downward. According to a further embodiment of the method 200, the motion pattern of the group may be identified at step 203 as a lane, an arch, or a turn. In such an embodiment, the motion pattern of the group is identified based on the identified dominant directional movements of the group. For example, responsive to the identified dominant directional movements of the group being in a same direction, the motion pattern may be identified as a lane; responsive to the identified dominant directional movements of the group including a second directional movement connecting a first directional movement and a third directional movement, where the first directional movement and the third directional movement are in opposite directions, the motion pattern may be identified as an arch; and responsive to the identified dominant directional movements of the group including two perpendicular directional movements, wherein an average magnitude for each perpendicular directional movement is above a threshold value, the motion pattern may be identified as a turn.

[0079] Yet another embodiment of the method 200 solves for a gradient solution of an equation for the polygonal contour. This gradient solution indicates an optimal motion of the group based on the polygonal contour. According to an example embodiment of the method 200, the equation may be a Laplace equation. Further, the optimal motion of the group may - 14 - 4131307.v15431.1030001 be classified by an embodiment of the method 200, based on a structure of the gradient solution. In such an embodiment, the optimal motion of the group may be classified as any one of a lane pattern, an arch pattern, and a turn pattern. The method 200 may also, according to an embodiment, compare the optimal motion of the group to the motion pattern of the group identified at step 203. Responsive to the comparing determining the identified motion pattern of the group is not equal to the optimal motion of the group, such an embodiment determines an anomaly is present in the identified motion pattern of the group. In an embodiment of the method 200, solving for the gradient solution of an equation for the polygonal contour may include the processor identifying at least one exit location on the polygonal contour, and solving for the gradient solution of the equation using the at least one exit location identified.

[0080] Further, based on the plurality of motion vectors, an embodiment of the method 200, may determine multiple contour shapes of macroblocks of the video data. In such an embodiment, each contour shape corresponds to a respective group. Further, in one such example embodiment, the motion pattern of each group may be identified based on (i) a corresponding contour shape, from amongst the determined multiple contour shapes and (ii) a respective subset of motion vectors, from amongst the plurality of motion vectors. According to an embodiment, each respective subset of motion vectors corresponds to macroblocks of the corresponding contour shape.

[0081] Embodiments of the method 200 may apply a magnitude decay factor and / or a temporal moving average filter to the subset of motion vectors.

[0082] Since the inception of UAVs, experts have strived to harness their natural mobility to monitor crowds [6]. However, previous studies focus primarily on drone coordination. In contrast, embodiments transform real-time video footage into actionable insights on crowd dynamics. There is active work on utilizing macroscopic crowd patterns, such as using Brox Flow [8, 9] as a starting point and building on it, to achieve simple identification and anomaly detection in crowds on a macroscopic scale. However, the existing approaches are complex, hindering their successful implementation in resource-constrained devices, such as drones. Similarly, others have used a trajectory tracking approach for crowd segmentation

[0010] , but the approach is slow, on the order of a few seconds per frame. Others

[0011] have used Farneback Flow

[0012] which proposes a relatively lightweight approach for crowd pattern recognition, but this approach is not suitable for dynamic UAVs. - 15 - 4131307.v15431.1030001

[0083] Optical flow is defined as the pixel-by-pixel motion observed in a video sequence. Methods for estimating optical flow range from low to high complexity, such as Fast- FlowNet

[0013] , and Deep Matching

[0014] . These approaches are based on neural networks and are quite resource-hungry, taking a few seconds for a single prediction on a CPU and hundreds of milliseconds on an NVIDIA GTX Titan GPU

[0015] . Therefore, these neural network based approaches are untenable for a small formfactor drone. Fast-FlowNet

[0013] reduces the computation time to around 500ms on a small NVIDIA TX2 GPU, which is an improvement, but is still not fast enough for real-time flow estimation. As a result, approaches relying on flow, such as Mehran et al.

[0016] , are also unsound for real-time execution on-board devices, e.g., IoT devices and drones.

[0084] Additionally, there has been active work on video coding in the last decade which has culminated in the production of multiple standards to meet a growing need for video streaming across the globe. The standards include, namely, High-Efficiency Video Coding (HEVC), Joint Exploration Model (JEM), and Versatile Video Coding (VVC)

[0017] . The improvement in coding efficiency has been tremendous. For example, VVC achieves a bit rate reduction of approximately 50% over HEVC, which in turn achieves a bit rate reduction of 50% over previous Advanced Video Coding (AVC) [5], all for the same video quality. Embodiments disclosed herein can capitalize on these developments by piggybacking on the H.264 video-encoding algorithm, so as to efficiently provide crowd pattern identification on- board devices.

[0085] FIG.3 is a flow diagram representing a framework 300 for processing video frames and detecting motion patterns, according to an embodiment. The framework 300 includes functionality for motion estimation 303, crowd pattern detection and lightweight crowd pattern identification based on conditional logic rules 304, and downstream tasks 305.

[0086] In the framework 300, a drone mounted camera 301 captures video frames 302. The frames 302 are then subjected to an encoding process 303, e.g., the existing H.264 encoder process. In the encoding process 303 the frames 302 are processed 306a to generate inter-prediction and intra-prediction data and, further, the frames 302 are subjected to motion compensation 306b. Results from the inter- / intra-prediction 306a and motion compensation 306b are then transformed 306c and coded 306d to generate an encoded video stream 307.

[0087] To continue, the framework 300 utilizes the inter-prediction motion estimation 306a from the encoding process 303 to identify motion patterns according to an embodiment 304. Specifically, the pattern recognition embodiment 304 processes the inter-prediction data - 16 - 4131307.v15431.1030001 to localize 308a a crowd using a CNN, determines a polygonal boundary 308b as well as identifies exits 308c, and identifies 308d motion patterns within the polygonal contour based on the identified exits. Rather than performing the functionality 308a-d to identify the motion pattern, another pattern recognition embodiment 304 processes the inter-prediction data to determine contour regions within the video frame based on an identified group, applies a magnitude decay factor as well as a temporal averaging filter, and identifies motion patterns within the contours in the video frames 302.

[0088] Lastly, the framework 305 can implement downstream tasks 305, such as determining 309a maneuvering (e.g., drone maneuvering) for better crowd monitoring, performing 309b flow segmentation, and detecting 309c anomalies, amongst other examples.

[0089] Motion Estimation

[0090] The lightweight crowd detection described herein, according to an embodiment, utilizes existing video encoding standards such as H.264. The basic idea behind hybrid video encoding algorithms, such as H.264, is the recognition of both spatial and temporal redundancies in a video format and these encoding algorithms use motion estimation and compensation to address temporal redundancy. Two types of motion estimation are used in H.264 encoding, namely, intra-prediction and inter-prediction. Intra-prediction deals with encoding single frames without reference to other frames, while inter-prediction deals with motion between adjacent frames and is the primary motion estimation utilized by embodiments disclosed herein. For inter-prediction, frames are divided into smaller, equally sized blocks called macroblocks. Usually, a grid of 16 × 16 macroblocks is used, but smaller grids, such as 8 × 8 or 16 × 8 macroblocks may also be used. To estimate the motion, a block- matching algorithm compares the macroblocks between two adjacent frames. These block-matching algorithms search for the closest macroblock in the subsequent frame for each macroblock in the subsequent frame, optimizing a cost function. MPEG-4 uses the Sum of Absolute Differences (SAD) as its cost function, defined as Equation (1) below:

[0091] Where fk and fk −1 are the k-th and (k−1)-th frames, respectively, p and q are the length and width of the macroblock, respectively, and x, y, u, and v are indices for individual macroblocks in each frame. A search algorithm is normally used to optimize block matching, as a brute-force search can be very computationally intensive. Many search algorithms have been devised, e.g., Line Diamond Parallel Search (LDPS), Four Step Search (FSS), etc., and a - 17 - 4131307.v15431.1030001 particular implementation of the H.264 standard might use one or the other based on its constraints.

[0092] Crowd Localization Using Neural Network

[0093] A major challenge in crowd motion analysis is distinguishing between relevant motion (people moving) and irrelevant motion (e.g., camera movement, background objects). To address this, an embodiment implements a neural network-based crowd localization step before motion analysis. This network identifies regions containing people, allowing such an embodiment to focus motion estimation only on areas with actual crowd presence.

[0094] Specifically, an embodiment utilizes a state-of-the-art object detection model (e.g., P2PNet

[0014] ), to detect and localize people within in each frame. The network outputs bounding boxes around detected individuals, which embodiments merge into larger regions of interest where crowds are present. This localization step provides two key benefits. First, it filters out irrelevant motion from non-crowd areas of the frame, improving the accuracy of the subsequent motion pattern analysis. Second, by limiting motion estimation to crowd- containing regions, this reduces the computational overhead of block matching, making the system more efficient for real-time drone operation.

[0095] According to an embodiment, the localized crowd regions are passed to an embodiment’s motion estimation module, which applies block matching only within these areas. This focused approach not only improves computational efficiency but also enhances the quality of motion vectors by eliminating noise from irrelevant frame regions. The resulting motion vectors more accurately represent actual crowd movement patterns, leading to better pattern identification by embodiments.

[0096] Macroscopic Pattern Detection

[0097] An embodiment detects crowd patterns by processing an intermediate output, in the form of motion vectors corresponding to each macroblock, from H.264 (or other such encoding methodology) in accordance with the following detection and identification functionality: γ ←0.8; comb, norm ← zeros_like(frame); while video stream is active do SME = getSharedMotionEstimate(currentFrame); contours = findContours(SME); removeSmallCountours(SME, contours); comb = γ × comb + SME[magnitude]; - 18 - 4131307.v15431.1030001 norm[magnitude] = normalize(comb); norm[angles] = α × norm[angles] + (1 – α) × SME[angles]; normContours = getContours(norm); removeSmallContours(norm, normContours); turns = calculateTurns(norm); identify(turns); end

[0098] To detect a pattern of crowd movement, an embodiment first groups contiguous motion vectors. Contours are used as a means of locating contiguous motions throughout a frame, giving rise to the potential of observing multiple crowd patterns within a frame and saving computation by focusing on only the contours rather than the whole frame. It also helps to remove motion noise and aberrations caused by drone movement due to wind or obstacles, as well as imperfections in H.264 video encoding. Furthermore, to focus only on dominant motion vectors and reduce computation, an embodiment removes contours that are 1 / 4 or less of the size of the largest contour in the frame.

[0099] Furthermore, as UAVs experience frequent video jitter and can change their POV, a magnitude decay factor γ ∈ [0, 1] is introduced to address this issue. The magnitude decay factor may be introduced before identifying a motion pattern of the group based on the determined contour shape and a subset of motion vectors. Additionally, the magnitude decay factor may be applied to a plurality of motion vectors, or it may be applied to a subset thereof. This magnitude decay factor deals with jitter in the short term and with changing POV in the long term. γ reduces the intensity of the previous motion estimates with each new iteration. The decayed old estimate and the new motion estimate are then added together. This leads to smooth transitions between motion patterns and removes intermittent jitter. Furthermore, the above noted detection and identification functionality normalizes magnitudes of the combined magnitude estimate to a range of [0, 255], and then converts to integers for faster computation.

[0100] For motion angles, a decay approach does not make theoretical sense, which is why a temporal moving average approach is used to filter out noise in motion angles. For this purpose, an averaging ratio α ∈ [0, 1] is defined where α = 0 means that there is no averaging, and all detection and identification are performed from the new motion estimate, and vice versa for α = 1. The combined angle estimate is then used for further identification. The temporal moving average filter may be introduced before identifying a motion pattern of the group based on the determined contour shape and a subset of motion vectors. Additionally, - 19 - 4131307.v15431.1030001 the temporal moving average filter may be applied to a plurality of motion vectors, or it may be applied to a subset thereof.

[0101] Macroscopic Pattern Identification

[0102] Identification is a crucial step in promoting crowd safety systems via UAVs. An embodiment leverages solutions to the Laplace equation on polygonal domains to predict dominant crowd motion patterns. The key insight of such an embodiment is that crowd flow patterns in bounded spaces often follow potential field solutions, similar to fluid dynamics or heat diffusion processes.

[0103] Specifically, an example embodiment employs Volkov’s method

[0015] for solving the Laplace equation on polygonal domains. Given a bounded domain Ω representing the physical space where crowds can move (e.g., a room, street, or plaza), Equation (2) below is solved. ∆^^^^ = 0 in Ω, ^^^^ = ^^^^ on ^^^^Ω (2)where u represents the potential field and ^^^^ represents boundary conditions derived from observed crowd densities at domain boundaries. The gradient of the solution ∇u then provides likely directions of crowd movement. To construct the bounded domain Ω, an embodiment processes the video frames to identify regions containing people using the neural network- based crowd detection functionality described herein. The convex hull of these regions, along with physical barriers like walls and obstacles, forms the polygonal contour domain. In an embodiment, the boundary conditions ^^^^ are set based on observed crowd densities - higher values where crowds are entering the domain, and lower values where they are exiting.

[0104] The use of the Laplace equation for predicting crowd flow has strong theoretical foundations, with works like Piccoli et al.

[0016] demonstrating its effectiveness in modeling crowd dynamics in bounded environments. Building on this established approach, an embodiment employs Volkov’s exponentially convergent method which is particularly suitable as it handles arbitrary polygonal domains efficiently and provides highly accurate solutions near polygon vertices - crucial for predicting crowd behavior at corners and bottlenecks. The solution provides a potential field where the gradient vectors indicate likely crowd movement directions.

[0105] The resulting flow patterns are classified by an embodiment into three main categories based on the structure of the solution. Lane patterns emerge when ∇u is approximately constant in direction over a region. Arch patterns appear when ∇u follows a - 20 - 4131307.v15431.1030001 curved path between two boundary points. Turn patterns occur where ∇u changes direction sharply, often near domain vertices.

[0106] This physics-based approach provides a robust theoretical foundation for predicting crowd motion patterns, complementing traditional computer vision techniques. The Laplace equation naturally captures important crowd behavior principles like path optimization and flow continuity, while the polygonal domain representation allows embodiments to account for physical constraints of the environment.

[0107] Another embodiment introduces a novel approach to identify dominant motion patterns by combining directional movement ratios and conditional logic rules. Specifically, such an embodiment identifies lane, arch, and turning movements, which are crucial movement patterns. To explain an embodiment’s identification approach mathematically, set- builder notation and logical operators such as ∧ (logical AND), → (implies), and = (equal to) are used. Furthermore, the cardinality of a set (number of elements in a set) is denoted using the operator |.|, that is, the cardinality of the set A would be denoted as |A|.

[0108] An example embodiment starts by defining directional movements S as right, left, up, and down motion (S ≜ {r, l, u, d}) according to the perspective of the video capture device, e.g., drone. A certain motion vector v ≜ (vx, vy) is classified in these directions depending on θ ≜ arctan(vy / vx), which means that in a given frame, a motion vector v is classified as pointing right if {0 < θ ≤ π / 4 ∧ 7π / 4 < θ ≤ 2π}, left if {3π / 4 < θ ≤ 5π / 4}, up if {π / 4 < θ ≤ 3π / 4}, and down if {5π / 4 < θ ≤ 7π / 4}. Each contour c has multiple motion vectors pointing in either of these directions, and identification information lies in the relative proportions of these directions. For each contour c, the proportions of each motion are given by the set in Equation (3): Ƥ^^^^ ≜ {^^^^^^^^^^^^ ∶ ∑^^^^^^^^^^^^ = 1 ∧ ^^^^ ∈ ^^^^} (3)

[0109] Where each motion vector in a contour c counts as one vote towards any direction in S.

[0110] Dominant motion patterns are then identified. Although motion patterns described herein refer to lanes, turns, and arches, it should be understood by a person of ordinary skill in the art that by modifying the presented equations – different patterns may be detected, but are not shown for brevity. Lanes are defined by the straight movement of objects, e.g., pedestrians, in a specific direction. Thus, a contour c can be classified as a lane under the conditions in Equation (4): - 21 - 4131307.v15431.1030001 |{^^^^^^^^ ^^^^ ^^^^^^^^ ∈ Ƥ ∶ ^^^^^^^^ ≥ 0.5}| = 1 (4)∧ |{^^^^^^^^ ^^^^^^^^ ∈ Ƥ : ^^^^^^^^^^^^ ≤ ^^^^^^^^}| = 3 → ^^^^ = ^^^^^^^^^^^^^^^^

[0111] The above equation denotes that if only one direction represents a considerable majority (≥ 50%) of the motion in a contour c, and all other directions individually are less than a certain lane-threshold τl, the contour can be classified as a lane. All other motions must be below the threshold τlas, if there exist other significant motions (≥ τl) in a given frame, they could signify anomalous or another type of crowd motion. Based on empirical results, an embodiment utilizes τl = 0.25.

[0112] The arch case is a motion pattern where members, e.g., pedestrians, have an arching motion in any direction. The condition for arching motion, according to an embodiment, is defined as Equation (5):

[0113] This equation denotes that an arch includes three basic movements where one movement connects two opposite movements (such as down, followed by the right, and then followed by up, as in the case of the UCF marathon 3 sequence

[0018] ). Using this pattern, an arch is identified by observing that one of the basic movements should represent less than or equal to some arch threshold, with the other three being dominant motions. According to an embodiment, τa = 0.10 is utilized.

[0114] The turn case handles motion patterns where objects, e.g., pedestrians, make a perpendicular movement to their current direction. The condition for a turning motion is defined as Equation (6):

[0115] Where a turn is identified if there are two dominant motions in a contour c, denoted by their relative proportion being greater than a turn-threshold τt. Furthermore, in this case, there are additional directional conditions to specify, as a turn occurs when the detected movements are perpendicular to each other. Thus, a turn is classified if the two movements above the threshold are any combination except up and down or right and left, as this would identify a lane rather than a turn. According to an embodiment, τt= 0.15 is utilized.

[0116] In addition to identifying motion patterns, embodiments can be scaled and expanded. For instance, for every contour c, the dominant pattern is calculated at a specific instant, while simultaneously omitting smaller and less significant contours, i.e., those less than 1 / 4 of the size of the largest contour. Therefore, there can be multiple dominant motions - 22 - 4131307.v15431.1030001 in different areas of the frame if the UAV is far enough, and simple heuristics (e.g., number of dominant motions) can be used to infer and adjust the drone’s position relative to the crowd.

[0117] Embodiment Performance

[0118] Multiple datasets and metrics were used to evaluate embodiments and results of the evaluation are described below. To meticulously evaluate embodiments, dense crowd datasets were utilized, namely the UCF Marathon dataset

[0018] , the TUB CrowdFlow dataset

[0021] , and the Crowd Segmentation and Saliency Detection dataset

[0020] , which encapsulate images of dense crowds with dominant motion patterns, effectively synergizing with an example use case of embodiments where UAVs and aerial cameras are utilized to collected video data. In particular, TUB CrowdFlow mimics UAV-recorded videos through dynamic image sequences. Moving toward quantification, an evaluation metric suite encompasses Average Angular Error (AAE), F1-score (i.e., dice coefficient), and execution times.

[0119] Embodiments were also evaluated using a comprehensive private dataset collected during the summer of 2024 across major European cities, including significant coverage of crowd dynamics during the Paris 2024 Olympics. This dataset encompasses diverse crowd scenarios across iconic locations, providing unique perspectives for validating embodiments. In Barcelona, dense tourist flows were captured at Park Guell, where approximately 5,000 daily visitors navigate the Modernist architecture, and at the Sagrada Familia, where crowd movements were recorded from elevated vantage points near the entrance. The Milan segment includes footage from multiple perspectives around the Duomo, including aerial views from the Museo del Novecento’s upper floors and the cathedral’s roof, capturing the intricate interplay of pedestrian flows between the cathedral plaza and the Galleria Vittorio Emanuele II. In Venice, despite the pre-peak tourist season, unique crowd perspectives were obtained from the San Marco Campanile, while Bologna and Florence contributions include elevated views from their respective historic towers. The dataset also includes extensive temporal coverage of crowd dynamics at various times of day, from bright daylight to evening conditions, particularly valuable for testing the robustness of embodiments across different lighting conditions. A notable portion was recorded at the Eiffel Tower’s second tier during the Olympics, providing an exceptional view of large-scale crowd movements during this major international event. The dataset is particularly valuable as it includes challenging scenarios such as varying lighting conditions, different crowd densities, and diverse architectural contexts that affect crowd flow patterns. - 23 - 4131307.v15431.1030001

[0120] A novel metric called ‘refractory period’ is introduced that quantifies the time necessary for the drone to stabilize and accurately perceive crowd motion patterns. This helps to better understand the capabilities of an embodiment that exhibits robustness against minor jitters (common in UAV videos), but cannot discern motions during substantive drone movement. Therefore, ‘refractory period’ not only evaluates an embodiment’s agility in detecting motion but also sets limits to the embodiments expected performance in the real- world, during dynamic aerial crowd surveillance.

[0121] Embodiments were tested on a Dell Precision 7920 workstation with Python 3.11.0, CUDA 11.8, and FFMPEG 4.2.2 libraries. Comparisons for run-times were evaluated on NVIDIA TX2 and Nano GPUs. Both NVIDIA TX2 and Nano GPUs are lightweight (116g and 138g, respectively) embedded GPUs that can be loaded onto small drones (or other devices, e.g., IoT devices) to increase computational processing, even though embodiments can run on-board the drone without any additional hardware.

[0122] A qualitative comparison of the results was performed with those of other dominant motion pattern recognition and identification methods. In this vein, the main works identified for the identification of macroscopic crowd patterns, such as Matkovic et al. [8], and Almeida and Jung

[0011] . However, all these existing methods use optical flow as a baseline input and then build on top of the optical flow using trajectory tracking or other approaches to find the dominant motion pattern. In essence, the quality of the prediction is dependent on the quality of the flow input. The flow methods that these approaches use are Brox flow [9] and Farneback

[0012] . In addition, embodiments were also compared with Lucas- Kanade

[0019] , and finally the Deep Matching

[0014] approach as a representative of a data- driven algorithm.

[0123] FIG.4 depicts a qualitative comparison between an embodiment and existing approaches for pattern recognition using standard datasets. In FIG.4 the detected motion is indicated using shading, while the choice of shading represents the direction of the motion, measured in radians. Specifically, shading 420 indicates a vector movement in an angle between 0 and π / 4, shading 421 indicates a vector movement in an angle between π / 4 and π / 2, shading 422 indicates a vector movement in an angle between π / 2 and (3π) / 4, shading 423 indicates a vector movement in an angle between (3π) / 4 and π, shading 424 indicates a vector movement in an angle between π / 4 and 0, shading 425 indicates a vector movement in an angle between π / 2 and π / 4, shading 426 indicates a vector movement in an angle between (3π) / 4 and π / 2, and shading 427 indicates a vector movement in an angle between π and - 24 - 4131307.v15431.1030001 (3π) / 4. It is noted that embodiments are not limited to the foregoing shading / color-coding and, instead, embodiments can output indications of determined patterns and motion using any methodology known to those of skill in the art. In FIG.4 row 400 illustrates reference images upon which the various motion detection methodologies were applied. Row 401 shows the motions detected using an embodiment as described herein. Row 402 shows results determined using Brox flow used by Almeida and Jung

[0011] and Row 403 shows results determined using the Farneback flow method used by Matkovic et al. [8] Row 404 shows the results determined using the Lucas-Kanade flow

[0019] method, and row 405 shows the results determined using a deep-learning approach. In FIG.4 Column 406 is taken from the UCF Marathon dataset: Marathon 3 sequence

[0018] , Column 407 represents the Mecca sequence from the Crowd Saliency dataset

[0020] , Column 408 represents sequence 5 from the TUB CrowdFlow dataset

[0021] , column 409 shows the same sequence but simulated as a dynamic (moving) scene as viewed from a UAV, and finally Column 410 represents sequence three from the TUB CrowdFlow dataset

[0021] .

[0124] As demonstrated in FIG.4, the motion estimate (pseudo-flow) derived from H.264 using embodiments (row 401), post-implementation of the noise mitigation steps, compares favorably with other recent methods, effectively identifying the dominant motion in a frame. In particular, the resultant shape and structure are of satisfactory quality (especially see performance on Mecca dataset

[0020] column 407). The strategic benefits of embodiments continue to underscore their pragmatic utility and efficiency in real-world applications.

[0125] Because embodiments are centered on real-time lightweight identification of macroscopic patterns, the F1-score (a statistical measure of predictive performance) was used to evaluate the estimated patterns of embodiments, and how temporal averaging (used to mitigate noise) affects the predictions determined using embodiments.

[0126] FIGs.5A-C show plots 501, 502, and 503, respectively, representing the Gaussian-smoothed raw F1-score 504a-c across a sample of the frames 505a-c from the Marathon Dataset for different classified motions, where σ = 6. Specifically, each plot 501- 503 includes a series 506a-c corresponding to half marathon 3 (turn), series 507a-c corresponding to marathon 2 (lane), and a series 508a-c corresponding marathon 3 (arch).

[0127] To simulate a turn, the marathon three sequence was used and input only the right half of the video sequence, thus representing ‘half marathon 3’ 507a-c of FIGs.5A-C. Plot 501 represents results where α = 0.25. Plot 502 represents results where α = 0.50. Plot 503 represents results where α = 0.75. An important observation is that giving more weight to - 25 - 4131307.v15431.1030001 new angle values while using older values to slightly correct produces the most consistently accurate results. FIGs.5A-C show that when there is a greater bias toward previous angular values (α), there is more stability in identification, and vice versa.

[0128] Moreover, because embodiments are geared towards mobile crowds, additional experiments were also performed that involve transitions between crowd patterns by stitching two data sets together and measuring the time it takes for embodiments to adjust their predictions. As few UAV-centric datasets are available, this was the closest testing method.

[0129] FIGs.6A-C shows plots 601, 602, and 603, respectively, representing results from Marathon datasets stitched together. In plots 601-603 of FIGs.6A-C, smoothed F1-scores 604a-c are plotted versus frames 605a-c to analyze the refractory period of embodiment where α represents the ratio of reliance on old information is used. Each plot 601-603 includes a series for α = 0.25 (606a-c), α = 0.50 (607a-c), and α = 0.75 (608a-c). The dashed line 609a-c in plots 601-603 marks the point where the transition from one motion pattern to another occurs. F1-scores 604a-c are Gaussian-smoothed with σ = 6. Plot 601 represents the transition from a lane pattern (Marathon 2) to an arch pattern (Marathon 3). Plot 602 represents the transition from a lane pattern (Marathon 2) to a turning pattern (Half Marathon 3). Plot 603 represents the transition from a turning pattern (Half Marathon 3) to an arch pattern (Marathon 3). Giving more weight to older angle values gives the most stability with a slightly greater number of frames to reach said stability, whereas giving more weight to new angle values seems to show the opposite case. The refractory period was measured using the number of frames until an accuracy above 0.9 is reached (< 30 frames at 30 FPS in FIGs. 6A-C).

[0130] Comparing FIGs.5A-C and FIGs.6A-C, one can appreciate the trade-off involved in choosing α. A higher value of α increases the refractory period but results in a persistently accurate output, while a lower value of α results in a lower refractory period at the cost of unstable performance. Therefore, α can be managed on the fly based on application needs, with a lower α favoring rapid decision making with low confidence, and vice versa.

[0131] FIG.7 shows table 700 which presents a comparative study of and embodiment against state-of-the-art flow estimation techniques in terms of Average Angular Error (AAE) in the TUB CrowdFlow dataset

[0021] . Consistent with the qualitative results depicted in FIG. 4, embodiments provide a commendable performance, notably given their simplicity. Although Farneback stands out as the leading algorithm in this domain, embodiments - 26 - 4131307.v15431.1030001 maintain proximity in the error range, even outperforming Farneback once, all along with the advantage of substantially reduced complexity.

[0132] FIG.8 shows table 800 which illustrates a comparative analysis of the FPS achieved on embedded GPUs, namely NVIDIA TX2 and Nano. The embodiment records FPS between 30fps and 40fps for a video stream with resolution 720 × 400. Lucas-Kanade appears to outperform the embodiment in terms of achieved FPS, but the important thing to note here is that since the embodiment leverages the H.264 encoding process, ∼95% of the reported time involves processes already running on the drone, while the overhead of the embodiment is only 2ms and 9ms per frame on TX2 and Nano, respectively. Compared to Matkovic et al. [8], who reported 91ms per frame on a faster AMD Ryzen 7 processor, a runtime of 2ms still results in a conservative estimate of 45× improvement. Furthermore, approaches like Lucas-Kanade, although similarly fast, lack sharing and will impose a new computational load on the computing board.

[0133] An embodiment provides a tool for empirically solving a Laplace equation on arbitrary polygons using what is referred to herein as a block grid method. Solving the Laplace equation on bounded polygons arises in numerous important applications across physics and engineering. In fluid dynamics, the Laplace equation describes the velocity potential of irrotational flows and helps analyze fluid behavior around complex geometries

[0022] . In electrostatics, the Laplace equation models electric potential distributions around polygonal conductors and dielectrics

[0023] . The Laplace equation also appears in heat conduction problems to determine steady-state temperature distributions in polygonal domains

[0024] . In computer graphics and image processing, solutions to the Laplace equation enable smooth interpolation and mesh generation for polygonal regions

[0025] . Additionally, the Laplace equation finds applications in elasticity theory for analyzing stress distributions in mechanical structures with polygonal cross-sections

[0026] . Given the vast applicability of a numerical solution of Laplace equations, a tool designed to solve Laplace equations on arbitrary polygons, as described herein, provides a significant benefit.

[0134] Embodiments present a unique method, building off of the computer coding language Python, that enables solving the Laplace equation for arbitrary polygonal domains using the Block Grid Method introduced by E. A. Volkov

[0027] . This tool provides an accessible implementation to obtain numerical solutions for applications. The Block Grid Method offers several advantages including high accuracy, ability to handle complex polygonal geometries, and relatively straightforward implementation compared to other - 27 - 4131307.v15431.1030001 numerical approaches. Embodiments make this powerful technique available as an easy-to- use tool that can be readily integrated into various scientific and engineering workflows, e.g., the method 200 described herein.

[0135] Embodiments provide a general-purpose Python implementation of the Block Grid Method that can solve the Laplace equation on arbitrary polygonal domains with various boundary conditions. Key functionalities are exposed through a well-documented library interface and provide comprehensive examples demonstrating usage for different polygon types and boundary conditions. In addition, embodiments introduce a novel algorithmic approach for automatically generating valid block coverings required by the Block Grid Method, as detailed in Algorithm 1 described below. This eliminates the need for manual block placement which was a key limitation in previous implementations.

[0136] As such, an embodiment is directed toward a computer-implemented method for solving a Laplace equation for a polygon. An example method first receives an indication of a polygon and at least one boundary condition, where the polygon is composed of a plurality of vertices and a plurality of edges. In turn, the method generates a first set of circles covering the polygon by, at each vertex of the plurality of vertices, defining a respective circular sector, where each respective circular sector defined covers a first portion of the polygon. Next, one or more half circles are defined by, for each edge of the plurality of edges not covered by the respective circular sectors defined, defining a respective half-circle, wherein each respective half-circle defined covers a second portion of the polygon. Next, one or more full circles are defined based on points of the polygon not covered by the respective circular sectors defined and the respective half-circles defined. In such an embodiment the first set of circles is composed of the respective circular sectors defined, the respective half-circles defined, and the respective full-circles defined. From there, a second set of circles is generated based on the first set of circles and a multiplier. The method then solves a Laplace equation for the polygon using the first set of circles, the second set of circles, and the at least one boundary condition.

[0137] The Block Grid Method, developed by E. A. Volkov

[0027] , is an efficient numerical technique for solving the Laplace equation on polygonal domains. It is an exponentially convergent method, requiring only a few iterations to arrive at a solution very close to the optimal one. The key idea of the Block Grid Method is to cover the polygon by blocks that overlap with each other. The blocks are of three kinds: sectors of disks, half-disks, and disks, i.e., circular sectors, half-circles, and full-circles. At the boundaries of these - 28 - 4131307.v15431.1030001 blocks, the solution is approximated using standard finite difference schemes. Using the approximate solution on the boundaries, the solution on the inner points is then estimated. The overlapping regions between blocks allow for a smooth transition of the solution across block boundaries. For the sake of completion, provided herein are brief details about various definitions and concepts discussed in the complete description of the block grid method. These details are sufficient to understand the implementation of embodiments disclosed herein, however further detail may be provided in the following references

[0027] ,

[0028] , and

[0029] .

[0138] A polygon is defined as a sequence of points P1, P2, … Pxwith x > 2 is given in the complex plane z, z = x + iy. Set P0= Px, Px+1, i.e., understand P0to be the same point as Px, and Px+1 to be the same point as P1. A closed polygon is obtained by successively connecting points P1, P2, … Px, Px+1 by line segments. The line segment is denoted by γj whose endpoints are Pjand Pj+1. The points P1, P2, … Pxare called the vertices of the polygon. Furthermore, the magnitude of the angle at vertex Pj is denoted by αjπ, 0 < αj ≤ 2. For purposes of embodiments disclosed herein, the vertices Pj and sides γj of a closed polygon form a bounded domain Ω.

[0139] The problem that embodiments overcome, i.e., the “Boundary-Value Problem” on a polygonal domain Ω is defined as Equations (7) and (8): ∆^^^^ = 0 (7)^^^^^^^^^^^^ + ^̅^^^^^^^^^^^′^^^^ = ^^^^^^^^(^^^^) on ^^^^^^^^ , ^^^^ = 1,2, … ,^^^^ (8)where Δ ≡ ∂2 / ∂x2+ ∂2 / ∂y2is the Laplace’s operator, γjis a side of the polygon Ω, νjis a parameter equal to 0 or 1, ^̅^^^j = 1 − νj , ^^^^^′^^^is a derivative in the direction of the inner normal to γj, ^^^^j(s) is a specified algebraic polynomial of arc length s reckoned along γj, 1 ≤ ν1+ ν2+ ... + νN ≤ N, N is the total number of vertices of polygon Ω. There exist two special cases: when ν1 = ν2 = ...νN = 1, Equations (7) and (8) correspond to the Dirichlet problem, while if ν1 = ν2= ...νN= 0, Equations (7) and (8) correspond to the Neumann problem.

[0140] To find the approximate solution to Equation (7) on a polygonal domain Ω, (finite covering of the polygon by blocks) the first step entails covering polygon using blocks of three kinds: sectors of disks, half-disks, and disks. Suppose that, in addition to points Pj, j = 1, 2, ...,N, there is a finite number of points Pq, q = N + 1,N + 2, ...,L lying inside of some of the sides of the polygon Ω and also several points Pm,m = L+1,L+2, ...,M lying strictly within the polygon, N ≤ L ≤ M. The points Pj , Pq, and Pm form the poles / centers of the sectors of disks, half-disks and disks, respectively. From a practical standpoint, an arbitrary polygon Ω - 29 - 4131307.v15431.1030001 has points Pj pre-specified, but points Pq and Pm can be chosen / added to have a complete finite covering of the polygon.

[0141] Furthermore, denote by j(q) the number of the side of the polygon Ω on which point Pq lies, N < q ≤ L. Suppose that lj , 1 ≤ j ≤ N is a ray emanating from the vertex Pj and directed along the side, lq, L < q ≤ M is a ray emanating from the point Pq and passing along γj(q)in the direction opposite to the vertex Pj(q), and lm, L < m ≤ M is a ray which emanates from Pmand whose fixed direction is arbitrary. Furthermore, define a polar coordinate systemwith pole at Pμ and angle θμ reckoned from ray lμ counterclockwise, μ = 1, 2, ...,M. Define the blocks using this polar coordinate system as follows in Equations (9) and (10):1 ≤ q ≤ L, is a sector of a disk (a half-disk for ^^^^^^^^ = 1)^^^^^^^^(^^^^) = {(^^^^^^^^, ^^^^^^^^) ∶ 0 < ^^^^^^^^ < ^^^^, 0 < ^^^^ < 2^^^^} (10)L < m ≤ M, is a disk.

[0142] Embodiments specify numbers rμ0, ^^^^^^^∗^ , satisfying the inequalities 01 ≤ μ ≤ M, and, for brevity, introduce the notations µ in Equation (11):

[0143] The blocks (sectors of disks, half-disks, disks) Tμ are called basic blocks and the blocks ^^^^^^∗^^are called extended blocks. For the block solution to work, it is important that both kinds of blocks (basic blocks and extended blocks) lie entirely within the polygon Ω, and the basic blocks should cover the polygon Ω completely. FIGs.9A - 9C, described below, show an example of block coverings possible using these blocks, it should be noted that multiple valid block coverings are possible. Although multiple coverings are equivalent from an algorithmic standpoint, some block coverings could be more computationally intensive than others. In general, the fewer the blocks, the less resources required. Furthermore, it is important to note that classic Block Grid method descriptions

[0027] do not tackle the problem of finding the block covering. Embodiments, however, present a novel methodology to tackle this problem so that the solution can work without human intervention on the block covering.

[0144] FIGs.9A - 9C show example polygons 900, 910, and 920, respectively, illustrating possible block coverings, according to an embodiment. The basic blocks Tμ are shown by solid lines, while the extended blocks ^^^^^^∗^^are shown by dashed lines, μ = 1, 2, ..., M. FIG.9A shows a three-sided polygon 900 with vertices 901a-c. Polygon 900 is completely - 30 - 4131307.v15431.1030001 covered using only blocks of a first kind (also referred to as sectors of disks or sectors of circles), shown by basic blocks 902a-c (represented by solid lines) and by extended blocks 903a-c (represented by dashed lines). While the basic blocks are shown by solid lines and the extended blocks are shown by dashed lines, each is not called out in FIGs.9B – 9C for clarity. FIG.9B shows a six-sided polygon 910 with vertices 911a-f. Polygon 910 is covered using blocks of a first kind, e.g., 912a-f, a block of a second kind 913 (also referred to as half-disks or half-circles) and blocks of a third kind 914a-b (also referred to as disks or full- circles). FIG.9C shows a six-sided polygon 920 with vertices 921a-f. Polygon 920 is covered using blocks of a first kind, e.g., 922, blocks of a second kind 923a-e, and a block of a third kind 924. These example coverings are only one possible way to cover a polygon Ω and there can be several valid block coverings. An embodiment assumes that a satisfactory block covering has been found before solving the Laplace equation.

[0145] Once a finite block covering is found, the next step is to define carrier functions on various blocks. These carrier functions Q(rμ, θμ), μ = 1, 2, ...,N are defined on the polar coordinate system rμ, θμ with pole Pμ.

[0146] To proceed further in the solution, Poisson kernels are defined which dictate how the blocks interact with each other, and how boundary values propagate inside the polygon Ω. Embodiments set, in Equations (12), (13), and (14), respectively: ^^^^(^^^^,^^^^, ^^^^,^^^^, ^^^^) = ^^^^(^^^^,^^^^, ^^^^) + (−1)^^^^^^^^(^^^^,^^^^,−^^^^) (12)^^^^(1 − ^^^^,^^^^, ^^^^,^^^^, ^^^^) = ^^^^(^^^^,^^^^, ^^^^,^^^^, ^^^^) − (−1)^^^^^^^^(^^^^,^^^^, ^^^^,^^^^,^^^^ − ^^^^) (13)where m = 0,1,is the kernel of the Poisson integral for a unit circle.

[0147] To find the approximate solution, the first step is to quantize the curvilinear boundaries of the blocks. Embodiments achieve this by introducing a natural number parameter n (the principal parameter of the method) and the quantities as in Equations (15), (16), and (17):^^^^^^^^^^^^ = (^^^^ − 1 / 2)^^^^^^^^ (17)where 1 ≤ μ ≤ M, 1⌈ ⌉ is the sign of the integer part and, as before, αp= 2 for L < p ≤ M, αj= 1 for N < j ≤ L and αjπ, 0 < αj≤ 2, 1 ≤ j ≤ N, is the magnitude of the interior angle - 31 - 4131307.v15431.1030001 made by the sides γj−1 and γj of the polygon Ω. Here it is important to note that ^^^^^^^^^^^^is the quantized version of θμ and there is slight overloading with ^^^^^^^^^^^^in Equation (34) below where the superscript k represents power instead of quantization.

[0148] To find the final approximate solution, an embodiment first finds the solution onblock boundaries. Consider a pointwhich lies on the curvilinear part ofboundary of the extended block Tμ. By virtue of the complete covering of the polygon by blocks, this point falls on some closed basic block ^�^^^^^∗^^with τ known to be unequal to μ. For definiteness in Equation (18) let: ^^^^ = ^^^^(^^^^,^^^^) = min {^^^^ ∶ ^^^ ^^^^^^^^^ ∈ ^�^^ ∗^^^^^ , 1 ≤ ^^^^ ≤ ^^^^} (18)

[0149] FIG.10 shows interior angles of a portion of an example polygon 1000 and overlapping blocks within the polygon, according to an embodiment. FIG.10 illustrates how the boundaries of two different extended 1001 and 1002 (and basic 1003 and 1004) blocks interact with each other. For a block Tμ 1001, some points (e.g., 1005) on its quantized boundary ^^^^^^^^^^^^= (rμ0,^^^^^^^^^^^^) lie inside basic block ^�^^^^^∗^^1004 (others must lie inside other basic blocks due to conditions on covering of blocks). These points are represented by coordinates ^^^^^^^^ ) inside the coordinat �∗^^^^^^^^ e system of block ^^^^^^^^

[0150] An illustration of two such blocks (Tμ 1001 and ^�^^^^^^∗^1004) and their interaction isshown in FIG.10. Using this interaction between two blocks, the solution on point 1005 �^^^^^^^^^^^^^^^^,^^^^^^^^^^^^^^^^� (which are the coordinates of point ^^^^^^^^^^^^in the polar coordinate system rτ, θτ) can be approximated as a system of O(n) linear algebraic equations as in Equation (19):where 1 ≤ μ ≤ M, 1τ = τ (μ, k). This process can be iterated for all points on boundaries of all blocks. By defining the following shorthand notations in Equations (20), (21), (22):the iterative version of Equation (19) can be written as Equation (23): - 32 - 4131307.v15431.1030001where ^^^^0^^^^,^^^^= 0, 1 ≤ μ ≤ M, 1τ = τ (μ, k). The additional subscript ν represents the iterative improvement of the solution u. More iterations make a better approximation. Embodiments designate νmaxto denote the maximum number of iterations for implementation purposes. Empirically it has been determined that tens of iterations yield an acceptable solution.

[0151] The system in Equation (19) needs to be uniquely solvable first for embodiments to be able iterate using v. It is stated in

[0027] that there exists a natural n0such that for all n ≥ n0the system of linear algebraic equations (19) has a unique solution ^^^^^^^^^^^^, 1 ≤ μ ≤ M, 1 ≤ k ≤ nμ. Suppose equations (24) and (25): ^^^^0^^^^^^^^= 1 (24) ^^^^^^^^^^^^^^^^ = ^^^^^^^^ ∑^^^^^^^^^^^^=1 ^^^^^^^^^^^^−1,^^^^^^^^^^^^^^^^^^^^^^^^(25) 1 ≤ μ ≤ M, 1 ≤ k ≤ nμ, τ = τ (μ, k) ≠ μ is defined by (18),are numerical coefficients from (22). For system (19) to be uniquely solvable, it is necessary and sufficient that the condition in Equation (26) be fulfilled

[0027] . �|^^^^^^^^+1|� < 1 (26)

[0152] Once the solution on the boundaries of the extended blocks has been calculated, one can estimate the solution on the inner points of each corresponding basic block by using the following Equation (27):where ^^^^^^^^^^^^represents the final solution under the natural parameter n.

[0153] Hereinbelow an example implementation of the block-grid method, as well as a novel block generation method for algorithmically covering an arbitrary polygon are described. In order to differentiate between blocks of different kinds: sectors of disks, half- disks, and disks; the description herein may designate sectors of disks as blocks of first kind, half-disks as blocks of second kind, and disks as blocks of third kind. Under this definition, N represents the number of blocks of the first kind, L represents the total number of first and second kind blocks, and M denotes the total number of blocks.

[0154] An example algorithm (Algorithm 1, below) orchestrates the creation of all three block kinds. Algorithm 1takes four inputs, three of which are hyper-parameters that might have an effect on computational complexity and proper covering of the polygon. The four - 33 - 4131307.v15431.1030001 inputs include: (1) A polygon Ω with vertices V = {v1, ... , vn}, (2) Radial heuristic^^^^ ^^^^ (1 / √2, 1), which is the ratio between the extended block radius and the basic blockradius, (3) Overlap heuristic ω ∈ (0, 0.5), which dictates how much overlap exists between blocks when placing second kind blocks on the same edge, and (4) Grid spacing δ which indicates the spacing of discrete points on a grid inside the polygon Ω, on which the solution is estimated and are also used to find uncovered spaces inside the polygon to facilitate the placement of third kind blocks.

[0155] Algorithm 1: Block Covering Algorithm Require: Polygon Ω with vertices V = {v1, ... , vN}, radial Heuristic ^^^^, overlap heuristic ω, grid spacing δ Ensure: Set of blocks ^^^^ = {B1, ... ,BM} covering Ω 1: ^^^^ ← ∅ ▷ Initialize empty block set5: return ^^^^1∪ ^^^^2∪ ^^^^3, N, L, M

[0156] Creating the first kind of blocks may be the easiest among the three kinds. The process, according to an embodiment, begins with Algorithm 2, below, which creates first- kind blocks centered at each vertex vi of the polygon. These blocks are circular sectors with central angles matching the interior angles of the polygonal vertices, and their radii are determined by the minimum distance to non-adjacent edges scaled by a radial heuristicparameter ^^^^ ^^^^ (1 / √2, 1). The radius of the block is calculated as rμ0 = ρ・min(DistancesFromEdges); ^^^^^^∗^^= ρ・rμ0, μ = 1, 2, ...,N. This ensures that the block does not leak outside the polygon, and since ρ > 1 / √2, ^^^^^^∗^^, the blocks centered on two vertices cover the entire edge in between them, avoiding placement of any second kind blocks, unless they are unable to do so because the edge-length is longer than the sum of radii (^^^^^^^∗^ , ^^^^^^∗^^+1) as they depend on the minimum distance from non-adjacent edges.

[0157] Algorithm 2: Create First Kind Blocks Require: Polygon Ω with vertices V = {v1, ... , vn}, radial heuristic ρ Ensure: List of first kind blocks ^^^^1- 34 - 4131307.v15431.1030001 3: for μ ← 1 to N do 4: α^^^^^^^^ ← GetVertexAngle(vμ) )8: ^^^^1← ^^^^1∪ {B} 9: end for 10: return ^^^^1, N

[0158] FIG.11 shows interior angles of a portion of an example polygon 1100 illustrating an example covering by second kind blocks 1101-1104, between two first kind blocks 1103 and 1104 centered at points Pj−11125 and Pj 1128, j = 1, 2, ...,N, according to an embodiment. The second kind basic 1102 and 1104 and extended 1101 and 1103 blocks are centered at Pq−11126 and Pq1127, q = N + 1, N + 2, ..., L. Second kind blocks are only placed if uncovered edge length d > 0, and their radius r∗= min∗^^^^^^^^). The overlap heuristic ω helps determine the overlap between consecutively placed second kind blocks. The exact overlap shown in FIG.11 is 2ωr∗.

[0159] Algorithm 3 below handles the creation of second-kind blocks, e.g., 1101-1104 (half-disks) along polygon edges where coverage from first-kind blocks is insufficient. This is computed by first determining the edge= vμ+1−vμ, μ = 1, 2, ...,N, and then determining the length covered by first-kind blocks: dc,μ= ^^^^^^^∗^ + ^^^^^^∗^^+1. The uncovered length isthen simply given by ^^^^ = ||^⃗^^^µ|| - dc,µ. The radii of the second kind basic blocks aredetermined as the minimum of the two adjoining first kind blocksasshown in FIG. 11. For small gaps, where ^^^^ < 2^^^^∗, a single block is placed at position ^^^^is the unit vector along the edge γμ. For larger gaps, multipleblocks are placed with centers at positionswhere j = 1, 2, ..., ⌊(d + r∗) / (2r∗(1 − ω))⌉ and ω is the overlap heuristic. This ensures that the overlap between two blocks is 2ωr∗as shown in FIG.11. Before placing any second kind block of radius r∗, a final check is performed to determine if the second kind block would leak outside the polygon boundary as shown in line 21 of Algorithm 3, below. If leakage is detected, the block is broken down into multiple smaller blocks that cover the same distance along the edge but with progressively reduced radii. Specifically, for each leaking block, its - 35 - 4131307.v15431.1030001 radius is halved iteratively until all the smaller replacement blocks fit completely within the polygon without leakage. This subdivision process is performed independently for each second kind block—blocks that already fit within the polygon maintain their original radius r∗and are not modified. This adaptive radius reduction ensures complete coverage while respecting the polygon boundary constraints.

[0160] Algorithm 3: Create Second Kind Blocks Require: Polygon Ω with vertices V = {v1, ... , vN}, First kind blocksradial heuristic ρ, overlap heuristic ω Ensure: List of second kind blocks ^^^^21: ^^^^2← ∅ 2: L ← |^^^^1| 3: for μ ← 1 to N do 4: dc,μ← ^^^^^^^∗^ + ^^^^^^∗^^+1▷ distance covered along μ-th edge 5:▷ vector along μ-th edge 6: if ∥^⃗^^^μ∥ > dc,μ then 7: d ← ∥^⃗^^^μ∥ − dc,μ 8: ⃗uμ ←^⃗^^^μ / ∥^⃗^^^μ∥ ▷ unit-vector along⃗γμ 9: r0 ← min(rμ0, rμ+1,0) 10: r∗← ρ・ r011: if d < 2r∗then ▷ Only one block needed 12: v ← vμ + (r∗+ 0.5d)・⃗uμ ▷ New vertex v 13: B ← CreateBlock(v, π, r∗, r0, id=L) 14: ^^^^2← ^^^^2∪ {B} 15: L ← L + 1 16: else ▷ Multiple blocks needed 17: num blocks ← ⌊(d + r∗) / (2r∗(1 − ω))⌉ 18: for j ← 0 to num blocks −1 do 19: loc ← min (2r∗(j + 1)(1 − ω), d + 0.5r∗) 20: v ← vμ + loc・ ⃗uμ 21: ←CheckIfLeakAndDecompose(v, r∗) - 36 - 4131307.v15431.1030001 22: {B} ←CreateBlocks(vd, π, ^^^^^^∗^^, ^^^^^^∗^^ / ρ, id=L) 23: ^^^^2← ^^^^2∪ {B} 24: L ← L + |{B}| 25: end for 26: end if 27: end if 28: end for 29: return ^^^^2, L

[0161] To generate blocks of third kind, embodiments first find the spaces still uncovered by first and second kind blocks inside the polygon Ω. This is done by generating a simple grid with spacing δ inside polygon Ω and checking if any of the grid points is covered by any of the input first and second kind blocks. This function is shown in Algorithm 4 below.

[0162] Algorithm 4: Find Uncovered Points 1: function FINDUNCOVEREDPOINTS(Ω, B, δ) 2: G ← grid points with spacing δ inside Ω 3: U ← ∅ ▷ Uncovered points 4: for each point p in G do 5: if p is not covered by any block in B then 6: U ← U ∪ {p} 7: end if 8: end for 9: return U 10: end function

[0163] Using the information about uncovered points, Algorithm 5 below creates third kind blocks. Embodiments mark all the uncovered points as unvisited at the start. Given a set of uncovered points U, the idea is to start with a random point within U that is unvisited and make it the center of a new third kind block with the largest possible radius. This is done by first computing the minimum distance from all the edges of the polygon and equating the radius to ρ times this value. The uncovered points that are covered within this new block are then marked as visited. The process is then repeated until all the points within U are marked as visited.

[0164] Algorithm 5: Create Third Kind Blocks - 37 - 4131307.v15431.1030001 Require: Polygon Ω with vertices V = {v1, ... , vn}, First and second kind blocks ^^^^1∪ ^^^^2, grid spacing δ, radial heuristic ρ Ensure: List of third kind blocks ^^^^3← |^^^^1∪ ^^^^2| ▷ Initialize third kind block counter 2: U ← FindUncoveredPoints(Ω, ^^^^1∪ ^^^^2, δ) 3: if U = ∅ then return 4: end if 5: visited ← {False}|U|▷ Boolean array of length |U| 6: ^^^^3← ∅ 7: I ← random permutation of {0, ... , |U| − 1} 8: for i ∈ I do 9: if visited[i] then 10: continue 11: end if 12: c ← U[i] ▷ Current center point 13: visited[i] ← True 14: r0 ← ρ・ min (DistancesFromEdges(c)) 15: r∗ ← ρ・ r 16: B ← CreateBlock(c, 2π, r∗, r0, id = M) 17: D ← {d(c, p) : p ∈ U} ▷ Distances to all points 18: N ← {j : D[j] ≤ r∗∧¬visited[j]} ▷ Neighbor indices 19: visited[N] ← True 20: ^^^^3← ^^^^3∪ {B} ▷ Add to block collection 21:22: end for 23: return ^^^^3, M

[0165] The complete block covering B = ^^^^1∪ ^^^^2∪ ^^^^3ensures that every point in the polygon lies in at least one block, with controlled overlap between adjacent blocks. The three introduced parameters: radial heuristic ρ, overlap heuristic ω, and grid spacing δ provide control over the degree of overlap, with certain values leading to more overlap and potentially better solution accuracy at the cost of an increased number of blocks, and hence increased computation complexity. - 38 - 4131307.v15431.1030001

[0166] In order to validate embodiments, the effect of different parameters on the final solution was examined. There are two parameters from the Block Grid Method algorithm itself: the natural number parameter n from Equation (15) that controls the number of quantized points on block boundaries, and νmax from Equation (23) that determines the maximum number of iterations for solution refinement. Additionally, there are three parameters relating to the implementation of embodiments: the radial heuristic ρ that controls block sizes (radii), the overlap heuristic ω that determines block overlap amounts, and the grid spacing δ that effects the placement of third kind blocks. How these parameters impact solution accuracy and computational complexity were analyzed. Parameters were evaluated in the chronological order of solution finding process, i.e., the block covering was evaluated first, and then evaluating how the solution performs.

[0167] Although the parameters concerned with block covering (ρ, ω, and δ) do not seem to directly play a role in the final solution calculation, a good selection of these parameters is helpful in finding a proper block covering for two reasons: (i) fewer blocks contribute to lower computational complexity (as it is proportional to the number of blocks), and (ii) the accuracy of the final solution depends on the ratio ρ, with a greater ratio contributing to worse solution.

[0168] FIGs.12A – 12C shows plots 1200, 1210, and 1220, respectively, illustrating the percentage change in the total number of blocks 1201a-c (and hence the computational complexity) used for complete block covering, according to an embodiment versus radial heuristic values 1203a-c. Random polygons with N = 10 (1200), 20 (1210), 30 (1220) vertices were generated with respective average areas 1202a-c. Major decline in the number of blocks is contributed to by the radial heuristic ρ 1203a-c, while the overlap heuristic ω (ω=0.11204a-c, ω=0.21205a-c, ω=0.31206a-c, ω=0.41207a-c, ω=0.451208a-c) plays a minimal role with the effect diminishing as the number of vertices becomes higher. Hence, by using a higher magnitude of ρ1203a-c, one can decrease the total number of blocks and runtime.

[0169] As the absolute number of blocks required to cover any polygon depends on the shape and features of that polygon (see FIGs.9A – 9C), the relative increase or decrease in the number of blocks required to completely cover a polygon was examined due to the aforementioned parameters instead. To examine such change, random polygons were generated with their edge-lengths in between 1 and 2, and with N = 10, 20, 30 vertices. Different values for the parameters ρ and ω were chosen, while δ was set to 0.05. The results - 39 - 4131307.v15431.1030001 of this experiment are shown in FIGs.12A – 12C. The number of blocks for ρ = 0.75 were chosen as a baseline at 0% change. It can be observed that the major change in the number of blocks comes from the change in ρ while the changes in ω contributes slight variations, which become negligible for polygons with higher number of vertices (N = 30). Therefore, it is empirically best to choose a higher value of ρ to decrease the computational complexity of embodiments.

[0170] FIGs.13A – 13F show polygons 1301 – 1306, respectively, illustrating a qualitative comparison of third-kind block placement methods, according to an embodiment. Specifically, FIGs.13A-C illustrate results from a hexagonal grid placement method while FIGs.13D-F illustrate results from a randomized placement method. Points not-covered by first and second kind blocks (not labeled for clarity) are shown as areas 1300a-f. Polygon 1301 illustrates a hexagonal grid placement with a δ value of 0.1, polygon 1302 illustrates a hexagonal grid placement with a δ value of 0.05, and polygon 1303 illustrates a hexagonal grid placement with a δ value of 0.01. Polygon 1304 illustrates a randomized placement with a δ value of 0.1, polygon 1305 illustrates a randomized placement with a δ value of 0.05, and polygon 1306 illustrates a randomized placement with a δ value of 0.01. It can be observed that hexagonal grid placement results in incomplete covering for lower δ value (0.1).

[0171] It can be seen in FIGs.13A-f that as δ (1307a-f) decreases, the number of third- kind blocks (not labeled for clarity) (M − L) required for complete coverage increases for both methods, but embodiment’s randomized placement method (FIGs.13D-F) requires approximately an order of magnitude fewer blocks compared to the hexagonal grid placement (FIGs.13A-C) while achieving similar coverage.

[0172] For placing third-kind blocks, embodiments implement a randomized placement method described in Algorithm 5. An alternative approach would be to cover the uncovered points with a hexagonal grid of circles, where each circle has the minimum possible radius to avoid leaking outside the polygon. However, as shown by FIGs.13A – 13F, this hexagonal grid approach has significant drawbacks. The hexagonal grid method requires approximately an order of magnitude more blocks compared to the randomized placement method of embodiments while achieving similar coverage. Moreover, the hexagonal grid approach can even fail to achieve complete coverage at larger values of δ (e.g., δ = 0.1), as evident in FIG. 13A. The superior efficiency of embodiments’ randomized placement method is demonstrated across different δ values in t FIGs.13D – 13F, consistently requiring fewer blocks while maintaining effective coverage. Additionally, the randomized placement - 40 - 4131307.v15431.1030001 implemented by embodiments shows remarkable stability in the number of blocks required across different δ values, unlike the hexagonal grid method where block count increases dramatically with decreasing δ. While lower δ values remains important for ensuring coverage of tight spaces between blocks, embodiments maintain efficiency without requiring a substantial increase in block count.

[0173] While n and νmaxare key parameters affecting the accuracy of the final solution, the ratio ρ also plays a crucial role in determining solution accuracy, even after a proper block covering is achieved. Additionally, as discussed by Volkov

[0027] , if any curvilinear parts of the extended block boundaries are positioned too close to polygon vertices or ρ approaches 1, this can significantly impact solution accuracy. The relationship between ρ and solution accuracy is complex and warrants careful empirical investigation. To begin this analysis, a known block covering and analytical solution are focused on, where one can systematically examine these relationships. As stated in

[0027] , the difference between empirical solution uμn(rμ, θμ) for a selected n and the ideal solution u(rμ, θμ) is expressed as Equation (28):on ^�^^^^^∗^^∗⊃ ^�^^^^^∗^^, 1 ≤ μ ≤ M, where ^^^^0∗, d0 > 0 are constants independent of rμ, θμ, of n for whichsystem (20) is uniquely solvable, and of μ. However, these constants ^^^^0∗, d0> 0 do depend on ρ =^^^^^^^∗^ / rμ0and M, however, the exact nature of this dependence is unknown.

[0174] A unit square was chosen as an example polygon, with vertices at (0, 0), (1, 0), (1, 1), and (0, 1). For boundary conditions, set u(x, 0) = 0 on the bottom edge, u(x, 1) = sin(πx) on the top edge, and u(0, y) = u(1, y) = 0 on the left and right edges. The analytical solution for this boundary value problem is shown by Equation (29):which can be verified to satisfy both the Laplace equation Δu = 0 and all boundary conditions.

[0175] In order to apply these boundary conditions into the Block Grid Method, embodiments use Taylor’s expansion on the boundary value condition as shown by Equation (30):this provides a good approximation of the boundary condition u(x, 0) near x = 0.5. For a satisfactory approximation, the first three terms of Taylor’s expansion shown in Equation (30) are used. This equation can be rewritten in the form of Equation (31): - 41 - 4131307.v15431.1030001 sin(^^^^^^^^) ≈ 4.059^^^^4 − 8.117^^^^3 + 1.153^^^^2 + 2.905^^^^ + 0.02 (31)

[0176] FIGs.14A - 14H show square polygons 1401 – 1404 and plots 1405-1408, respectively, illustrating block coverings (1401 – 1404) and corresponding approximate solutions (1405 – 1408) for different values of the radial heuristic (ρ) as applied to a square polygon. Polygon 1401 shows a block covering with a radial heuristic ρ of 0.75 and a total number of blocks (M value) of 7, polygon 1402 shows a block covering with a radial heuristic ρ of 0.83 and an M value of 5, polygon 1403 shows a block covering with a radial heuristic ρ of 0.91 and an M value of 4, and polygon 1404 shows a block covering with a radial heuristic ρ of 0.99 and an M value of 4. The approximate solutions to block coverings of the polygons 1401-1404 are shown in plots 1405 – 1408, respectively. In the plots 1405- 1408 magnitude of the solution inside the polygon based on the boundary conditions is shown in accordance with the magnitude shading keys 1420a-d. Plot1405 shows a proximate solution with a radial heuristic ρ of 0.75, a Means Squared Error (MSE) of 7.12×10-7, and ||Δu||2of 4.083, plot 1406 shows a proximate solution with a radial heuristic ρ of 0.83, a MSE of 3.87×10-6, and ||Δu||2of 36.67, plot 1407 shows a proximate solution with a radial heuristic ρ of 0.91, an MSE of 4.07×10-5, and ||Δu||2 of 105.5, and plot 1408 shows a proximate solution with a radial heuristic ρ of 0.99, an MSE of 1.31×10-2, and ||Δu||2 of 1822. The approximate solutions 1405 – 1408 were calculated using n = 15, νmax= 5, and it can be observed that the solution becomes progressively worse as ρ increases, for fixed n. It can also be observed that the discontinuities tend to exist at the boundaries of the block (most pronounced in 1408), forming edges instead of a smooth boundary.

[0177] FIG.15 shows plot 1500 illustrating a comparison of MSE 1501 vs. n 1502 for different values of radial heuristic (ρ) 1503-1508 on a log-scale. Plot 1500 illustrates a radial heuristic (ρ) value of 0.75 (1503), 0.8 (1504), 0.85 (1505), 0.9 (1506), 0.95 (1507), and 0.99 (1508). It can be observed that for a fixed ρ, the error largely follows a linear decrease in log- scale (as also expressed in Equation (22)). It can be understood that the error is worse for larger numbers of ρ for a fixed n. Furthermore, the error is capped at bottom (equivalent to around 60dB peak-signal-to-noise-ratio (PSNR)) due to rounding errors in the computations.

[0178] Using the Taylor expansion coefficients from Equation (31), the effects of choosing ρ and n on the block covering and the corresponding solution were evaluated, as shown in FIGs.14A – 14H. It can be observed that choosing a larger ρ has adverse effects on solution MSE for the same n. This trend is then verified in FIG.15 where lower ρ values - 42 - 4131307.v15431.1030001 result in rapidly decreasing MSE vs. n until eventually hitting the bottom of round <∼ 10−6(which is there due to rounding errors in computations). It was also verified that the error decreases linearly in log-scale as expressed in Equation (29). However, these observations have an important corollary: even though one could reduce the number of blocks needed to cover the polygon by choosing a large ρ, one pays the price in terms of accuracy of the solution, and the need to choose a larger n to maintain it.

[0179] In order to study this relationship in detail, one needs a large number of analytical solutions to compare to, which is impractical. Therefore, to measure the veracity of embodiments, a proxy of the Mean Squared Error (MSE) was used, namely, the norm of Laplacian operator on u. A true solution of a Laplace equation should satisfy Equation (7), but empirically, the closer the norm is to zero, the lower the MSE. This trend can be observed in FIGs.14E – 14H, where approximation of ||Δu||2 increases proportionally to MSE. Therefore, the 5-point stencil approximation of ||Δu||2 as a pseudo-error (^̃^^^) as follows in Equation (32) can be used: ^̃^^^2 = ||Δ^^^^||224^^^^(^^^^,^^^^)]2(32)where Ω is the domain of the polygon, and δ is the grid spacing for solution calculation. This pseudo-error (^̃^^^) can be utilized to study the trade-off between solution accuracy and the computational price to pay for it, using the choices of ρ and n.

[0180] FIG.16A is a scatter plot 1610 illustrating a comparison of how choices of ρ and n effect the computational complexity and the solution error (^̃^^^) on random polygons, according to an embodiment. Plot 1610 shows runtime 1611 versus number of block 1612 for n values of 10 (1613), 20 (1614), 30 (1615), 40 (1616), and 50 (1617). Plot 1620 shows a bar chart comparing ^̃^^^ 1621 to n 1622 for ρ values of 0.75 (1623), 0.80 (1624), 0.85 (1625), 0.90 (1626), 0.95 (1627), and 0.99 (1628). Plot 1610 shows that the runtime 1611 is directly proportional to M 1612 (total number of blocks), which in turn is inversely proportional to ρ, confirming that a lower choice of ρ increases computational complexity. Plot 1620 shows that higher values of ρ lead to increased outliers as well as an overall increase in error ^̃^^^.

[0181] The versatility and effectiveness of embodiments is demonstrated through two real-world applications: crowd dynamics prediction and heat conduction analysis. For comparison, FreeFem++

[0030] , a powerful partial differential equation solver designed for non-linear multi-physics systems was used. While FreeFem++ provides fast interpolation and - 43 - 4131307.v15431.1030001 robust mesh manipulation through its C++-like language, it has a significant limitation - it can only effectively handle polygons with internal angles that are multiples of 90 degrees. This restriction makes it unsuitable for many real-world scenarios with arbitrary geometries. Embodiments however can handle polygons with any internal angles while maintaining comparable accuracy.

[0182] FIGs.17A – 17C illustrate a case study of crowd flow patterns analyzed in a large square room with two exits at the end of respective long hallways. FIG.17A shows the large square room 1710 with two exits 1711 and 1712 at the end of hallways 1713 and 1714, respectively. In FIG.17A the magnitude of the solution inside the polygon based on the boundary conditions is shown in accordance with the shading 1750. FIG.17B shows plot 1720 illustrating the solution of the large square room with two long hallways and an exit at the end of each respective hallway from FIG.17A. In FIG.17B the magnitude of the solution inside the polygon based on the boundary conditions is shown in accordance with the magnitude shading key 1752. FIG.17C shows plot 1730 comparing MSE 1731 versus vmax values of 2 (1733), 4 (1734), 6 (1735), 8 (1736), 10 (1737), 12 (1738), 14 (1739), and 16 (1740). In this controlled scenario where FreeFem++ can operate, embodiments achieve equivalent accuracy with the log10 of mean squared error reaching as low as -6, as shown in plot 1730. This demonstrates that embodiments can match FreeFem++’s performance in simple geometries while extending the same capabilities to more complex domains.

[0183] Embodiments disclosed herein detail a Python implementation of the Block Grid Method for solving the Laplace equation on arbitrary polygonal domains. Embodiments address a critical need in the scientific and engineering communities by providing an accessible, high-accuracy solution for problems involving the Laplace equation. The contributions, amongst others, include a general-purpose implementation that handles arbitrary polygons, a well-documented interface for easy integration into existing workflows, and a novel algorithm for automatic block covering generation that eliminates manual intervention. Through empirical validation, embodiments have demonstrated that solution accuracy depends on key parameters like n and νmax, while being independent of block covering parameters once a valid covering is achieved. Case studies comparing pyBlockGrid with FreeFem++ disclosed herein show that embodiments achieve comparable accuracy for simple geometries while extending capabilities to arbitrary polygonal domains that existing tools cannot handle effectively. - 44 - 4131307.v15431.1030001

[0184] Disclosed hereinbelow are additional detailed functions and definitions for carrier functions and Poisson kernels that may be utilized to implement embodiments disclosed herein. These functions assist in carrying boundary condition information and describing block interactions within the polygonal domain.

[0185] Carrier functions contain or carry information concerning the specified boundary conditions on the indicated sides of the polygon Ω. The polynomials ^^^^^^^^−1and ^^^^^^^^are defined in the boundary conditions on the sides γj−1 and γj as in Equation (33):where ajk, bjk are numerical coefficients and mj−1, mj are the degrees of these polynomials, and θμ be a polar coordinate system with pole Pμ, 1 ≤ μ ≤ M. On the closed extended block- sectors Tj, 1 ≤ j ≤ N, we define a carrier function Qj(rj, θj) as it depends on the values of the parameters νj−1and νjas follows in Equations (34), (35), (36), (37), (38), (39), (40), (41): (1) for νj−1 = νj = 1 (boundary conditions of the first kind are defined on γj−1 and γj )where ^^^^ �^^^^ ,^^^^� = { ^^^^ ^^^^^^^^ cos^^^^^^^^^^^^+ln^^^^^^^^ sin^^^^^^^^^^^^ ^^^^sin ^^^^^^^^^^^^1 ^^^^^^^^ ^^^^ ^^^^ ^^^^^^^^ ^^^^^^^^^^^^ cos^^^^^^^^^^^^^^^^ , sin^^^^^^^^^^^^^^^^ = 0, ^^^^^^^^sin^^^^^^^^^^^^^^^^, �sin ^^^^^^^^^^^^^^^^� ≥2 , ^^^^^^^^^^^^ sin^^^^^^^^ ′^^^^− ^^^^^^^^^^^^^^^^ ^^^^^^^^ sin ^^^^′^^^^^^^^1 sin^^^^^^^^^^^^^^^^, 0 <�sin^^^^^^^^^^^^^^^^� <2 (35) where k′ = [kαj+ 1 / 2] / αj, [ ] is the sign of the integer part, σjk= (6rj0 / 5)k−k′, αjπ is the magnitude of the vertex angle of the sector Tj, (2) for νj−1 = νj = 0 (boundary conditions of the second kind are defined on γj−1 and γj)- 45 - 4131307.v15431.1030001 (3) for νj−1 = 0, νj = 1 (boundary conditions of the second kind and the first kind are defined on γj−1 and γj , respectively)(4) for νj−1 = 1, νj = 0 (boundary conditions of the first and the second kind are defined on γj−1 and γj, respectively)

[0186] Furthermore, for the half-disk Tq, N < q ≤ L, suppose j(q) is the number of the side of the polygon which contains the point Pq (pole of half-disk), and sq is the arc length s of the boundary of the polygon Ω corresponding to the point Pq (s increases in the direction of the positive traverse of the boundary). Represent the polynomial ^^^^^^^^(^^^^)defined on the side γj(q) as Equation (42):where cqkare numerical coefficients. Define the carrier function in Equation (43):

[0187] Finally, in Equation (44), let:

[0188] The Poisson Kernels are specified as in equations (45), (46), and (47):- 46 - 4131307.v15431.1030001where j(q) is the number of the side on which the point Pi lies, νj−1,νj , νj(q) are parameters entering into the boundary condition (2), in Equation (48):

[0189] FIG.18 illustrates a computer network or similar digital processing environment in which embodiments of the present disclosure may be implemented.

[0190] Client computer(s) / devices 1801 and server computer(s) 1802 provide processing, storage, and input / output devices executing application programs and the like. The client computer(s) / devices 1801 can also be linked through communications network 1800 to other computing devices, including other client devices / processes 1801 and server computer(s) 1802. The communications network 1800 can be part of a remote access network, a global network (e.g., the Internet), a worldwide collection of computers, local area or wide area networks, and gateways that currently use respective protocols (TCP / IP, Bluetooth®, etc.) to communicate with one another. Other electronic device / computer network architectures are suitable.

[0191] FIG.19 is a diagram of an example internal structure of a computer (e.g., client processor / device 1801 or server computers 1802) in the computer system of FIG.18. The structure of FIG.19 may, likewise, be included in the UAVs, IoT devices, and control points described herein so as to allow the UAVs, IoT devices, and control points to implement the embodiments described herein, e.g., method 200 and framework 300, amongst others. Each computer 1801, 1802 contains a system bus 1904, where a bus is a set of hardware lines used for data transfer among the components of a computer or processing system. The system bus 1904 is essentially a shared conduit that connects different elements of a computer system (e.g., processor, disk storage, memory, input / output ports, network ports, etc.) that enables the transfer of information between the elements. Attached to the system bus 1904 is an I / O device interface 1901 for connecting various input and output devices (e.g., keyboard, mouse, displays, printers, speakers, etc.) to the computer 1801, 1802. A network interface 1903 allows the computer to connect to various other devices attached to a network (e.g., network 1800 of FIG.18). Memory 1905 provides volatile storage for computer software instructions 1907a and data 1908a used to implement an embodiment of the present disclosure. Disk - 47 - 4131307.v15431.1030001 storage 1906 provides non-volatile storage for computer software instructions 1907b and data 1908b used to implement an embodiment of the present disclosure. A central processor unit 1902 is also attached to the system bus 1904 and provides for the execution of computer instructions.

[0192] In one embodiment, the processor routines 1907a-b and data 1908a-b are a computer program product, including a non-transitory computer-readable medium (e.g., a removable storage medium such as one or more DVD-ROM’s, CD-ROM’s, diskettes, tapes, etc.) that provides at least a portion of the software instructions for an embodiment. The computer program product can be installed by any suitable software installation procedure, as is well known in the art. In another embodiment, at least a portion of the software instructions may also be downloaded over a cable communication and / or wireless connection. In other embodiments, the invention programs are a computer program propagated signal product embodied on a propagated signal on a propagation medium (e.g., a radio wave, an infrared wave, a laser wave, a sound wave, or an electrical wave propagated over a global network such as the Internet, or other network(s)). Such carrier medium or signals may be employed to provide at least a portion of the software instructions for the present invention routines / program 1907a-b.

[0193] Embodiments or aspects thereof may be implemented in the form of hardware, firmware, or software. If implemented in software, the software may be stored on any non- transient computer readable medium that is configured to enable a processor to load the software or subsets of instructions thereof. The processor then executes the instructions and is configured to operate or cause an apparatus to operate in a manner as described herein.

[0194] Further, firmware, software, routines, or instructions may be described herein as performing certain actions and / or functions of the data processors. However, it should be appreciated that such descriptions contained herein are merely for convenience and that such actions in fact result from computing devices, processors, controllers, or other devices executing the firmware, software, routines, instructions, etc.

[0195] It should be understood that the flow diagrams, block diagrams, and network diagrams may include more or fewer elements, be arranged differently, or be represented differently. But it further should be understood that certain implementations may dictate the block and network diagrams and the number of block and network diagrams illustrating the execution of the embodiments be implemented in a particular way. - 48 - 4131307.v15431.1030001

[0196] Accordingly, further embodiments may also be implemented in a variety of computer architectures, physical, virtual, cloud computers, and / or some combination thereof, and thus, the data processors described herein are intended for purposes of illustration only and not as a limitation of the embodiments.

[0197] The teachings of all patents, published applications and references cited herein are incorporated by reference in their entirety.

[0198] While example embodiments have been particularly shown and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the embodiments encompassed by the appended claims.

[0199] References

[0200] [1] E. Vattapparamban, I. G¨uvenc¸, A. I. Yurekli, K. Akkaya, and S. Ulua˘gac¸, “Drones for smart cities: Issues in cybersecurity, privacy, and public safety,” in 2016 International Wireless Communications and Mobile Computing Conference (IWCMC), pp. 216–221, 2016.

[0201] [2] W. Chen, J. Liu, H. Guo, and N. Kato, “Toward robust and intelligent drone swarm: Challenges and future directions,” IEEE Network, vol.34, no.4, pp.278–283, 2020.

[0202] [3] B. Piccoli and A. Tosin, “Time-Evolving Measures and Macroscopic Modeling of Pedestrian Flow,” Archive for Rational Mechanics and Analysis, vol.199, pp. 707–738, Mar.2011.

[0203] [4] C. Feng, P. Han, X. Zhang, B. Yang, Y. Liu, and L. Guo, “Computation offloading in mobile edge computing networks: A survey,” Journal of Network and Computer Applications, vol.202, p.103366, June 2022.

[0204] [5] ISO Central Secretary, “ISO / IEC 14496-10:2022,” standard, International Organization for Standardization, 2022.

[0205] [6] R. S. De Moraes and E. P. De Freitas, “Multi-uav based crowd monitor-ing system,” IEEE Transactions on Aerospace and Electronic Systems, vol.56, no.2, pp.1332– 1345, 2019.

[0206] [7] G. R. Rodr´ıguez-Canosa, S. Thomas, J. Del Cerro, A. Barrientos, and B. MacDonald, “A Real-Time Method to Detect and Track Moving Objects (DATMO) from Unmanned Aerial Vehicles (UAVs) Using a Single Camera,” Remote Sensing, vol.4, pp. 1090–1111, Apr.2012. Number: 4 Publisher: Molecular Diversity Preservation International. - 49 - 4131307.v15431.1030001

[0207] [8] F. Matkovic, M. Ivasic-Kos, and S. Ribaric, “A new approach to dominant motion pattern recognition at the macroscopic crowd level,” Engineering Applications of Artificial Intelligence, vol.116, p.105387, Nov.2022.

[0208] [9] T. Brox, A. Bruhn, N. Papenberg, and J. Weickert, “High accuracy optical flow estimation based on a theory for warping,” in Computer Vision-ECCV 2004: 8th European Conference on Computer Vision, Prague, Czech Republic, May 11-14, 2004. Proceedings, Part IV 8, pp.25–36, Springer, 2004.

[0209]

[0010] L. Zhang, Z. He, M. Gu, and H. Yu, “Crowd segmentation method based on trajectory tracking and prior knowledge learning,” Arabian Journal for Science and Engineering, vol.43, pp.7143–7152, Dec.2017.

[0210]

[0011] I. Almeida and C. Jung, “Crowd flow estimation from calibrated cam- eras,” Machine Vision and Applications, vol.32, Oct.2020.

[0211]

[0012] G. Farneb¨ack, “Two-frame motion estimation based on polynomial ex-pansion,” in Image Analysis: 13th Scandinavian Conference, SCIA 2003 Halmstad, Sweden, June 29–July 2, 2003 Proceedings 13, pp.363–370, Springer, 2003.

[0212]

[0013] L. Kong, C. Shen, and J. Yang, “FastFlowNet: A Lightweight Network for Fast Optical Flow Estimation,” in 2021 IEEE International Conference on Robotics and Automation (ICRA), pp.10310–10316, May 2021. ISSN: 2577-087X.

[0213]

[0014] J. Revaud, P. Weinzaepfel, Z. Harchaoui, and C. Schmid, “Deepmatch- ing: Hierarchical deformable dense matching,” International Journal of Computer Vision, vol. 120, pp.300–323, 2016.

[0214]

[0015] A. Dosovitskiy, P. Fischer, E. Ilg, P. H¨ausser, C. Hazirbas, V. Golkov, P.v. d. Smagt, D. Cremers, and T. Brox, “FlowNet: Learning Optical Flow with Convolutional Networks,” in 2015 IEEE International Conference on Computer Vision (ICCV), pp.2758–2766, Dec.2015. ISSN: 2380-7504.

[0215]

[0016] R. Mehran, A. Oyama, and M. Shah, “Abnormal crowd behavior detection using social force model,” in 2009 IEEE Conference on Computer Vision and Pattern Recognition, pp.935–942, June 2009. ISSN: 1063-6919.

[0216]

[0017] B. Bross, Y.-K. Wang, Y. Ye, S. Liu, J. Chen, G. J. Sullivan, and J.-

[0217] R. Ohm, “Overview of the versatile video coding (vvc) standard and its applications,” IEEE Transactions on Circuits and Systems for Video Technology, vol.31, no. 10, pp.3736–3764, 2021. - 50 - 4131307.v15431.1030001

[0218]

[0018] S. Ali and M. Shah, “Floor fields for tracking in high density crowd scenes,” in Computer Vision – ECCV 2008 (D. Forsyth, P. Torr, and A. Zisserman, eds., (Berlin, Heidelberg), pp.1–14, Springer Berlin Heidelberg, 2008.

[0219]

[0019] B. D. Lucas and T. Kanade, “An iterative image registration technique with an application to stereo vision,” in IJCAI’81: 7th international joint conference on Artificial intelligence, vol.2, pp.674–679, 1981.

[0220]

[0020] M. K. Lim, V. J. Kok, C. C. Loy, and C. S. Chan, “Crowd saliency detection via global similarity structure,” in 201422nd International Conference on Pattern Recognition, pp.3957–3962, 2014.

[0221]

[0021] G. Schr¨oder, T. Senst, E. Bochinski, and T. Sikora, “Optical flow dataset and benchmark for visual crowd analysis,” 2018.

[0222]

[0022] G. Birkhoff, “Numerical fluid dynamics,” SIAM Review, vol.25, no.1, pp. 1–34, 1983.

[0223]

[0023] T. Narasimhan, “Laplace equation and faraday’s lines of force,” Water Resources Research, vol.44, no.9, 2008.

[0224]

[0024] M. Monde, H. Arima, W. Liu, Y. Mitutake, and J. A. Hammad, “An analytical solution for two-dimensional inverse heat conduction problems using laplace transform,” International Journal of Heat and Mass Transfer, vol.46, no.12, pp.2135–2148, 2003.

[0225]

[0025] W. Buell and B. Bush, “Mesh generation—a survey,” 1973.

[0226]

[0026] G. Manolis and D. Beskos, “Dynamic stress concentration studies by boundary integrals and laplace transform,” International Journal for Numerical Methods in Engineering, vol.17, no.4, pp.573–599, 1981.

[0227]

[0027] E. A. Volkov, Block method for solving the Laplace equation and for constructing conformal mappings. CRC Press, 2017.

[0228]

[0028] E. A. Volkov, “An exponentially convergent method for the solution of laplace’s equation on polygons,” Mathematics of the USSR-Sbornik, vol.37, no.3, p.295, 1980.

[0229]

[0029] A. A. Dosiyev, “The high accurate block-grid method for solving laplace’s boundary value problem with singularities,” SIAM Journal on Numerical Analysis, vol.42, no.1, pp.153–178, 2004.

[0230]

[0030] F. Hecht, “New development in freefem++,” J. Numer. Math., vol.20, no.3- 4, pp.251–265, 2012. - 51 - 4131307.v1

Claims

5431.1030001 CLAIMS What is claimed is:

1. A computer-implemented method for determining a motion pattern of a group in video data, the method comprising, by a processor: obtaining, in memory of the processor, a plurality of motion vectors, each motion vector indicating movement of a macroblock from a first frame of the video data to a second frame of the video data; based on the plurality of motion vectors, determining a polygonal contour surrounding a subset of motion vectors from the plurality of motion vectors, wherein the polygonal contour represents at least part of the group; and identifying a motion pattern of the group based on the determined polygonal contour and the subset of motion vectors from the plurality of motion vectors.

2. The method of Claim 1, wherein the video data is captured using at least one of: an optical device coupled to an unmanned aerial vehicle, an internet of things connected device, a mobile device, and a stationary optical device.

3. The method of Claim 1, wherein determining the polygonal contour comprises: processing the plurality of motion vectors with a neural network, wherein an output of the processing is a plurality of bounding boxes representing the subset of motion vectors from the plurality of motion vectors; and generating the polygonal contour based on the plurality of bounding boxes.

4. The method of Claim 1, further comprising, by the processor: solving for a gradient solution of an equation for the polygonal contour, wherein the gradient solution indicates an optimal motion of the group based on the polygonal contour.

5. The method of Claim 4, further comprising, by the processor: - 52 - 4131307.v15431.1030001 based on a structure of the gradient solution, classifying the optimal motion of the group as any one of a lane pattern, an arch pattern, and a turn pattern.

6. The method of Claim 4, wherein the equation is a Laplace equation.

7. The method of Claim 4, further comprising, by the processor: comparing the optimal motion of the group to the identified motion pattern of the group; and responsive to the comparing determining the identified motion pattern of the group is not equal to the optimal motion of the group, determining an anomaly is present in the identified motion pattern of the group.

8. The method of Claim 4, wherein solving for the gradient solution of an equation for the polygonal contour comprises, by the processor: identifying at least one exit location on the polygonal contour; and solving for the gradient solution of the equation using the at least one exit location identified.

9. The method of Claim 1, further comprising, by the processor: based on the plurality of motion vectors, determining multiple contour shapes of macroblocks of the video data, wherein each contour shape of the multiple contour shapes corresponds to a respective group.

10. The method of Claim 9, further comprising, by the processor: identifying a motion pattern of each group based on (i) a corresponding contour shape, from amongst the determined multiple contour shapes and (ii) a respective subset of motion vectors, from amongst the plurality of motion vectors, wherein each respective subset of motion vectors corresponds to macroblocks of the corresponding contour shape.

11. The method of Claim 1, wherein the plurality of motion vectors obtained are inter- prediction motion estimation data. - 53 - 4131307.v15431.1030001 12. The method of Claim 1, wherein the group is composed of at least one of: humans, animals, bacteria, and stars.

13. The method of Claim 1, wherein determining the polygonal contour based on the plurality of motion vectors comprises: from amongst the plurality of motion vectors, identifying a contiguous grouping of motion vectors, wherein the identified contiguous grouping of motion vectors is the subset of motion vectors.

14. The method of Claim 1, wherein identifying the motion pattern of the group based on the determined polygonal contour and the subset of motion vectors comprises: determining the subset of motion vectors based on the determined polygonal contour; identifying dominant directional movements of the group based on a classification of each motion vector of the subset of motion vectors; and identifying the motion pattern of the group based on the identified dominant directional movements of the group.

15. The method of Claim 14, further comprising, by the processor: determining the classification of each motion vector of the subset of motion vectors as being one of: rightward, leftward, upward, and downward.

16. The method of Claim 14, wherein the motion pattern of the group is identified as any one of a lane, an arch, or a turn, and wherein the identifying the motion pattern of the group based on the identified dominant directional movements of the group, comprises: responsive to the identified dominant directional movements of the group being in a same direction, identifying the motion pattern as a lane; responsive to the identified dominant directional movements of the group comprising a second directional movement connecting a first directional movement and a third directional movement, where the first directional movement and the third directional movement are in opposite directions, identifying the motion pattern as an arch; and - 54 - 4131307.v15431.1030001 responsive to the identified dominant directional movements of the group comprising two perpendicular directional movements, wherein an average magnitude for each perpendicular directional movement is above a threshold value, identifying the motion pattern as a turn.

17. A computer-based system for determining a motion pattern of a group in video data, the system comprising: a processor; and a memory with computer code instructions stored thereon, the processor and the memory, with the computer code instructions, being configured to cause the system to: obtain, in the memory, a plurality of motion vectors, each motion vector indicating movement of a macroblock from a first frame of the video data to a second frame of the video data; based on the plurality of motion vectors, determine a polygonal contour surrounding a subset of motion vectors from the plurality of motion vectors, wherein the polygonal contour represents at least part of the group; and identify a motion pattern of the group based on the determined polygonal contour and the subset of motion vectors from the plurality of motion vectors.

18. The system of Claim 17 wherein, in determining the polygonal contour, the processor and the memory, with the computer code instructions, are configured to cause the system to: process the plurality of motion vectors with a neural network, wherein an output of the processing is a plurality of bounding boxes representing the subset of motion vectors from the plurality of motion vectors; and generate the polygonal contour based on the plurality of bounding boxes.

19. The system of Claim 17 wherein, in identifying the motion pattern of the group based on the determined polygonal contour and the subset of motion vectors, the processor - 55 - 4131307.v15431.1030001 and the memory, with the computer code instructions, are configured to cause the system to: determine the subset of motion vectors based on the determined polygonal contour; identify dominant directional movements of the group based on a classification of each motion vector of the subset of motion vectors; and identify the motion pattern of the group based on the identified dominant directional movements of the group.

20. A computer-implemented method for solving a Laplace equation for a polygon, the method comprising, by a processor: receiving an indication of a polygon and at least one boundary condition, wherein the polygon is composed of a plurality of vertices and a plurality of edges; generating a first set of circles covering the polygon by: (i) at each vertex of the plurality of vertices, defining a respective circular sector, wherein each respective circular sector defined covers a first portion of the polygon, (ii) for each edge of the plurality of edges not covered by the respective circular sectors defined, defining a respective half-circle, wherein each respective half-circle defined covers a second portion of the polygon, and (iii) defining one or more full-circles based on points of the polygon not covered by the respective circular sectors defined and the respective half-circles defined, wherein the first set of circles is composed of the respective circular sectors defined, the respective half-circles defined, and the respective full- circles defined; generating a second set of circles based on the first set of circles and a multiplier; and solving a Laplace equation for the polygon using the first set of circles, the second set of circles, and the at least one boundary condition. - 56 - 4131307.v1

Citation Information

Patent Citations

  • Visual enhancement and cognitive assistance system

    US20180174281A1

  • Detection device and detection system

    US20210208282A1

  • Global motion estimation using road and ground object labels for geometry-based point cloud compression

    US20220210466A1

  • Methods and system for multi-traget tracking

    US20230360230A1