上传文件至 Vision
This commit is contained in:
23
Vision/camera_coordinate_dete_test.py
Normal file
23
Vision/camera_coordinate_dete_test.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
'''
|
||||||
|
# @Time : 2024/9/5 14:57
|
||||||
|
# @Author : hjw
|
||||||
|
# @File : camera_coordinate_dete_test.py.py
|
||||||
|
'''
|
||||||
|
from camera_coordinate_dete import Detection
|
||||||
|
import cv2
|
||||||
|
model_path = './pt_model/last-0903.pt'
|
||||||
|
device = 'cpu'
|
||||||
|
detection = Detection(model_path, device)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
ret, img, xyz, nx_ny_nz = detection.get_position()
|
||||||
|
if ret==1:
|
||||||
|
print('xyz点云坐标:', xyz)
|
||||||
|
print('nx_ny_nz法向量:', nx_ny_nz)
|
||||||
|
img = cv2.resize(img,(720, 540))
|
||||||
|
cv2.imshow('img', img)
|
||||||
|
cv2.waitKey(1)
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user