## 3 Materials and Methods
### Requirements for Emergency Management  
In [25], several scenarios were discussed in which the people-counting system could be effectively employed as a supporting tool for the management of emergencies, includinga pandemic, and possible critical issues were also highlighted. In this Subsection, we list the requirements to meet the needs that can arise in emergency scenarios. Such requirements drove the design of the improved system architecture, together with a brand-new User Interface. The following were considered:  
* Alert Notification System: A notification system to alert users when a given event takes place. Such a system not only allows users to be warned about emergencies, but also allows the dissemination of general information about campus life, such as seminars and workshops.
* Emergency Mode: Specific users who deal with campus security can activate a specific mode during an emergency. It makes available specific functionalities mainly devoted to emergency management.
* Real-time Data Visualization for Occupancy: A specific data visualization that shows the campus map together with information about the occupancy of rooms and laboratories that is updated continuously. It is the core functionality for the management of emergencies. In fact, it can act as a tool for evacuation assistance and planning, providing real-time information on the number of people present in each classroom. In this way, emergency responders can promptly evaluate classrooms requiring urgent evacuation, enabling them to prioritize their actions according to the occupancy level of each room. This facilitates the effective distribution of resources, directing rescue endeavours towards areas housing a larger number of individuals.
* Post-Emergency Analysis: A detailed report about a specific emergency can be produced. It contains information about occupancy patterns, evacuation times, and response effectiveness, with the aim of providing advanced analytics to improve emergency management strategies and policies.  
Moreover, the critical issues that can arise during an emergency and that we want to mitigate are the following:  
* System Disruption. The current setup relies on the campus's existing infrastructure, including its power supply and network connectivity. The system operates on the electrical grid, and the cameras send occupancy data through the university's Wi-Fi. However, in the case of emergencies, both the infrastructure and the physical components, such as cameras and sensors, could be compromised. This could render the system temporarily or permanently inoperative, impacting its ability to accurately count and monitor individuals. To mitigate such risks, redundancy strategies could be introduced, such as incorporating backup batteries for the Raspberry Pi that manages the cameras or employing an alternative communication system like LoRa. These solutions would help to maintain system functionality and report any issues with power or connectivity.
* Error Reporting System. At present, the system lacks an \"alarm\" feature to alert users if any node (such as a classroom or lab camera) fails to transmit occupancy data. Enhancements could be made to enable the system to notify administrative staff when a classroom stops sending updates. This would allow personnel to prioritize monitoring efforts on rooms that have not provided recent information.