add blend control on stitch
This commit is contained in:
+18
-1
@@ -134,6 +134,13 @@ class Sensor:
|
||||
self._fps = 0
|
||||
self._last_capture_time = 0.0
|
||||
self._last_processing_time = 0.0
|
||||
self._last_stage_times = {
|
||||
"extract_tiles": 0.0,
|
||||
"stitch": 0.0,
|
||||
"resize": 0.0,
|
||||
"mirror": 0.0,
|
||||
"astype": 0.0,
|
||||
}
|
||||
|
||||
# Initialize components
|
||||
self.stitcher = Stitcher(isstitch=isstitch, config_stitcher=self.__config_stitcher, verbose=self.verbose)
|
||||
@@ -202,20 +209,30 @@ class Sensor:
|
||||
# Extract and stitch tiles
|
||||
# self.stitcher.get_stitch_unit(frame)
|
||||
self._extract_tiles(frame)
|
||||
t_after_extract = time.perf_counter()
|
||||
|
||||
img = np.ascontiguousarray(self.stitcher.stitch_rt_optimized())
|
||||
img = np.ascontiguousarray(self.stitcher.stitch_rt_optimized(blend=True))
|
||||
t_after_stitch = time.perf_counter()
|
||||
|
||||
self.img_size_raw = img.shape
|
||||
# Resize
|
||||
img = cv2.resize(img, tuple(self._config_resolution_stitch), interpolation=cv2.INTER_LINEAR)
|
||||
t_after_resize = time.perf_counter()
|
||||
|
||||
if self.mirror:
|
||||
img = cv2.flip(img, 1)
|
||||
t_after_mirror = time.perf_counter()
|
||||
|
||||
self.img = img.astype(np.uint8)
|
||||
t_after_astype = time.perf_counter()
|
||||
|
||||
t_processing_end = time.perf_counter()
|
||||
self._last_processing_time = t_processing_end - t_processing_start
|
||||
self._last_stage_times["extract_tiles"] = t_after_extract - t_processing_start
|
||||
self._last_stage_times["stitch"] = t_after_stitch - t_after_extract
|
||||
self._last_stage_times["resize"] = t_after_resize - t_after_stitch
|
||||
self._last_stage_times["mirror"] = t_after_mirror - t_after_resize
|
||||
self._last_stage_times["astype"] = t_after_astype - t_after_mirror
|
||||
|
||||
# FPS calculation
|
||||
self._fps = 1.0 / (time.perf_counter() - self.last_log_time)
|
||||
|
||||
Reference in New Issue
Block a user