config json update
This commit is contained in:
@@ -6,14 +6,16 @@
|
||||
"fps": 60,
|
||||
"units": 15,
|
||||
"units_used": 9,
|
||||
"resolution_stitch": [400, 400],
|
||||
"index": [1,2,3,6,7,8,11,12,13],
|
||||
"pos_default": [[260, 56], [577, 62], [897, 69], [1214, 75], [1530, 81], [256, 391], [570, 397], [889, 403], [1208, 409], [1523, 416], [248, 724], [563, 730], [882, 738], [1201, 743], [1516, 751]]
|
||||
"resolution_stitch": [400, 400]
|
||||
},
|
||||
"stitcher": {
|
||||
"min_area_frac": 0.018,
|
||||
"max_area_frac": 0.035,
|
||||
"max_aspect_ratio": 20
|
||||
"max_aspect_ratio": 20,
|
||||
"index": [1,2,3,6,7,8,11,12,13],
|
||||
"pos_default": [[260, 56], [577, 62], [897, 69], [1214, 75], [1530, 81], [256, 391], [570, 397], [889, 403], [1208, 409], [1523, 416], [248, 724], [563, 730], [882, 738], [1201, 743], [1516, 751]],
|
||||
"margin": 10,
|
||||
"nominal_ov_pos": 100
|
||||
},
|
||||
"contact": {
|
||||
"min_contour_area": 3000,
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ def main():
|
||||
# verbose: 是否打印详细初始化日志
|
||||
|
||||
# 方式1: 从视频文件读取
|
||||
sensor = orisys.Sensor("./s1.mp4", isstitch=True, cuda=False, verbose=True)
|
||||
sensor = orisys.Sensor("./s1.mp4", isstitch=True, cuda=False, verbose=True,config_name="prototype")
|
||||
|
||||
# 方式2: 从摄像头读取(取消注释使用)
|
||||
# sensor = orisys.Sensor(0, isstitch=True, cuda=True, verbose=True)
|
||||
|
||||
@@ -6,11 +6,12 @@ import cv2
|
||||
|
||||
class Stitcher:
|
||||
|
||||
def __init__(self,isstitch=False, n=[3,3], index=np.array([1,2,3,6,7,8,11,12,13]), config_stitcher=None):
|
||||
def __init__(self,isstitch=False, n=[3,3], config_stitcher=None,verbose=False):
|
||||
|
||||
# Settings
|
||||
self.isstitch = isstitch
|
||||
self.config_stitcher = config_stitcher
|
||||
self.verbose = verbose
|
||||
# Find Boxes Related
|
||||
self.min_area_frac = config_stitcher["min_area_frac"]
|
||||
self.max_area_frac = config_stitcher["max_area_frac"]
|
||||
@@ -19,16 +20,16 @@ class Stitcher:
|
||||
# stitch related
|
||||
self.stitch_valid = False
|
||||
self.boxes = self.units = None
|
||||
self.index = index
|
||||
self.index = config_stitcher["index"]
|
||||
self.stitch_calibration = self.tile_list = []
|
||||
self.ncol = n[0]
|
||||
self.nrow = n[1]
|
||||
self.nominal_ov_pos=100
|
||||
self.margin=10
|
||||
self.nominal_ov_pos=config_stitcher["nominal_ov_pos"]
|
||||
self.margin=config_stitcher["margin"]
|
||||
self.bound=self.nominal_ov_pos - self.margin
|
||||
|
||||
# for sensor 1
|
||||
self.pos_default = [(260, 56), (577, 62), (897, 69), (1214, 75), (1530, 81), (256, 391), (570, 397), (889, 403), (1208, 409), (1523, 416), (248, 724), (563, 730), (882, 738), (1201, 743), (1516, 751)]
|
||||
self.pos_default = config_stitcher["pos_default"]
|
||||
|
||||
def stitch_rt_optimized(self, change_sv=False, s_mean=28., v_mean=180.):
|
||||
tile_list = self.tile_list
|
||||
|
||||
@@ -6,14 +6,16 @@
|
||||
"fps": 60,
|
||||
"units": 15,
|
||||
"units_used": 9,
|
||||
"resolution_stitch": [400, 400],
|
||||
"index": [1,2,3,6,7,8,11,12,13],
|
||||
"pos_default": [[260, 56], [577, 62], [897, 69], [1214, 75], [1530, 81], [256, 391], [570, 397], [889, 403], [1208, 409], [1523, 416], [248, 724], [563, 730], [882, 738], [1201, 743], [1516, 751]]
|
||||
"resolution_stitch": [400, 400]
|
||||
},
|
||||
"stitcher": {
|
||||
"min_area_frac": 0.018,
|
||||
"max_area_frac": 0.035,
|
||||
"max_aspect_ratio": 20
|
||||
"max_aspect_ratio": 20,
|
||||
"index": [1,2,3,6,7,8,11,12,13],
|
||||
"pos_default": [[260, 56], [577, 62], [897, 69], [1214, 75], [1530, 81], [256, 391], [570, 397], [889, 403], [1208, 409], [1523, 416], [248, 724], [563, 730], [882, 738], [1201, 743], [1516, 751]],
|
||||
"margin": 10,
|
||||
"nominal_ov_pos": 100
|
||||
},
|
||||
"contact": {
|
||||
"min_contour_area": 3000,
|
||||
|
||||
@@ -132,8 +132,8 @@ class Sensor:
|
||||
|
||||
|
||||
# Initialize components
|
||||
self._stitcher = Stitcher(isstitch=isstitch, index=self.config_index, config_stitcher=self.config_stitcher)
|
||||
self.tracker = Tracker(adaptive=True, cuda=cuda)
|
||||
self._stitcher = Stitcher(isstitch=isstitch, config_stitcher=self.config_stitcher, verbose=self.verbose)
|
||||
self.tracker = Tracker(adaptive=True, cuda=cuda, verbose=self.verbose)
|
||||
self.contact3d = Contact3D(config_contact=self.config_contact, verbose=self.verbose)
|
||||
self.hhd = None
|
||||
|
||||
@@ -459,8 +459,8 @@ class Sensor:
|
||||
self.config_fps = cam["fps"]
|
||||
self.config_units = cam["units"]
|
||||
self.config_resolution_stitch = cam["resolution_stitch"]
|
||||
self.config_index = cam["index"]
|
||||
self.config_pos_default = cam["pos_default"]
|
||||
# self.config_index = cam["index"]
|
||||
# self.config_pos_default = cam["pos_default"]
|
||||
|
||||
self.config_stitcher = self.config["stitcher"]
|
||||
self.config_contact = self.config["contact"]
|
||||
|
||||
@@ -12,13 +12,15 @@ class Tracker:
|
||||
lower_threshold=12.0,
|
||||
upper_threshold=18.0,
|
||||
loop_closure_interval=1,
|
||||
dis_preset='medium'):
|
||||
dis_preset='medium',
|
||||
verbose=False):
|
||||
# Check if OpenCV is built with CUDA support
|
||||
if cuda and not cv2.cuda.getCudaEnabledDeviceCount():
|
||||
# print("Warning: CUDA requested but OpenCV not built with CUDA support or no CUDA device found. Falling back to CPU.")
|
||||
cuda = False
|
||||
|
||||
self.cuda = cuda
|
||||
self.verbose = verbose
|
||||
self.__loop_closure_interval = loop_closure_interval
|
||||
self.__frame_count = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user