CommonCamera/README.md
2023-06-01 09:59:00 +08:00

37 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# CommonCamera 通用相机SDK
## 介绍
对相机不同相机厂商的SDK进行封装提供统一的接口方便项目开发使用。
## 使用方法
1. 将 CommonCamera 目录复制到项目依赖下;
2. Cmake 中添加依赖;
```cmake
include_directories(your/proj/path/CommonCamera/include)
file(GLOB_RECURSE COMMON_CAMERA_LIBS your/proj/path/CommonCamera/lib/*.so)
target_link_libraries(your_target ${COMMON_CAMERA_LIBS})
```
3. 在代码中使用
```c++
#include <CommonCamera.h>
// 所有相机都被封装成 CC::Camera 抽象类便于统一操作
std::vector<CC::Camera::Ptr> cameras;
// 创建一个大华相机
cameras.push_back(CC::make_dahua_camera("192.168.1.12", "username", "pass"));
// 创建一个海康相机
cameras.push_back(CC::make_hikvision_camera("192.168.1.12", "username", "pass"));
```
## 目前支持的相机厂商
- 大华 `Camera::Ptr make_hikvision_camera(const std::string &ip, const std::string &username, const std::string &password);`
- 海康 `Camera::Ptr make_dahua_camera(const std::string &ip, const std::string &username, const std::string &password);`
## 目前支持的相机功能