Skip to content

Commit

Permalink
now calculates the B matrix for each collection #939
Browse files Browse the repository at this point in the history
  • Loading branch information
Kazadhum committed May 3, 2024
1 parent bb4713a commit be1aeb0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions atom_evaluation/scripts/other_calibrations/rwhe_calib_ali.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@

import argparse
import numpy as np
import cv2

from atom_core.dataset_io import loadResultsJSON
from atom_core.atom import getTransform
from atom_core.geometry import traslationRodriguesToTransform

def getPatternConfig(dataset, pattern):
# Pattern configs
Expand Down Expand Up @@ -163,6 +165,15 @@ def main():

imgpoints_camera.append(tmp_imgpoints_camera)

retval, rvec, tvec = cv2.solvePnP(objp, imgpoints_camera[0], K, D)

tf_pattern2opticalframe = traslationRodriguesToTransform(tvec, rvec)

# B is the inverse of pattern2opticalframe

B = np.linalg.inv(tf_pattern2opticalframe)

BB.append(B)


if __name__ == '__main__':
Expand Down

0 comments on commit be1aeb0

Please sign in to comment.