The Cost of Abstraction in OpenCV: Quantitative Performance Analysis across C++, Java, and Python

Authors

DOI:

https://doi.org/10.5753/reic.2026.7794

Keywords:

Computer Vision, Programming Languages, Java, C , Cpp, C, Python, OpenCV

Abstract

This article investigates the "cost of abstraction" in the development of computer vision applications using the OpenCV library, analyzing the impact of programming language choice on system performance and stability. Through quantitative experiments using Haar Cascade classifiers, the efficiency of native C++ implementation was compared against managed environments in Java and Python. The results demonstrate that abstraction imposes a measurable cost, resulting in a latency increase between 13% and 20% in interpreted and managed languages, as well as greater temporal variability. Statistical analysis and regression models reveal consistent differences between the evaluated languages, both in latency growth and temporal stability during execution. The findings reinforce the influence of abstraction level on the performance of computer vision applications and contribute with quantitative evidence for comparative evaluation of OpenCV across different execution environments. The study concludes by providing guidelines to assist in technology selection considering the trade-off between computational efficiency and development abstraction.

Downloads

Download data is not yet available.

References

Ahmed, I., Ahmed, N., Batool, K., Mahmood, J., Fatima, E., and Arshad, P. (2026). Performance Comparison of C++, Java, and Python: A Comprehensive Analysis of Programming Languages. Springer. DOI: 10.1007/978-981-95-2212-5_24.

Bradski, G. (2000). The opencv library. Dr. Dobb’s Journal of Software Tools, 25(11):120–126. Disponível em: [link].

Hasan, R. T. H. and Sallow, A. B. (2021). Face detection and recognition using opencv. Journal of Soft Computing and Data Mining. DOI: 10.30880/jscdm.2021.02.02.008.

Iglovikov, V. (2025). Need for speed: A comprehensive benchmark of jpeg decoders in python. DOI: 10.48550/arXiv.2501.13131.

Kaehler, A. and Bradski, G. (2017). Learning OpenCV 3: Computer Vision in C++ with the OpenCV Library. O’Reilly Media, Sebastopol. Disponível em: [link].

Lutz, M. and Ascher, D. (1999). Learning Python. O’Reilly Media.

Meyers, S. (2014). Effective Modern C++. O’Reilly Media.

Nanz, S. and Furia, C. A. (2015). A comparative study of programming languages in rosetta code. In 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering, volume 1, pages 778–788. IEEE. DOI: 10.1109/ICSE.2015.90.

OpenCV Contributors (2025). [link].

Pereira, R., Couto, M., Ribeiro, F., Rua, R., Cunha, J., Fernandes, J. P., and Saraiva, J. (2017). Energy efficiency across programming languages: How do energy, time, and memory relate? In Proceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering, pages 256–267. DOI: 10.1145/3136014.3136031.

Prechelt, L. (2000). An empirical comparison of seven programming languages. Computer, 33(10):23–29. DOI: 10.1109/2.876288.

Ribas, E. R. L. D. (2025). Github - atom organization page. Disponível em: [link].

Schildt, H. (2019). Java: The Complete Reference, Eleventh Edition. McGraw-Hill Education.

SEBESTA, R. W. (2018). Conceitos de Linguagens de Programação. Bookman, 11th edition.

Šrajer, F., Kukelova, Z., and Fitzgibbon, A. (2018). A benchmark of selected algorithmic differentiation tools on some problems in computer vision and machine learning. Optimization Methods and Software. DOI: 10.1080/10556788.2018.1435651.

Szeliski, R. (2022). Computer Vision: Algorithms and Applications. Springer. DOI: 10.1007/978-3-030-34372-9.

TIOBE Software (2026). Tiobe index. Disponível em: [link].

Tukey, J. W. (1977). Exploratory Data Analysis, volume 2. Addison-Wesley.

Published

2026-08-14

How to Cite

Ribas, E. R. L. D., Alves, R. de A., Ramalho, P. L. V. D. S., Ramalho, J. A. V., Pereira, E. do A. M., de Lima, P. P., & de Freitas, R. L. (2026). The Cost of Abstraction in OpenCV: Quantitative Performance Analysis across C++, Java, and Python. Electronic Journal of Undergraduate Research on Computing, 24(1), 602–611. https://doi.org/10.5753/reic.2026.7794

Issue

Section

Full Papers