Merge branch 'dev' of 192.168.192.162:D:\Users\ykcheungab.MEE1965\Documents\python\orisyssdk_git into dev
@@ -18,14 +18,14 @@ https://anaconda.org/channels/nvidia/packages/cuda/overview
|
|||||||
conda install nvidia/label/cuda-12.9.0::cuda-toolkit nvidia::cudnn
|
conda install nvidia/label/cuda-12.9.0::cuda-toolkit nvidia::cudnn
|
||||||
```
|
```
|
||||||
## SDK安装方法
|
## SDK安装方法
|
||||||
1. 根据平台(win / linux)和python (如p38、p39、p310)版本下载对应的`.whl`文件
|
1. 根据系统(win / linux),平台(amd64, aarch64), python(如p38、p39、p310) 版本下载对应的`.whl`文件
|
||||||
2. 运行pip命令安装:
|
2. 运行pip命令安装:
|
||||||
```bash
|
```bash
|
||||||
pip install orisys-{version}-{python-version}-{python-version}-{os}_amd64.whl
|
pip install orisys-{version}-{python-version}-{python-version}-{os}_{machine}.whl
|
||||||
```
|
```
|
||||||
如
|
如
|
||||||
```bash
|
```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 版本选择):**
|
3. **安装 CuPy(根据您的 CUDA 版本选择):**
|
||||||
@@ -184,6 +184,8 @@ centroid, contour, depth = sensor.read_info(
|
|||||||
* FSHEARX: X切向力,`float`。
|
* FSHEARX: X切向力,`float`。
|
||||||
* FSHEARY: Y切向力,`float`。
|
* FSHEARY: Y切向力,`float`。
|
||||||
* FPS: 输出帧率,`float`。
|
* FPS: 输出帧率,`float`。
|
||||||
|
* CENTROID: 触碰点的坐标,(x, y)。
|
||||||
|
* CONTOUR: 触碰区域轮廓,`np.ndarray`, shape=(H, W), 未生成时返回`np.empty`
|
||||||
|
|
||||||
时间戳
|
时间戳
|
||||||
* TIMESTAMP: 时间戳字符串(HH:MM:SS),`str`。
|
* TIMESTAMP: 时间戳字符串(HH:MM:SS),`str`。
|
||||||
@@ -198,7 +200,7 @@ centroid, contour, depth = sensor.read_info(
|
|||||||
返回值数量与有效参数数量一致。
|
返回值数量与有效参数数量一致。
|
||||||
|
|
||||||
- 向量/图像类数据:`np.ndarray`
|
- 向量/图像类数据:`np.ndarray`
|
||||||
- 若当前流程中尚未生成该数据,返回空数组 `np.array([])`
|
- 若当前流程中尚未生成该数据,返回空数组
|
||||||
- 标量类数据:`float`
|
- 标量类数据:`float`
|
||||||
- 时间戳:`str`(`TIMESTAMP`,格式为 `HH:MM:SS`)
|
- 时间戳:`str`(`TIMESTAMP`,格式为 `HH:MM:SS`)
|
||||||
|
|
||||||
@@ -280,3 +282,6 @@ A:`read_info()`按传入的`sensor.info`参数顺序返回一个元组。
|
|||||||
### Q5:如果没有标定文件,或拼接结果不正确,会发生什么?
|
### Q5:如果没有标定文件,或拼接结果不正确,会发生什么?
|
||||||
A:若未指定或未找到标定文件,系统会在需要时创建新的拼接标定数据并保存到默认路径。
|
A:若未指定或未找到标定文件,系统会在需要时创建新的拼接标定数据并保存到默认路径。
|
||||||
拼接结果异常通常与标定数据、拼接配置或输入图像质量有关,建议重新生成拼接标定并检查配置参数。
|
拼接结果异常通常与标定数据、拼接配置或输入图像质量有关,建议重新生成拼接标定并检查配置参数。
|
||||||
|
|
||||||
|
### Q6: 运行报错:“AttributeError: 'Stitcher' object has no attribute 'pos_default'”
|
||||||
|
A: 请检查视频源的编号是否正确,以及是否能正常打开视频源。在linux 使用`v4l2-ctl --list-devices` 列出设备
|
||||||
@@ -16,7 +16,7 @@ def install_nuitka():
|
|||||||
def build():
|
def build():
|
||||||
install_nuitka()
|
install_nuitka()
|
||||||
|
|
||||||
version = "0.2.0"
|
version = "0.2.3"
|
||||||
src_dir = Path("src/orisys")
|
src_dir = Path("src/orisys")
|
||||||
output_dir = Path("build_nuitka")
|
output_dir = Path("build_nuitka")
|
||||||
dist_dir = Path("dist_nuitka")
|
dist_dir = Path("dist_nuitka")
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ def install_nuitka():
|
|||||||
def build():
|
def build():
|
||||||
install_nuitka()
|
install_nuitka()
|
||||||
|
|
||||||
version = "0.2.0"
|
version = "0.2.3"
|
||||||
src_dir = Path("src/orisys")
|
src_dir = Path("src/orisys")
|
||||||
output_dir = Path("build_nuitka")
|
output_dir = Path("build_nuitka")
|
||||||
dist_dir = Path("dist_nuitka")
|
dist_dir = Path("dist_nuitka")
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ def main():
|
|||||||
print("\n")
|
print("\n")
|
||||||
print(f"Collecting data for device ID: {device_id} on test type: {test_type}, video source: {vid_source}")
|
print(f"Collecting data for device ID: {device_id} on test type: {test_type}, video source: {vid_source}")
|
||||||
print("\n")
|
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' 增大力")
|
print(f"\n按 'q' 退出程序,按 'r' 重置光流追踪器,按 's' 开始保存,按 'e' 停止保存,按 'j' 减小力,按 'l' 增大力")
|
||||||
force = 0 # kgf
|
force = 0 # kgf
|
||||||
@@ -60,7 +60,7 @@ def main():
|
|||||||
sensor.compute_deformation()
|
sensor.compute_deformation()
|
||||||
sensor.compute_contact()
|
sensor.compute_contact()
|
||||||
|
|
||||||
fps, flow, vnormal, img, contour, centroid, depth_map,fnormal,fshearx,fsheary = sensor.read_info(
|
fps, flow, vnormal, img, contour, centroid, depth_map = sensor.read_info(
|
||||||
sensor.info.FPS,
|
sensor.info.FPS,
|
||||||
sensor.info.VRAW,
|
sensor.info.VRAW,
|
||||||
sensor.info.VNORMAL,
|
sensor.info.VNORMAL,
|
||||||
@@ -145,8 +145,6 @@ def main():
|
|||||||
print(f"Stop writing, total frames: {frame_count}")
|
print(f"Stop writing, total frames: {frame_count}")
|
||||||
frame_count = 0
|
frame_count = 0
|
||||||
|
|
||||||
if key == ord("p"):
|
|
||||||
print(f"normal force:{fnormal}, X {fshearx}, Y{fsheary}")
|
|
||||||
if key == ord("i"):
|
if key == ord("i"):
|
||||||
save_mode_index += 1
|
save_mode_index += 1
|
||||||
if save_mode_index >= len(save_mode):
|
if save_mode_index >= len(save_mode):
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 1.6 MiB |
@@ -1,38 +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]
|
|
||||||
},
|
|
||||||
"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,38 +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]
|
|
||||||
},
|
|
||||||
"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",
|
"version": "1.0",
|
||||||
"camera": {
|
"camera": {
|
||||||
"resolution_raw": [1920, 1080],
|
"resolution_raw": [1920, 1080],
|
||||||
"fps": 60,
|
"fps": 30,
|
||||||
"units": 15,
|
"units": 15,
|
||||||
"units_used": 9,
|
"units_used": 9,
|
||||||
"resolution_stitch": [400, 400]
|
"resolution_stitch": [400, 400]
|
||||||
@@ -15,7 +15,8 @@
|
|||||||
"index": [1,2,3,6,7,8,11,12,13],
|
"index": [1,2,3,6,7,8,11,12,13],
|
||||||
"margin": 10,
|
"margin": 10,
|
||||||
"nominal_ov_pos": 100,
|
"nominal_ov_pos": 100,
|
||||||
"n": [3,3]
|
"n": [3,3],
|
||||||
|
"row_tol": 0.6
|
||||||
},
|
},
|
||||||
"tracker": {
|
"tracker": {
|
||||||
"adaptive": true,
|
"adaptive": true,
|
||||||
@@ -23,7 +24,7 @@
|
|||||||
"upper_threshold": 18.0,
|
"upper_threshold": 18.0,
|
||||||
"loop_closure_interval": 1,
|
"loop_closure_interval": 1,
|
||||||
"dis_preset": "medium",
|
"dis_preset": "medium",
|
||||||
"finest_scale": 3
|
"of_mode": 3
|
||||||
},
|
},
|
||||||
"contact": {
|
"contact": {
|
||||||
"min_contour_area": 3000,
|
"min_contour_area": 3000,
|
||||||
|
|||||||
@@ -14,16 +14,17 @@ os.environ["OPENCV_VIDEOIO_MSMF_ENABLE_HW_TRANSFORMS"] = "0"
|
|||||||
import cv2
|
import cv2
|
||||||
import orisys
|
import orisys
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import time
|
|
||||||
def main():
|
def main():
|
||||||
|
# 步骤1:创建传感器对象 (必要步骤),
|
||||||
|
# config_name为配置文件名(内置配置文件名)或路径(自定义配置文件路径)
|
||||||
|
# cal_path为校准文件路径, 每一个设备需要创建/使用一个校准文件
|
||||||
|
|
||||||
# 步骤1:创建传感器对象 (必要步骤),config_name为配置文件名(内置配置文件名)或路径(自定义配置文件路径)
|
|
||||||
# 方式1: 从视频文件读取
|
# 方式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: 从摄像头读取(取消注释使用)
|
# 方式2: 从摄像头读取(取消注释使用)
|
||||||
sensor = orisys.Sensor(0, config_name="./config/prototype_of3.json", cal_path= "./config/cal.npy", isstitch=True, cuda=True, verbose=True)
|
# sensor = orisys.Sensor(0, config_name="./config/prototype_of3.json", cal_path= "./config/cal.npy", isstitch=True, cuda=True, verbose=True)
|
||||||
|
|
||||||
print("\n按 'q' 退出程序,按 'r' 重置光流追踪器")
|
print("\n按 'q' 退出程序,按 'r' 重置光流追踪器")
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,159 @@
|
|||||||
|
<?xml version='1.0' encoding='utf8'?>
|
||||||
|
<nuitka-compilation-report nuitka_version="2.8.9" nuitka_commercial_version="not installed" mode="module" completion="error exit message (1)" exit_message="Failed unexpectedly in Scons C backend compilation.">
|
||||||
|
<module name="orisys" kind="CompiledPythonPackage" usage="root_module" reason="Root module" source_path="${cwd}\src\orisys\__init__.py" distribution="orisys">
|
||||||
|
<optimization-time pass="1" time="0.01" micro_passes="3" />
|
||||||
|
<optimization-time pass="2" time="0.00" micro_passes="1" />
|
||||||
|
<module_usages>
|
||||||
|
<module_usage name="os" finding="excluded" line="1" exclusion_reason="Not following into stdlib unless standalone or requested to follow into stdlib." />
|
||||||
|
<module_usage name="orisys.sensor" finding="relative" line="11" />
|
||||||
|
<module_usage name="orisys" finding="absolute" line="12" />
|
||||||
|
<module_usage name="orisys.util" finding="relative" line="12" />
|
||||||
|
<module_usage name="orisys" finding="absolute" line="13" />
|
||||||
|
<module_usage name="orisys.configs" finding="relative" line="13" />
|
||||||
|
</module_usages>
|
||||||
|
</module>
|
||||||
|
<module name="orisys.HHD" kind="CompiledPythonModule" usage="root_module" reason="Root module" source_path="${cwd}\src\orisys\HHD.py" distribution="orisys">
|
||||||
|
<optimization-time pass="1" time="0.70" micro_passes="6" max_branch_merge="278" merged_total="16265" />
|
||||||
|
<optimization-time pass="2" time="0.10" micro_passes="1" max_branch_merge="258" merged_total="2611" />
|
||||||
|
<module_usages>
|
||||||
|
<module_usage name="numpy" finding="absolute" line="24" />
|
||||||
|
<module_usage name="timeit" finding="excluded" line="27" exclusion_reason="Not following into stdlib unless standalone or requested to follow into stdlib." />
|
||||||
|
<module_usage name="sys" finding="absolute" line="28" />
|
||||||
|
<module_usage name="scipy" finding="absolute" line="29" />
|
||||||
|
<module_usage name="scipy.signal" finding="absolute" line="29" />
|
||||||
|
<module_usage name="scipy.spatial" finding="absolute" line="29" />
|
||||||
|
<module_usage name="cupy" finding="absolute" line="35" />
|
||||||
|
<module_usage name="cupy.cuda" finding="absolute" line="40" />
|
||||||
|
<module_usage name="cupy.cuda.Stream" finding="not-found" line="40" />
|
||||||
|
<module_usage name="cupy" finding="absolute" line="480" />
|
||||||
|
<module_usage name="numpy" finding="absolute" line="861" />
|
||||||
|
<module_usage name="scipy" finding="absolute" line="862" />
|
||||||
|
<module_usage name="scipy.signal" finding="absolute" line="862" />
|
||||||
|
<module_usage name="scipy.spatial" finding="absolute" line="862" />
|
||||||
|
<module_usage name="cupy" finding="absolute" line="867" />
|
||||||
|
<module_usage name="cupyx.scipy.signal" finding="absolute" line="868" />
|
||||||
|
<module_usage name="scipy.spatial.distance" finding="absolute" line="1092" />
|
||||||
|
</module_usages>
|
||||||
|
</module>
|
||||||
|
<module name="orisys.Stitcher" kind="CompiledPythonModule" usage="root_module" reason="Root module" source_path="${cwd}\src\orisys\Stitcher.py" distribution="orisys">
|
||||||
|
<optimization-time pass="1" time="0.68" micro_passes="8" max_branch_merge="113" merged_total="9783" />
|
||||||
|
<optimization-time pass="2" time="0.09" micro_passes="1" max_branch_merge="89" merged_total="1164" />
|
||||||
|
<module_usages>
|
||||||
|
<module_usage name="os" finding="excluded" line="1" exclusion_reason="Not following into stdlib unless standalone or requested to follow into stdlib." />
|
||||||
|
<module_usage name="numpy" finding="absolute" line="2" />
|
||||||
|
<module_usage name="scipy.fft" finding="absolute" line="3" />
|
||||||
|
<module_usage name="scipy.ndimage" finding="absolute" line="4" />
|
||||||
|
<module_usage name="cv2" finding="absolute" line="5" />
|
||||||
|
</module_usages>
|
||||||
|
</module>
|
||||||
|
<module name="orisys.configs" kind="CompiledPythonPackage" usage="root_module" reason="Root module" source_path="${cwd}\src\orisys\configs\__init__.py" distribution="orisys">
|
||||||
|
<optimization-time pass="1" time="0.07" micro_passes="5" max_branch_merge="38" merged_total="1506" />
|
||||||
|
<optimization-time pass="2" time="0.01" micro_passes="1" max_branch_merge="31" merged_total="292" />
|
||||||
|
<module_usages>
|
||||||
|
<module_usage name="os" finding="excluded" line="1" exclusion_reason="Not following into stdlib unless standalone or requested to follow into stdlib." />
|
||||||
|
<module_usage name="json" finding="excluded" line="1" exclusion_reason="Not following into stdlib unless standalone or requested to follow into stdlib." />
|
||||||
|
<module_usage name="sys" finding="absolute" line="2" />
|
||||||
|
<module_usage name="pathlib" finding="excluded" line="3" exclusion_reason="Not following into stdlib unless standalone or requested to follow into stdlib." />
|
||||||
|
</module_usages>
|
||||||
|
</module>
|
||||||
|
<module name="orisys.get_depth" kind="CompiledPythonModule" usage="root_module" reason="Root module" source_path="${cwd}\src\orisys\get_depth.py" distribution="orisys">
|
||||||
|
<optimization-time pass="1" time="0.18" micro_passes="5" max_branch_merge="186" merged_total="2614" />
|
||||||
|
<optimization-time pass="2" time="0.03" micro_passes="1" max_branch_merge="171" merged_total="501" />
|
||||||
|
<module_usages>
|
||||||
|
<module_usage name="numpy" finding="absolute" line="1" />
|
||||||
|
<module_usage name="cv2" finding="absolute" line="2" />
|
||||||
|
<module_usage name="cupy" finding="absolute" line="6" />
|
||||||
|
<module_usage name="cupyx.scipy.ndimage" finding="absolute" line="202" />
|
||||||
|
<module_usage name="cupyx.scipy.ndimage.gaussian_filter" finding="not-found" line="202" />
|
||||||
|
<module_usage name="cupyx.scipy.ndimage" finding="absolute" line="242" />
|
||||||
|
<module_usage name="cupyx.scipy.ndimage.zoom" finding="not-found" line="242" />
|
||||||
|
</module_usages>
|
||||||
|
</module>
|
||||||
|
<module name="orisys.sensor" kind="CompiledPythonModule" usage="root_module" reason="Root module" source_path="${cwd}\src\orisys\sensor.py" distribution="orisys">
|
||||||
|
<optimization-time pass="1" time="0.24" micro_passes="5" max_branch_merge="112" merged_total="4886" />
|
||||||
|
<optimization-time pass="2" time="0.03" micro_passes="1" max_branch_merge="110" merged_total="914" />
|
||||||
|
<module_usages>
|
||||||
|
<module_usage name="os" finding="excluded" line="9" exclusion_reason="Not following into stdlib unless standalone or requested to follow into stdlib." />
|
||||||
|
<module_usage name="numpy" finding="absolute" line="10" />
|
||||||
|
<module_usage name="cv2" finding="absolute" line="11" />
|
||||||
|
<module_usage name="time" finding="absolute" line="12" />
|
||||||
|
<module_usage name="enum" finding="excluded" line="13" exclusion_reason="Not following into stdlib unless standalone or requested to follow into stdlib." />
|
||||||
|
<module_usage name="typing" finding="excluded" line="14" exclusion_reason="Not following into stdlib unless standalone or requested to follow into stdlib." />
|
||||||
|
<module_usage name="threading" finding="excluded" line="15" exclusion_reason="Not following into stdlib unless standalone or requested to follow into stdlib." />
|
||||||
|
<module_usage name="queue" finding="excluded" line="16" exclusion_reason="Not following into stdlib unless standalone or requested to follow into stdlib." />
|
||||||
|
<module_usage name="orisys.Stitcher" finding="relative" line="18" />
|
||||||
|
<module_usage name="orisys.tracker" finding="relative" line="19" />
|
||||||
|
<module_usage name="orisys.HHD" finding="relative" line="20" />
|
||||||
|
<module_usage name="orisys" finding="absolute" line="21" />
|
||||||
|
<module_usage name="orisys.configs" finding="relative" line="21" />
|
||||||
|
<module_usage name="orisys.get_depth" finding="relative" line="22" />
|
||||||
|
<module_usage name="cupy" finding="absolute" line="72" />
|
||||||
|
</module_usages>
|
||||||
|
</module>
|
||||||
|
<module name="orisys.tracker" kind="CompiledPythonModule" usage="root_module" reason="Root module" source_path="${cwd}\src\orisys\tracker.py" distribution="orisys">
|
||||||
|
<optimization-time pass="1" time="0.07" micro_passes="5" max_branch_merge="108" merged_total="2168" />
|
||||||
|
<optimization-time pass="2" time="0.01" micro_passes="1" max_branch_merge="108" merged_total="419" />
|
||||||
|
<module_usages>
|
||||||
|
<module_usage name="cv2" finding="absolute" line="1" />
|
||||||
|
<module_usage name="numpy" finding="absolute" line="2" />
|
||||||
|
</module_usages>
|
||||||
|
</module>
|
||||||
|
<module name="orisys.util" kind="CompiledPythonModule" usage="root_module" reason="Root module" source_path="${cwd}\src\orisys\util.py" distribution="orisys">
|
||||||
|
<optimization-time pass="1" time="0.71" micro_passes="6" max_branch_merge="138" merged_total="1449" />
|
||||||
|
<optimization-time pass="2" time="0.02" micro_passes="1" max_branch_merge="134" merged_total="236" />
|
||||||
|
<module_usages>
|
||||||
|
<module_usage name="cv2" finding="absolute" line="1" />
|
||||||
|
<module_usage name="numpy" finding="absolute" line="2" />
|
||||||
|
<module_usage name="scipy.interpolate" finding="absolute" line="3" />
|
||||||
|
</module_usages>
|
||||||
|
</module>
|
||||||
|
<performance>
|
||||||
|
<memory_usage name="after_launch" value="41095168" />
|
||||||
|
<memory_usage name="before_c_code_generation" value="905592832" />
|
||||||
|
<memory_usage name="before_running_scons" value="910643200" />
|
||||||
|
</performance>
|
||||||
|
<data_composer blob_size="38985" total="1450">
|
||||||
|
<module_data filename="__bytecode.const" blob_name=".bytecode" blob_size="3" input_size="0" />
|
||||||
|
<module_data filename="__constants.const" blob_name="" blob_size="800" input_size="2037" />
|
||||||
|
<module_data filename="module.orisys.HHD.const" blob_name="orisys.HHD" blob_size="11474" input_size="15837" />
|
||||||
|
<module_data filename="module.orisys.Stitcher.const" blob_name="orisys.Stitcher" blob_size="6634" input_size="9431" />
|
||||||
|
<module_data filename="module.orisys.configs.const" blob_name="orisys.configs" blob_size="2966" input_size="4231" />
|
||||||
|
<module_data filename="module.orisys.const" blob_name="orisys" blob_size="612" input_size="1011" />
|
||||||
|
<module_data filename="module.orisys.get_depth.const" blob_name="orisys.get_depth" blob_size="5580" input_size="6725" />
|
||||||
|
<module_data filename="module.orisys.sensor.const" blob_name="orisys.sensor" blob_size="6946" input_size="10850" />
|
||||||
|
<module_data filename="module.orisys.tracker.const" blob_name="orisys.tracker" blob_size="2011" input_size="3419" />
|
||||||
|
<module_data filename="module.orisys.util.const" blob_name="orisys.util" blob_size="1793" input_size="2720" />
|
||||||
|
</data_composer>
|
||||||
|
<command_line>
|
||||||
|
<option value="--module" />
|
||||||
|
<option value="--include-package=orisys" />
|
||||||
|
<option value="--output-dir=build_nuitka" />
|
||||||
|
<option value="--remove-output" />
|
||||||
|
<option value="--no-pyi-file" />
|
||||||
|
<option value="src/orisys" />
|
||||||
|
</command_line>
|
||||||
|
<plugins>
|
||||||
|
<plugin name="anti-bloat" user_enabled="no" />
|
||||||
|
<plugin name="eventlet" user_enabled="no" />
|
||||||
|
<plugin name="gi" user_enabled="no" />
|
||||||
|
<plugin name="implicit-imports" user_enabled="no" />
|
||||||
|
<plugin name="options-nanny" user_enabled="no" />
|
||||||
|
<plugin name="pkg-resources" user_enabled="no" />
|
||||||
|
<plugin name="transformers" user_enabled="no" />
|
||||||
|
</plugins>
|
||||||
|
<distributions>
|
||||||
|
<distribution name="orisys" version="0.2.0" installer="conda" />
|
||||||
|
</distributions>
|
||||||
|
<python python_exe="${sys.prefix}\python.exe" python_flavor="Anaconda Python" python_version="3.10.19" os_name="Windows" os_release="11" arch_name="x86_64" filesystem_encoding="utf-8">
|
||||||
|
<search_path>
|
||||||
|
<path value="${cwd}" />
|
||||||
|
<path value="${cwd}\src" />
|
||||||
|
<path value="${sys.prefix}\DLLs" />
|
||||||
|
<path value="${sys.prefix}\lib" />
|
||||||
|
<path value="${sys.prefix}" />
|
||||||
|
<path value="${sys.prefix}\lib\site-packages" />
|
||||||
|
<path value="${sys.prefix}\lib\site-packages\setuptools\_vendor" />
|
||||||
|
</search_path>
|
||||||
|
</python>
|
||||||
|
<output run_filename="${cwd}\build_nuitka\orisys.cp310-win_amd64.pyd" />
|
||||||
|
</nuitka-compilation-report>
|
||||||
|
Before Width: | Height: | Size: 393 KiB |
|
Before Width: | Height: | Size: 395 KiB |
|
Before Width: | Height: | Size: 391 KiB |
|
After Width: | Height: | Size: 344 KiB |
|
After Width: | Height: | Size: 912 KiB |
|
After Width: | Height: | Size: 429 KiB |
|
After Width: | Height: | Size: 736 KiB |
@@ -9,7 +9,7 @@ if configs_dir.exists():
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="orisys",
|
name="orisys",
|
||||||
version="0.2.0",
|
version="0.2.3",
|
||||||
description="Orisys - Optical Tactile Sensor SDK",
|
description="Orisys - Optical Tactile Sensor SDK",
|
||||||
author="Your Name",
|
author="Your Name",
|
||||||
package_dir={"": "src"},
|
package_dir={"": "src"},
|
||||||
@@ -21,7 +21,6 @@ setup(
|
|||||||
install_requires=[
|
install_requires=[
|
||||||
"numpy>=1.24.4",
|
"numpy>=1.24.4",
|
||||||
"opencv-python>=4.10.0.84",
|
"opencv-python>=4.10.0.84",
|
||||||
"opencv-contrib-python",
|
|
||||||
"scipy>=1.10.1",
|
"scipy>=1.10.1",
|
||||||
],
|
],
|
||||||
extras_require={
|
extras_require={
|
||||||
|
|||||||
@@ -36,12 +36,13 @@ try:
|
|||||||
CUPY_AVAILABLE = True
|
CUPY_AVAILABLE = True
|
||||||
|
|
||||||
# Try to import CuPy streams for parallel execution
|
# Try to import CuPy streams for parallel execution
|
||||||
try:
|
if CUPY_AVAILABLE:
|
||||||
from cupy.cuda import Stream
|
try:
|
||||||
STREAMS_AVAILABLE = True
|
from cupy.cuda import Stream
|
||||||
except ImportError:
|
STREAMS_AVAILABLE = True
|
||||||
Stream = None
|
except ImportError:
|
||||||
STREAMS_AVAILABLE = False
|
Stream = None
|
||||||
|
STREAMS_AVAILABLE = False
|
||||||
|
|
||||||
# Create fused elementwise kernel for torque computation
|
# Create fused elementwise kernel for torque computation
|
||||||
# Computes cross products and combines them in a single kernel pass
|
# Computes cross products and combines them in a single kernel pass
|
||||||
@@ -103,9 +104,9 @@ class nHHD(object):
|
|||||||
raise ValueError("nHHD Solver works only for 2 and 3 dimensions")
|
raise ValueError("nHHD Solver works only for 2 and 3 dimensions")
|
||||||
|
|
||||||
self.psolver.prepare(False)
|
self.psolver.prepare(False)
|
||||||
|
if CUPY_AVAILABLE:
|
||||||
self.stream1 = cp.cuda.Stream()
|
self.stream1 = cp.cuda.Stream()
|
||||||
self.stream2 = cp.cuda.Stream()
|
self.stream2 = cp.cuda.Stream()
|
||||||
|
|
||||||
# create the 3-component decomposition
|
# create the 3-component decomposition
|
||||||
def decompose(self, vfield, verbose=0):
|
def decompose(self, vfield, verbose=0):
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class Stitcher:
|
|||||||
self.nominal_ov_pos=config_stitcher["nominal_ov_pos"]
|
self.nominal_ov_pos=config_stitcher["nominal_ov_pos"]
|
||||||
self.margin=config_stitcher["margin"]
|
self.margin=config_stitcher["margin"]
|
||||||
self.bound=self.nominal_ov_pos - self.margin
|
self.bound=self.nominal_ov_pos - self.margin
|
||||||
|
self.row_tol = config_stitcher["row_tol"]
|
||||||
|
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
print(f"Stitcher initialized with config: {self.config_stitcher}")
|
print(f"Stitcher initialized with config: {self.config_stitcher}")
|
||||||
@@ -110,7 +111,7 @@ class Stitcher:
|
|||||||
def find_stitch_boxes(self,img_src,show = False):
|
def find_stitch_boxes(self,img_src,show = False):
|
||||||
|
|
||||||
img_corr = self.__correct_edge_bloom(img_src)
|
img_corr = self.__correct_edge_bloom(img_src)
|
||||||
self.__detect_nonblack_regions(img_corr,show = show)
|
self.__detect_nonblack_regions(img_corr,show = show, row_tol = self.row_tol)
|
||||||
return len(self.boxes), self.boxes
|
return len(self.boxes), self.boxes
|
||||||
|
|
||||||
# return self.boxes
|
# return self.boxes
|
||||||
@@ -431,7 +432,7 @@ class Stitcher:
|
|||||||
return pos_list
|
return pos_list
|
||||||
|
|
||||||
# Computation Functions
|
# Computation Functions
|
||||||
def __detect_nonblack_regions(self, img, morph_k=3, n_boxes_target=15, bk_thresh_step=10, bk_thresh_max=100,show = False):
|
def __detect_nonblack_regions(self, img, morph_k=3, n_boxes_target=15, bk_thresh_step=10, bk_thresh_max=100,show = False, row_tol = 0.4):
|
||||||
"""
|
"""
|
||||||
Return binary mask of non-black regions and list of bounding boxes (x,y,w,h).
|
Return binary mask of non-black regions and list of bounding boxes (x,y,w,h).
|
||||||
Uses adaptive thresholding on grayscale + small morphology to be robust to illumination.
|
Uses adaptive thresholding on grayscale + small morphology to be robust to illumination.
|
||||||
@@ -509,7 +510,7 @@ class Stitcher:
|
|||||||
heights = [b[3] - b[1] for b in cropped_boxes]
|
heights = [b[3] - b[1] for b in cropped_boxes]
|
||||||
median_height = np.median(heights) if heights else target_h
|
median_height = np.median(heights) if heights else target_h
|
||||||
# Use a fraction of the box height as tolerance (e.g., 20% of box height)
|
# Use a fraction of the box height as tolerance (e.g., 20% of box height)
|
||||||
row_tolerance = max(1, int(median_height * 0.2))
|
row_tolerance = max(1, int(median_height * row_tol))
|
||||||
|
|
||||||
# Quantize y-coordinates to group boxes into rows
|
# Quantize y-coordinates to group boxes into rows
|
||||||
def get_row_key(box):
|
def get_row_key(box):
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ A Python library for processing and analyzing optical tactile sensor data,
|
|||||||
including image stitching, optical flow tracking, and deformation decomposition.
|
including image stitching, optical flow tracking, and deformation decomposition.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = "0.2.0"
|
__version__ = "0.2.3"
|
||||||
__author__ = "Orisys"
|
__author__ = "Orisys"
|
||||||
|
|
||||||
from .sensor import Sensor
|
from .sensor import Sensor
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"camera": {
|
"camera": {
|
||||||
"resolution_raw": [1920, 1080],
|
"resolution_raw": [1920, 1080],
|
||||||
"fps": 60,
|
"fps": 30,
|
||||||
"units": 15,
|
"units": 15,
|
||||||
"units_used": 9,
|
"units_used": 9,
|
||||||
"resolution_stitch": [400, 400]
|
"resolution_stitch": [400, 400]
|
||||||
@@ -15,7 +15,8 @@
|
|||||||
"index": [1,2,3,6,7,8,11,12,13],
|
"index": [1,2,3,6,7,8,11,12,13],
|
||||||
"margin": 10,
|
"margin": 10,
|
||||||
"nominal_ov_pos": 100,
|
"nominal_ov_pos": 100,
|
||||||
"n": [3,3]
|
"n": [3,3],
|
||||||
|
"row_tol": 0.6
|
||||||
},
|
},
|
||||||
"tracker": {
|
"tracker": {
|
||||||
"adaptive": true,
|
"adaptive": true,
|
||||||
@@ -23,7 +24,7 @@
|
|||||||
"upper_threshold": 18.0,
|
"upper_threshold": 18.0,
|
||||||
"loop_closure_interval": 1,
|
"loop_closure_interval": 1,
|
||||||
"dis_preset": "medium",
|
"dis_preset": "medium",
|
||||||
"finest_scale": 1
|
"finest_scale": 3
|
||||||
},
|
},
|
||||||
"contact": {
|
"contact": {
|
||||||
"min_contour_area": 3000,
|
"min_contour_area": 3000,
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class Tracker:
|
|||||||
|
|
||||||
|
|
||||||
# Aggressive optimization for CPU
|
# 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.setPatchSize(8) # Smaller patches (default 8)
|
||||||
# self.__tracking_inst.setPatchStride(4) # Larger stride = fewer patches
|
# self.__tracking_inst.setPatchStride(4) # Larger stride = fewer patches
|
||||||
# self.__tracking_inst.setGradientDescentIterations(12) # Reduce iterations (default 25)
|
# self.__tracking_inst.setGradientDescentIterations(12) # Reduce iterations (default 25)
|
||||||
@@ -213,7 +213,6 @@ class Tracker:
|
|||||||
error = self.__getForwardBackwardError(
|
error = self.__getForwardBackwardError(
|
||||||
self.__fine_base_frame_queue[i], frame, f)
|
self.__fine_base_frame_queue[i], frame, f)
|
||||||
if error < self.__lower_threshold:
|
if error < self.__lower_threshold:
|
||||||
# print("loop closed at frame ", str(i))
|
|
||||||
self.__fine_base_frame_queue = self.__fine_base_frame_queue[:
|
self.__fine_base_frame_queue = self.__fine_base_frame_queue[:
|
||||||
i +
|
i +
|
||||||
1]
|
1]
|
||||||
|
|||||||