v0.2.3 release
This commit is contained in:
@@ -18,14 +18,14 @@ https://anaconda.org/channels/nvidia/packages/cuda/overview
|
||||
conda install nvidia/label/cuda-12.9.0::cuda-toolkit nvidia::cudnn
|
||||
```
|
||||
## SDK安装方法
|
||||
1. 根据平台(win / linux)和python (如p38、p39、p310)版本下载对应的`.whl`文件
|
||||
1. 根据系统(win / linux),平台(amd64, aarch64), python(如p38、p39、p310) 版本下载对应的`.whl`文件
|
||||
2. 运行pip命令安装:
|
||||
```bash
|
||||
pip install orisys-{version}-{python-version}-{python-version}-{os}_amd64.whl
|
||||
pip install orisys-{version}-{python-version}-{python-version}-{os}_{machine}.whl
|
||||
```
|
||||
如
|
||||
```bash
|
||||
pip install orisys-0.2.0-cp310-cp310-win_amd64.whl
|
||||
pip install orisys-0.2.3-cp310-cp310-win_amd64.whl
|
||||
```
|
||||
|
||||
3. **安装 CuPy(根据您的 CUDA 版本选择):**
|
||||
@@ -184,6 +184,8 @@ centroid, contour, depth = sensor.read_info(
|
||||
* FSHEARX: X切向力,`float`。
|
||||
* FSHEARY: Y切向力,`float`。
|
||||
* FPS: 输出帧率,`float`。
|
||||
* CENTROID: 触碰点的坐标,(x, y)。
|
||||
* CONTOUR: 触碰区域轮廓,`np.ndarray`, shape=(H, W), 未生成时返回`np.empty`
|
||||
|
||||
时间戳
|
||||
* TIMESTAMP: 时间戳字符串(HH:MM:SS),`str`。
|
||||
@@ -198,7 +200,7 @@ centroid, contour, depth = sensor.read_info(
|
||||
返回值数量与有效参数数量一致。
|
||||
|
||||
- 向量/图像类数据:`np.ndarray`
|
||||
- 若当前流程中尚未生成该数据,返回空数组 `np.array([])`
|
||||
- 若当前流程中尚未生成该数据,返回空数组
|
||||
- 标量类数据:`float`
|
||||
- 时间戳:`str`(`TIMESTAMP`,格式为 `HH:MM:SS`)
|
||||
|
||||
@@ -280,3 +282,6 @@ A:`read_info()`按传入的`sensor.info`参数顺序返回一个元组。
|
||||
### Q5:如果没有标定文件,或拼接结果不正确,会发生什么?
|
||||
A:若未指定或未找到标定文件,系统会在需要时创建新的拼接标定数据并保存到默认路径。
|
||||
拼接结果异常通常与标定数据、拼接配置或输入图像质量有关,建议重新生成拼接标定并检查配置参数。
|
||||
|
||||
### Q6: 运行报错:“AttributeError: 'Stitcher' object has no attribute 'pos_default'”
|
||||
A: 请检查视频源的编号是否正确,以及是否能正常打开视频源。在linux 使用`v4l2-ctl --list-devices` 列出设备
|
||||
+1
-1
@@ -16,7 +16,7 @@ def install_nuitka():
|
||||
def build():
|
||||
install_nuitka()
|
||||
|
||||
version = "0.2.2"
|
||||
version = "0.2.3"
|
||||
src_dir = Path("src/orisys")
|
||||
output_dir = Path("build_nuitka")
|
||||
dist_dir = Path("dist_nuitka")
|
||||
|
||||
@@ -16,7 +16,7 @@ def install_nuitka():
|
||||
def build():
|
||||
install_nuitka()
|
||||
|
||||
version = "0.2.2"
|
||||
version = "0.2.3"
|
||||
src_dir = Path("src/orisys")
|
||||
output_dir = Path("build_nuitka")
|
||||
dist_dir = Path("dist_nuitka")
|
||||
|
||||
@@ -18,7 +18,7 @@ def main():
|
||||
print("\n")
|
||||
print(f"Collecting data for device ID: {device_id} on test type: {test_type}, video source: {vid_source}")
|
||||
print("\n")
|
||||
sensor = orisys.Sensor(vid_source, config_name="./config/prototype_of3.json", cal_path= f"./config/{sample_name}.npy", isstitch=True, cuda=True, verbose=True)
|
||||
sensor = orisys.Sensor(vid_source, config_name="./config/prototype_of3.json", cal_path= f"./config/{sample_name}.npy", cuda=False, verbose=True)
|
||||
|
||||
print(f"\n按 'q' 退出程序,按 'r' 重置光流追踪器,按 's' 开始保存,按 'e' 停止保存,按 'j' 减小力,按 'l' 增大力")
|
||||
force = 0 # kgf
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.0 MiB After Width: | Height: | Size: 1.6 MiB |
@@ -1,39 +0,0 @@
|
||||
{
|
||||
"name": "prototype",
|
||||
"version": "1.0",
|
||||
"camera": {
|
||||
"resolution_raw": [1920, 1080],
|
||||
"fps": 60,
|
||||
"units": 15,
|
||||
"units_used": 9,
|
||||
"resolution_stitch": [400, 400]
|
||||
},
|
||||
"stitcher": {
|
||||
"min_area_frac": 0.018,
|
||||
"max_area_frac": 0.035,
|
||||
"max_aspect_ratio": 100,
|
||||
"index": [1,2,3,6,7,8,11,12,13],
|
||||
"margin": 10,
|
||||
"nominal_ov_pos": 100,
|
||||
"n": [3,3],
|
||||
"row_tol": 0.4
|
||||
},
|
||||
"tracker": {
|
||||
"adaptive": true,
|
||||
"lower_threshold": 12.0,
|
||||
"upper_threshold": 18.0,
|
||||
"loop_closure_interval": 1,
|
||||
"dis_preset": "medium",
|
||||
"finest_scale": 1
|
||||
},
|
||||
"contact": {
|
||||
"min_contour_area": 3000,
|
||||
"flow_threshold":1,
|
||||
"div_threshold":0.02,
|
||||
"expansion_threshold": 0.01,
|
||||
"kernel_size": [5,5],
|
||||
"denoise_sigma": 15
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
{
|
||||
"name": "prototype",
|
||||
"version": "1.0",
|
||||
"camera": {
|
||||
"resolution_raw": [1920, 1080],
|
||||
"fps": 60,
|
||||
"units": 15,
|
||||
"units_used": 9,
|
||||
"resolution_stitch": [400, 400]
|
||||
},
|
||||
"stitcher": {
|
||||
"min_area_frac": 0.018,
|
||||
"max_area_frac": 0.035,
|
||||
"max_aspect_ratio": 100,
|
||||
"index": [1,2,3,6,7,8,11,12,13],
|
||||
"margin": 10,
|
||||
"nominal_ov_pos": 100,
|
||||
"n": [3,3],
|
||||
"row_tol": 0.4
|
||||
},
|
||||
"tracker": {
|
||||
"adaptive": true,
|
||||
"lower_threshold": 12.0,
|
||||
"upper_threshold": 18.0,
|
||||
"loop_closure_interval": 1,
|
||||
"dis_preset": "medium",
|
||||
"finest_scale": 2
|
||||
},
|
||||
"contact": {
|
||||
"min_contour_area": 3000,
|
||||
"flow_threshold":1,
|
||||
"div_threshold":0.02,
|
||||
"expansion_threshold": 0.01,
|
||||
"kernel_size": [5,5],
|
||||
"denoise_sigma": 15
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": "1.0",
|
||||
"camera": {
|
||||
"resolution_raw": [1920, 1080],
|
||||
"fps": 60,
|
||||
"fps": 30,
|
||||
"units": 15,
|
||||
"units_used": 9,
|
||||
"resolution_stitch": [400, 400]
|
||||
@@ -16,7 +16,7 @@
|
||||
"margin": 10,
|
||||
"nominal_ov_pos": 100,
|
||||
"n": [3,3],
|
||||
"row_tol": 0.4
|
||||
"row_tol": 0.6
|
||||
},
|
||||
"tracker": {
|
||||
"adaptive": true,
|
||||
@@ -24,7 +24,7 @@
|
||||
"upper_threshold": 18.0,
|
||||
"loop_closure_interval": 1,
|
||||
"dis_preset": "medium",
|
||||
"finest_scale": 3
|
||||
"of_mode": 3
|
||||
},
|
||||
"contact": {
|
||||
"min_contour_area": 3000,
|
||||
|
||||
@@ -14,13 +14,14 @@ os.environ["OPENCV_VIDEOIO_MSMF_ENABLE_HW_TRANSFORMS"] = "0"
|
||||
import cv2
|
||||
import orisys
|
||||
import numpy as np
|
||||
import time
|
||||
|
||||
def main():
|
||||
# 步骤1:创建传感器对象 (必要步骤),
|
||||
# config_name为配置文件名(内置配置文件名)或路径(自定义配置文件路径)
|
||||
# cal_path为校准文件路径, 每一个设备需要创建/使用一个校准文件
|
||||
|
||||
# 步骤1:创建传感器对象 (必要步骤),config_name为配置文件名(内置配置文件名)或路径(自定义配置文件路径)
|
||||
# 方式1: 从视频文件读取
|
||||
sensor = orisys.Sensor("s1.mp4", config_name="./config/prototype_of3.json", cal_path= "./config/cal.npy", isstitch=True, cuda=True, verbose=True)
|
||||
|
||||
sensor = orisys.Sensor("s1.mp4", config_name="./config/prototype_of3.json", cal_path= "./config/dd01a_0.npy", isstitch=True, cuda=False, verbose=True)
|
||||
|
||||
# 方式2: 从摄像头读取(取消注释使用)
|
||||
# sensor = orisys.Sensor(0, config_name="./config/prototype_of3.json", cal_path= "./config/cal.npy", isstitch=True, cuda=True, verbose=True)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 393 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 395 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 391 KiB |
@@ -9,7 +9,7 @@ if configs_dir.exists():
|
||||
|
||||
setup(
|
||||
name="orisys",
|
||||
version="0.2.2",
|
||||
version="0.2.3",
|
||||
description="Orisys - Optical Tactile Sensor SDK",
|
||||
author="Your Name",
|
||||
package_dir={"": "src"},
|
||||
|
||||
@@ -5,7 +5,7 @@ A Python library for processing and analyzing optical tactile sensor data,
|
||||
including image stitching, optical flow tracking, and deformation decomposition.
|
||||
"""
|
||||
|
||||
__version__ = "0.2.2"
|
||||
__version__ = "0.2.3"
|
||||
__author__ = "Orisys"
|
||||
|
||||
from .sensor import Sensor
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": "1.0",
|
||||
"camera": {
|
||||
"resolution_raw": [1920, 1080],
|
||||
"fps": 60,
|
||||
"fps": 30,
|
||||
"units": 15,
|
||||
"units_used": 9,
|
||||
"resolution_stitch": [400, 400]
|
||||
@@ -16,7 +16,7 @@
|
||||
"margin": 10,
|
||||
"nominal_ov_pos": 100,
|
||||
"n": [3,3],
|
||||
"row_tol": 0.4
|
||||
"row_tol": 0.6
|
||||
},
|
||||
"tracker": {
|
||||
"adaptive": true,
|
||||
@@ -24,7 +24,7 @@
|
||||
"upper_threshold": 18.0,
|
||||
"loop_closure_interval": 1,
|
||||
"dis_preset": "medium",
|
||||
"finest_scale": 1
|
||||
"finest_scale": 3
|
||||
},
|
||||
"contact": {
|
||||
"min_contour_area": 3000,
|
||||
|
||||
@@ -35,7 +35,7 @@ class Tracker:
|
||||
|
||||
|
||||
# Aggressive optimization for CPU
|
||||
self.__tracking_inst.setFinestScale(config_tracker["finest_scale"]) # Skip finest pyramid level (2x faster)
|
||||
self.__tracking_inst.setFinestScale(config_tracker["of_mode"]) # Skip finest pyramid level (2x faster)
|
||||
# self.__tracking_inst.setPatchSize(8) # Smaller patches (default 8)
|
||||
# self.__tracking_inst.setPatchStride(4) # Larger stride = fewer patches
|
||||
# self.__tracking_inst.setGradientDescentIterations(12) # Reduce iterations (default 25)
|
||||
@@ -213,7 +213,6 @@ class Tracker:
|
||||
error = self.__getForwardBackwardError(
|
||||
self.__fine_base_frame_queue[i], frame, f)
|
||||
if error < self.__lower_threshold:
|
||||
print("loop closed at frame ", str(i))
|
||||
self.__fine_base_frame_queue = self.__fine_base_frame_queue[:
|
||||
i +
|
||||
1]
|
||||
|
||||
Reference in New Issue
Block a user