Metadata-Version: 2.4
Name: automated-planting-camera
Version: 1.0.3
Summary: 跨平台摄像头枚举与管理模块，支持 Windows、Linux、macOS 系统
Author-email: tackming2008 <admin@mingtao.name>
License: MIT
Project-URL: Homepage, https://gitee.com/mingtao/automated-planting-camera
Project-URL: Repository, https://gitee.com/mingtao/automated-planting-camera
Project-URL: Issues, https://gitee.com/mingtao/automated-planting-camera/issues
Keywords: camera,webcam,opencv,cross-platform,cv2
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Video :: Capture
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: opencv-python>=4.5.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: twine>=4.0.0; extra == "dev"
Requires-Dist: build>=0.10.0; extra == "dev"
Dynamic: license-file

# automated-planting-camera

跨平台摄像头枚举与管理模块，支持 Windows、Linux、macOS 系统。

## 功能特性

- 摄像头枚举与信息获取
- 单个摄像头操作（打开、读取、释放）
- 上下文管理器支持（with 语句）
- 摄像头测试与分辨率探测
- MJPEG 格式多分辨率兼容性测试
- 跨平台支持（Windows、Linux、macOS）

## 安装

```bash
pip install automated-planting-camera
```

## 依赖

- Python >= 3.8
- opencv-python >= 4.5.0

## 快速开始

```python
from automated_planting_camera import list_cameras, CameraManager

# 列出所有可用摄像头
cameras = list_cameras()
for cam in cameras:
    print(f"摄像头 {cam.index}: {cam.name}, {cam.width}x{cam.height} @ {cam.fps}fps")

# 使用 CameraManager 管理摄像头
manager = CameraManager()

# 测试摄像头
manager.test_camera(0, display=True, duration=5)
```

## 主要类和函数

- `CameraInfo`: 摄像头信息数据类
- `Camera`: 单个摄像头操作类，支持上下文管理器
- `CameraManager`: 摄像头管理器类
- `list_cameras()`: 便捷函数，列出所有可用摄像头
- `get_all_cameras()`: 获取所有摄像头信息
- `get_system_info()`: 获取系统信息
- `print_troubleshooting_guide()`: 打印故障排查指南

## 许可证

MIT License
