From a9c1c596d509b0d909e019eca26569deb2822764 Mon Sep 17 00:00:00 2001 From: princek880 <64679686+princek880@users.noreply.github.com> Date: Fri, 12 Apr 2024 21:38:51 +0530 Subject: [PATCH] Update util.py to fix s_hat assignment This PR resolves an indexing error in getRMatrix by fixing improper indexing of ax in the s_hat array. It ensures smooth execution of the Depth2HHA pipeline. --- utils/util.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/util.py b/utils/util.py index 04d2908..213597f 100644 --- a/utils/util.py +++ b/utils/util.py @@ -151,9 +151,9 @@ def getRMatrix(yi, yf): if (abs(phi) > 0.1): phi = phi * (np.pi / 180) - s_hat = np.array([[0, -ax[2], ax[1]], - [ax[2], 0, -ax[0]], - [-ax[1], ax[0], 0]]) + s_hat = np.array([[0, -ax[2][0], ax[1][0]], + [ax[2][0], 0, -ax[0][0]], + [-ax[1][0], ax[0][0], 0]]) R = np.eye(3) + np.sin(phi) * s_hat + (1 - np.cos(phi)) * np.dot(s_hat, s_hat) # dot??? else: R = np.eye(3) @@ -173,4 +173,4 @@ def rotatePC(pc, R): res = np.dot(R, res) res = np.reshape(res, pc.shape, 'F') res = np.swapaxes(np.swapaxes(res, 0, 1), 1, 2) - return res \ No newline at end of file + return res