Merge branch 'radxa' of yahoo.com.hk@192.168.192.190:D:\repo\orisyssdk_git into radxa

This commit is contained in:
bluepulsar
2026-02-17 18:05:09 +08:00
3 changed files with 657 additions and 20 deletions
+8 -3
View File
@@ -53,7 +53,7 @@ class Sensor:
# =========================================================================
def __init__(self, vid_src, cuda=True, isstitch=True, verbose=True,
config_name="prototype", cal_path=None, override=False, box=None, mirror=True):
config_name="prototype", cal_path=None, override=False, box=None, mirror=True, poisson_backend='auto'):
"""
Initialize Sensor with video source and configuration.
@@ -141,6 +141,7 @@ class Sensor:
self.__tracker = Tracker(adaptive=True, cuda=cuda, verbose=self.verbose, dis_preset=self._config_dis_preset, config_tracker=self.__config_tracker)
self.__contact3d = Contact3D(config_contact=self.__config_contact, verbose=self.verbose)
self.__hhd = None
self.poisson_backend = poisson_backend
# Setup video capture
self._open_video_source(override, box)
@@ -243,10 +244,14 @@ class Sensor:
# Initialize HHD solver
if self.__hhd is None:
self.__hhd = nHHD(cuda=self.cuda, grid=flow.shape[:2], spacings=(18, 18))
self.__hhd = nHHD(cuda=self.cuda, grid=flow.shape[:2], spacings=(18, 18), poisson_backend=self.poisson_backend)
# Force computation
if self.cuda and self.CUPY_AVAILABLE:
# When OpenCL backend is selected, use CPU force path to ensure
# Poisson solve goes through PoissonSolver.solve_opencl().
if self.poisson_backend == 'opencl':
_, forces = self.__hhd.get_force(flow)
elif self.cuda and self.CUPY_AVAILABLE:
_, forces = self.__hhd.get_force_gpu_v2(flow)
else:
_, forces = self.__hhd.get_force(flow)