UPDATE Vision 修复深度图对齐彩色图
This commit is contained in:
@ -15,7 +15,8 @@ import time
|
||||
import os
|
||||
|
||||
from Vision.tool.CameraRVC import camera_rvc
|
||||
from Vision.tool.CameraPe_color2depth import camera_pe
|
||||
from Vision.tool.CameraPe_color2depth import camera_pe as camera_pe_color2depth
|
||||
from Vision.tool.CameraPe_depth2color import camera_pe as camera_pe_depth2color
|
||||
from Vision.yolo.yolov8_pt_seg import yolov8_segment
|
||||
from Vision.yolo.yolov8_openvino import yolov8_segment_openvino
|
||||
from Vision.tool.utils import find_position
|
||||
@ -28,15 +29,17 @@ from Vision.tool.utils import uv_to_XY
|
||||
|
||||
class Detection:
|
||||
|
||||
def __init__(self, use_openvino_model=False, cameraType = 'Pe'): # cameraType = 'RVC' or cameraType = 'Pe'
|
||||
def __init__(self, use_openvino_model=False, cameraType = 'Pe', alignmentType = 'color2depth'): # cameraType = 'RVC' or cameraType = 'Pe'
|
||||
"""
|
||||
初始化相机及模型
|
||||
:param use_openvino_model: 选择模型,默认使用openvino
|
||||
:param cameraType: 选择相机 如本相机 'RVC', 图漾相机 'Pe'
|
||||
:param alignmentType: 相机对齐方式 color2depth:彩色图对齐深度图 ;depth2color:深度图对齐彩色图
|
||||
|
||||
"""
|
||||
self.use_openvino_model = use_openvino_model
|
||||
self.cameraType = cameraType
|
||||
self.alignmentType= alignmentType
|
||||
if self.use_openvino_model == False:
|
||||
model_path = ''.join([os.getcwd(), '/Vision/model/pt/one_bag.pt'])
|
||||
device = 'cpu'
|
||||
@ -44,7 +47,10 @@ class Detection:
|
||||
self.camera_rvc = camera_rvc()
|
||||
self.seg_distance_threshold = 10 # 1厘米
|
||||
elif self.cameraType == 'Pe':
|
||||
self.camera_rvc = camera_pe()
|
||||
if self.alignmentType=='color2depth':
|
||||
self.camera_rvc = camera_pe_color2depth()
|
||||
else:
|
||||
self.camera_rvc = camera_pe_depth2color()
|
||||
self.seg_distance_threshold = 15 # 2厘米
|
||||
else:
|
||||
print('相机参数错误')
|
||||
@ -58,7 +64,10 @@ class Detection:
|
||||
self.camera_rvc = camera_rvc()
|
||||
self.seg_distance_threshold = 10
|
||||
elif self.cameraType == 'Pe':
|
||||
self.camera_rvc = camera_pe()
|
||||
if self.alignmentType == 'color2depth':
|
||||
self.camera_rvc = camera_pe_color2depth()
|
||||
else:
|
||||
self.camera_rvc = camera_pe_depth2color()
|
||||
self.seg_distance_threshold = 20
|
||||
else:
|
||||
print('相机参数错误')
|
||||
|
||||
Reference in New Issue
Block a user