diff --git a/config/compound_eye.png b/config/compound_eye.png index bac700b..880f357 100644 Binary files a/config/compound_eye.png and b/config/compound_eye.png differ diff --git a/example1_basic.py b/example1_basic.py index 6ef9f3c..28bb8a3 100644 --- a/example1_basic.py +++ b/example1_basic.py @@ -28,7 +28,7 @@ def main(): # verbose: 是否打印详细初始化日志 # 方式1: 从视频文件读取 - sensor = orisys.Sensor("./s1.mp4", isstitch=True, cuda=True, verbose=True) + sensor = orisys.Sensor("./s1.mp4", isstitch=True, cuda=False, verbose=True) # 方式2: 从摄像头读取(取消注释使用) # sensor = orisys.Sensor(0, isstitch=True, cuda=True, verbose=True) diff --git a/src/orisys/Stitcher.py b/src/orisys/Stitcher.py index 817ebbc..c70f500 100644 --- a/src/orisys/Stitcher.py +++ b/src/orisys/Stitcher.py @@ -443,7 +443,7 @@ class Stitcher: h, w = img.shape[:2] n_boxes = 0 - bk_thresh = 35 # initial black threshold + bk_thresh = 0 # initial black threshold bk_thresh_step = 5 bk_thresh_max = 100 @@ -461,7 +461,8 @@ class Stitcher: kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (k, k)) mask = cv2.morphologyEx(mask, cv2.MORPH_OPEN, kernel, iterations=1) mask = cv2.morphologyEx(mask, cv2.MORPH_CLOSE, kernel, iterations=2) - + # cv2.imshow("mask", mask) + # cv2.waitKey(0) # find contours of candidate regions contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) diff --git a/src/orisys/configs/sample_1.json b/src/orisys/configs/sample_1.json index 7dc1e1a..89b7f96 100644 --- a/src/orisys/configs/sample_1.json +++ b/src/orisys/configs/sample_1.json @@ -10,6 +10,11 @@ "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]] }, + "stitcher": { + "min_area_frac": 0.01, + "max_area_frac": 0.05, + "max_aspect_ratio": 100 + }, "contact": { "min_contour_area": 3000, "min_magnitude": 1.0, diff --git a/src/orisys/sensor.py b/src/orisys/sensor.py index 5281c64..7d69009 100644 --- a/src/orisys/sensor.py +++ b/src/orisys/sensor.py @@ -18,7 +18,7 @@ from queue import Queue, Empty from .Stitcher import Stitcher from .tracker import Tracker from .nHHD import nHHD -from .getDensity import getFilteredDensity +# from .getDensity import getFilteredDensity from . import configs from .get_depth import *