added contact gpu support
This commit is contained in:
+5
-2
@@ -3,7 +3,7 @@ os.environ["OPENCV_VIDEOIO_MSMF_ENABLE_HW_TRANSFORMS"] = "0" # Windows 下禁
|
||||
import cv2
|
||||
import orisys
|
||||
import numpy as np
|
||||
|
||||
import time
|
||||
def main():
|
||||
|
||||
# 方式1: 从视频文件读取
|
||||
@@ -46,7 +46,8 @@ def main():
|
||||
cv2.imshow("magnitude map", mag_img)
|
||||
|
||||
# 计算触碰点
|
||||
contact_result = sensor.get_contact(multiple_foe=False, min_magnitude=1, expansion_threshold=0.01,denoise_sigma=15)
|
||||
contact_result = sensor.get_contact(min_magnitude=1, expansion_threshold=0.01,denoise_sigma=15)
|
||||
|
||||
# 在图像上触碰点和区域
|
||||
image_with_foe = orisys.util.draw_foe(sensor.img.copy(), contact_result)
|
||||
cv2.imshow("Contact Centroid", image_with_foe)
|
||||
@@ -63,6 +64,8 @@ def main():
|
||||
|
||||
# 应用颜色映射(使用JET:蓝色=低散度,红色=高散度)
|
||||
cv2.imshow("Divergence Map", cv2.applyColorMap(div_normalized, cv2.COLORMAP_JET))
|
||||
|
||||
print(f"fps: {fps}")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
|
||||
Reference in New Issue
Block a user