// The camera parameters
let w = 3840,
h = 2160,
fx = 2385.724365,
fy = 2385.724365,
cx = 1883.785767,
cy = 1094.341431,
height_left = 1260,
height_right = 2160;
//Distortion parameters
let fc1 = 7.797425,
fc2 = 5.739021,
cc1 = 0.000563,
cc2 = 0.000260,
kc1 = 0.482698,
kc2 = 8.237219,
kc3 = 10.391369,
kc4 = 2.691715;
let aisle = cv.CV_32F;
let camera = new cv.matFromArray(3, 3, aisle, [fx, 0, cx, 0, fy, cy, 0, 0, 1])
let coeff = new cv.matFromArray(1, 8, aisle, [fc1, fc2, cc1, cc2, kc1, kc2, kc3, kc4])
const args = {
inputArray: cv.matFromArray(2, 1, cv.CV_32FC2, pt_2d),
outputArray: new cv.Mat(),
cameraMatrix: camera,
distCoeffs: coeff,
};
cv.undistortPoints(args.inputArray, args.outputArray, args.cameraMatrix, args.distCoeffs);