Skip to content

Refactoring Roadmap.

SCA075 edited this page Jan 24, 2024 · 1 revision

Background

I'm not a professional programmer, but I'm learning something new every day. The camera currently consumes significant resources, and the use of OpenCV could substantially reduce these resources by creating a new image. Refactoring aims to make the code more readable and efficient.

Goals of Refactoring

  1. Shared Variables: Share commonly used variables such as json_data or camera parameters between modules, enabling the use of a single object for data exchange among the camera, image handler, and MQTT routines.

  2. Function Simplification: Break down functions to perform a single task, resulting in more functions but making the code more readable. This approach also ensures better distribution of work.

  3. Multiprocessing Implementation: Introduce multiprocessing to ensure optimal workload distribution, enhancing overall performance.

  4. Integration into Add-on: Once the code is more readable and performs better, will consider transforming this integration into an add-on. Using Docker could facilitate the transition from the current implementation to an OpenCV-based solution.

By following these steps, we aim to enhance code readability, efficiency, and pave the way for future improvements, including a potential transition to an OpenCV-based implementation.

Clone this wiki locally