## 5 Discussion  
In the quest for solutions that enable in-home surveillance of dependent people, we are focused on the use of small assistive UAVs. However, incorporating UAVs indoors requires costly and potentially dangerous testing in real indoor environments. This article has laid out the groundwork for the simulation and evaluation of the capabilities of real-time video processing within a virtual reality environment based on Unity and OpenCV. It was decided to experiment with C++ as the most widely used programming language in OpenCV and Python given its ease of use [37]. In this regard, two approaches to implementing OpenCV-based computer vision algorithms have been studied in this paper. One approach was to use a native DLL written in C++ and the other was to program an external module in Python that communicated with the Unity process through the MQTT protocol. From the experiments conducted, it can be concluded that interoperability between Unity and other languages is improved in terms of data flow by using a subscribe/publish communication protocol such as MQTT rather than creating a native plugin as this is dependent on running on the same thread as Unity. MQTT had already been used by our research team in recent applications related to simulated UAV indoors (e.g., [9; 41; 9]). All video processing was done externally with MQTT, allowing more FPS to be processed. Here, the external approach supported 50 FPS compared to only 20 FPS for the native plugin. Considering the tests performed with a common frame rate, it has also been shown that processing time prior to data transmission is significantly faster in Python than in C++. On the other hand, a slight increase in image processing performance has been found in the C++ language. Although the difference in terms of milliseconds is practically nil compared to Python, it is worth noting that the version of OpenCV used is the same in both languages. Therefore, the difference may be due to language and execution, in line with recent studies comparing both programming languages [31; 33]. In Python, the program is executed in an interpreted form, whereas C++ is a compiled class library, which improves access and processing times. Thus, when a simulator launches a single process that cannot run in a distributed fashion, the use of C++ would be recommended. However, for simulators that require multiple processes that can run in parallel in a distributed manner, it would be recommended to use MQTT to take advantage of multi-threading. Indeed, in the whole run described above, the advantages of MQTT over a native C++ plugin have become apparent. Python via MQTT has proven to offer the best performance, with processing times up to three times shorter. Conceptualisation, A.B., A.P., R.M. and A.F.-C.; methodology, A.B., L.M.B. and R.M. ; software, A.B. and L.M.B. ; writing--original draft preparation, A.B., L.M.B. and A.F.-C.; writing--review and editing, A.B., L.M.B., R.M., A.P. and A.F.-C. All authors have read and agreed to the published version of the manuscript. Figure 13: Total processing times of the colour and face detection algorithms in parallel execution in Python. For colour detection: average, 9.60 ms; minimum, 7.05 ms; maximum, 24.43 ms. For face detection: average, 16.10 ms; minimum, 13.05 ms; maximum, 30.43 ms.  
**Funding:** Grants PID2020-115220 RB-C21 and EQC2019-006063-P funded by MCIN/AEI/10.13039/ 501100011033 and by \"ERDF A way to make Europe\". Grant SBPLY/21/180501/000030 funded by Junta de Comunidades de Castilla-La Mancha. This work has also been partially supported by the Portuguese Fundacao para a Ciencia e a Tecnologia--FCT, I.P. under the project UIDB/04524/2020 and by Portuguese National funds through FITEC--Programa Interface, with reference CIT \"INOV--INESC Inovacao--Financiamento Base\". This work was also partially supported by CIBERSAM of the Instituto de Salud Carlos III. **Institutional Review Board Statement:** Not applicable. **Informed Consent Statement:** Not applicable. **Data Availability Statement:** Not applicable.