update doc
This commit is contained in:
+14
-18
@@ -19,8 +19,8 @@ import argparse
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--video","-v", type=str, default="0", help="Camera ID / Video file path")
|
||||
parser.add_argument("--config","-c", type=str, default="./config/prototype_of3.json", help="Configuration file path")
|
||||
parser.add_argument("--cal","-cal", type=str, default="./config/dd01a_0.npy", help="Calibration file path")
|
||||
parser.add_argument("--config","-c", type=str, default="./config/ddjx01.json", help="Configuration file path")
|
||||
parser.add_argument("--cal","-cal", type=str, default="./config/ddjx01.npy", help="Calibration file path")
|
||||
parser.add_argument("--verbose","-verbose", type=bool, default=True, help="Print detailed information")
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -32,40 +32,36 @@ def main():
|
||||
try:
|
||||
input = int(args.video)
|
||||
is_camera = True
|
||||
sensor = orisys.Sensor(input, config_name=args.config, cal_path= args.cal, cuda=True, verbose=args.verbose)
|
||||
sensor = orisys.Sensor(input, config_name=args.config, cal_path= args.cal, verbose=args.verbose)
|
||||
except:
|
||||
is_camera = False
|
||||
sensor = orisys.Sensor(args.video, config_name=args.config, cal_path= args.cal, cuda=True, verbose=args.verbose)
|
||||
|
||||
# sensor = orisys.Sensor(args.input, config_name=args.config, cal_path= args.cal, cuda=True, verbose=args.verbose)
|
||||
|
||||
# 方式2: 从摄像头读取(取消注释使用)
|
||||
# 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' 重置光流追踪器")
|
||||
sensor = orisys.Sensor(args.video, config_name=args.config, cal_path= args.cal, verbose=args.verbose)
|
||||
|
||||
print("\n按 'q' 退出程序,按 'r' 重置传感器追踪器")
|
||||
|
||||
while True:
|
||||
# 步骤2:信息提取
|
||||
# 步骤 2.1: 获取并拼接图像 (必要步骤)
|
||||
sensor.get_img()
|
||||
# if sensor.detect_motion(threshold=2):
|
||||
# print("motion detected")
|
||||
# 步骤 2.2: 计算形变场 (必要步骤)
|
||||
sensor.compute_deformation()
|
||||
is_touched = sensor.compute_deformation(check_motion=True, threshold=6)
|
||||
# 步骤 2.3: 计算触碰点
|
||||
sensor.compute_contact()
|
||||
if is_touched:
|
||||
sensor.compute_contact()
|
||||
|
||||
|
||||
#步骤 2.4: 读取信息
|
||||
fps, flow, vnormal, img, contour, centroid, depth_map = sensor.read_info(
|
||||
fps, flow, vnormal, img, contour, centroid, depth_map, fnormal, fshearx, fsheary = sensor.read_info(
|
||||
sensor.info.FPS,
|
||||
sensor.info.VRAW,
|
||||
sensor.info.VNORMAL,
|
||||
sensor.info.IMG,
|
||||
sensor.info.CONTOUR,
|
||||
sensor.info.CENTROID,
|
||||
sensor.info.DEPTH
|
||||
sensor.info.DEPTH,
|
||||
sensor.info.FNORMAL,
|
||||
sensor.info.FSHEARX,
|
||||
sensor.info.FSHEARY
|
||||
)
|
||||
|
||||
#步骤 3: 可视化显示
|
||||
@@ -95,7 +91,7 @@ def main():
|
||||
cv2.imshow("Depth Map", cv2.applyColorMap(div_normalized, cv2.COLORMAP_JET))
|
||||
|
||||
#步骤 3.4: 打印资料
|
||||
print(f"fps: {fps}")
|
||||
print(f"fps: {fps}, fnormal: {fnormal}, fshearx: {fshearx}, fsheary: {fsheary}, depth_shape: {depth_map.shape}")
|
||||
|
||||
#步骤 3.5: 键盘控制
|
||||
key = cv2.waitKey(1) & 0xFF
|
||||
|
||||
Reference in New Issue
Block a user