UPDATE Vision 修正box输出

This commit is contained in:
HJW
2024-09-19 16:05:43 +08:00
parent ba9f28406d
commit bd91bae88b
6 changed files with 15 additions and 61 deletions

View File

@ -19,8 +19,6 @@ from Vision.tool.utils import find_position
from Vision.tool.utils import class_names
from Vision.tool.utils import get_disk_space
from Vision.tool.utils import remove_nan
from Vision.tool.utils import compute_pca_direction
from Vision.tool.utils import pca
import os
@ -86,8 +84,6 @@ class Detection:
uv = []
seg_point = []
box_list = []
pca_list = []
pca_nx_ny_nz = []
if Point_isVision == True:
pm2 = pm.copy()
@ -163,8 +159,6 @@ class Detection:
print("分割点云数量较少,无法拟合平面")
continue
# cv2.imshow('result', piont_result)
pca_list.append(compute_pca_direction(pm_seg))
pca_nx_ny_nz.append(pca(pm_seg))
'''
拟合平面,计算法向量
'''
@ -240,17 +234,17 @@ class Detection:
save_img = cv2.resize(img,(720, 540))
cv2.imwrite(save_img_name, save_img)
return 1, img, xyz[_idx], nx_ny_nz[_idx], box_list[_idx], pca_list[_idx], pca_nx_ny_nz[_idx]
return 1, img, xyz[_idx], nx_ny_nz[_idx], box_list[_idx]
else:
if save_img_piont == True:
save_img = cv2.resize(img, (720, 540))
cv2.imwrite(save_img_name, save_img)
return 1, img, None, None, None, None, None
return 1, img, None, None, None
else:
print("RVC X Camera capture failed!")
return 0, None, None, None, None, None, None
return 0, None, None, None, None
def release(self):
self.model.clear()