Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎉 feat(PiGear): Add official support for new Picamera2 API (Fixes #342)
✨ This update brings official support for the new Picamera2 API, unlocking powerful features for Raspberry Pi Camera Modules and limited USB camera support. Key improvements: - 🚸 Seamless Python wrapper: A robust wrapper around Picamera2 API library simplifies integration with minimal code changes for existing PiGear users. - ⚡️ Enhanced camera control: Leverages libcamera API under the hood for Raspberry Pi Camera Modules. - ⚡️ Existing compatibility: Maintains compatibility with PiGear's existing super-charged multi-threaded and colorspace manipulation framework. - ⚡️ Resource management: Ensures proper resource release during PiGear termination. - ✨ USB camera support (limited): Provides basic functionality for USB webcams. PiGear could accurately differentiates between USB and Raspberry Pi cameras using metadata. - 🧑💻 Backward compatibility: Seamlessly switches to the legacy PiCamera library if Picamera2 is unavailable. - 🧑💻 Standalone functionalities: Separates functionalities for both legacy and newer APIs for clarity. - ⚡️ Automatic configuration management: Handles common configuration parameters and non-standard settings for various camera types. - New internal parameters: - 🚩 auto_align_output_config: Optimizes output frame configuration for the camera sensor. - 🚩 enable_verbose_logs: Enables more detailed logging through Picamera2. - Unified `format` parameter: - 🥅 Defaults to RGB888 (24-bit BGR) for Raspberry Pi cameras. - 🦺 Validates formats for USB cameras before handling. - 🥅 Requires explicit `colorspace` definition if `format` is not MPEG (USB cameras) or for specific formats in Raspberry Pi cameras. - Raspberry Pi camera exclusive parameters: - 🚩 Currently Supports `"controls," "queue," "transform," "bit_depth," "buffer_count," "sensor," and "stride"` with type checks. - ⚡️ Framerate handling: Tailored framerate handling based on camera type. - 🦺 Logging optimization: Added a warning advising users to disable common libcamera messages when logging is disabled. Additional Changes: - 💥 Dropped legacy `picamera` dependency in `Setup.py`. - 💡 Improved code efficiency with short-circuiting and formatting. - 🔊 Updated logging practices. CI: - 🏗️ Temporarily removed PiGear API from code coverage due to hardware limitations.
- Loading branch information