update test and build scripts
This commit is contained in:
@@ -53,17 +53,29 @@ pip install orisys-0.3.0-cp310-cp310-win_amd64.whl
|
||||
import orisys
|
||||
print(orisys.__version__)
|
||||
```
|
||||
|
||||
5 安装opencl(实验):
|
||||
|
||||
在不带nvidia显卡的设备,可选择通过opencl进行gpu 计算加速,需要确保opencl的库或驱动已经安装,然后在conda环境中安装依赖:
|
||||
|
||||
``` bash
|
||||
pip install pyopencl
|
||||
conda install conda-forge::pyvkfft
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
## `Sensor` 类别
|
||||
### 描述
|
||||
`orisys`套件的核心类,用于从视频文件或实时摄像头中读取传感器图像,创建一个具体的传感器对象(实例)。并完成形变、光流及力信息的计算与管理。
|
||||
|
||||
### 输入参数
|
||||
* **vid_src** (`int | str`, 必填): 传感器 ID、相机编号或视频路径。默认为 `0`。
|
||||
* **config_name** (`str`,可选): 传感器配置`json`文件路径,用于加载对应的参数配置,默认为 `./config/ddjx01`。
|
||||
* **cal_path** (`str`,可选): 复眼拼接校准文件路径,默认为 `./config/cal.npy`。有多个传感器同时运行时建议传感器类创建时建议填写,避免校准文件覆写。在首次运行时程序会在找不到文件时自动创建。
|
||||
* **backend** (`str`,可选): 光流场解耦计算后端,默认为 `auto`,可选`cupy`,`opencl`,`cpu`。
|
||||
* **verbose** (`bool`,可选): 是否输出初始化及运行过程中的详细日志信息,默认为 `False`。
|
||||
|
||||
* **vid_src** (`int | str`, 必填): 传感器 ID、相机编号或视频路径。默认为 `0`。
|
||||
* **config_name** (`str`,可选): 传感器配置`json`文件路径,用于加载对应的参数配置,默认为 `./config/ddjx01`。
|
||||
* **cal_path** (`str`,可选): 复眼拼接校准文件路径,默认为 `./config/cal.npy`。有多个传感器同时运行时建议传感器类创建时建议填写,避免校准文件覆写。在首次运行时程序会在找不到文件时自动创建。
|
||||
* **backend** (`str`,可选): 光流场解耦计算后端,默认为 `auto`,可选`cupy`,`opencl`,`cpu`。
|
||||
* **verbose** (`bool`,可选): 是否输出初始化及运行过程中的详细日志信息,默认为 `False`。
|
||||
|
||||
|
||||
### 返回
|
||||
@@ -135,6 +147,7 @@ if is_touched:
|
||||
|
||||
### 返回
|
||||
`dict`为接触分析结果字典,至少包含以下键:
|
||||
|
||||
* **expansion_mask**: 扩张区域掩码(`np.ndarray`)。
|
||||
* **contraction_mask**: 收缩区域掩码(`np.ndarray`)。
|
||||
* **divergence_map**: 散度图(`np.ndarray`)。
|
||||
@@ -169,13 +182,16 @@ centroid, contour, depth = sensor.read_info(
|
||||
* **args**: 任意数量的 `Sensor.info` 枚举,用于指定需要获取的数据类型。支持的枚举值及对应数据如下:
|
||||
|
||||
### 支持的枚 info keys:
|
||||
|
||||
向量/图像类
|
||||
|
||||
* VRAW: 原始光流场, `np.ndarray`,shape=(H, W, 2)
|
||||
* VNORMAL: 法向光流场, `np.ndarray`,shape=(H, W, 2)
|
||||
* VSHEAR: 切向光流场, `np.ndarray`,shape=(H, W,2)
|
||||
* DEPTH: 深度场(可选), 未启用/未生成时返回空数组`np.array([])`。
|
||||
|
||||
标量类
|
||||
|
||||
* FNORMAL: 法向力,`float`。
|
||||
* FSHEARX: X切向力,`float`。
|
||||
* FSHEARY: Y切向力,`float`。
|
||||
@@ -184,6 +200,7 @@ centroid, contour, depth = sensor.read_info(
|
||||
* CONTOUR: 触碰区域轮廓,`np.ndarray`, shape=(H, W), 未生成时返回`np.empty`
|
||||
|
||||
时间戳
|
||||
|
||||
* TIMESTAMP: 时间戳字符串(HH:MM:SS),`str`。
|
||||
|
||||
注:H/W 由当前`json`文件中的`resolution_stitch`配置分辨率决定。
|
||||
@@ -230,21 +247,33 @@ flow = sensor.read_info(sensor.info.VRAW)
|
||||
## 1. `util.draw_arrows` 方法
|
||||
|
||||
### 输入参数
|
||||
**frame**:背景图像
|
||||
**optical_flow**:光流场
|
||||
**threshold**:光流箭头显示阈值
|
||||
**grid_spaceing**:光流箭头间距(pixel)
|
||||
**arrow_scale**:箭头大小
|
||||
**margin**:箭头最大长度/间距的比例
|
||||
**colormap**:色图,如`cv2.COLORMAP_JET`
|
||||
**below_threshold_color**:RGB格式的`uint8`颜色,如(0, 0, 255)
|
||||
**edge_margin**: 不显示箭头边距(pixel)
|
||||
|
||||
* **frame**:背景图像
|
||||
* **optical_flow**:光流场
|
||||
* **threshold**:光流箭头显示阈值
|
||||
* **grid_spacing**:光流箭头间距(pixel)
|
||||
* **arrow_scale**:箭头大小
|
||||
* **margin**:箭头最大长度/间距的比例
|
||||
* **colormap**:色图,如`cv2.COLORMAP_JET`
|
||||
* **below_threshold_color**:RGB格式的`uint8`颜色,如(0, 0, 255)
|
||||
* **edge_margin**: 不显示箭头边距(pixel)
|
||||
|
||||
### 返回
|
||||
`np.ndarray` :箭头光流可视化图像
|
||||
|
||||
## 2. `util.draw_contact` 方法
|
||||
***
|
||||
|
||||
### 输入参数
|
||||
|
||||
* **image**:背景图像
|
||||
* **contour**:轮廓
|
||||
* **centroid**:触碰点
|
||||
* **point_color**:触碰点的颜色 (BGR)
|
||||
* **region_color**:轮廓的颜色 (BGR)
|
||||
|
||||
### 返回
|
||||
`np.ndarray` :箭头光流可视化图像
|
||||
|
||||
***
|
||||
|
||||
# 配置标定相关
|
||||
|
||||
Reference in New Issue
Block a user