UPDATE Vision 新增方法:用于寻找拍照点,获取图像目标及中心点云坐标

This commit is contained in:
HJW
2024-09-29 16:32:27 +08:00
parent 5d526875b2
commit d281b26443
3 changed files with 328 additions and 22 deletions

View File

@ -19,7 +19,6 @@ import os
"""
def detectionPosition_test():
detection = Detection()
while True:
ret, img, xyz, nx_ny_nz, box = detection.get_position()
if ret==1:
@ -35,6 +34,18 @@ def detectionPosition_test():
cv2.imshow('img', img)
cv2.waitKey(1)
def take_photo_position_test():
detection = Detection()
while True:
ret, img, find_target, xyz = detection.get_take_photo_position()
if ret==1:
print('是否检测到目标:', find_target)
if xyz!=None:
print('xyz点云坐标', xyz)
else:
print('目标点云无效')
cv2.imshow('img', img)
cv2.waitKey(1)
def detectionPerson_test():
detectionPerson = DetectionPerson()
@ -50,5 +61,6 @@ def detectionPerson_test():
else:
break
if __name__ == '__main__':
detectionPosition_test()