Why do I receive "Input to SVD must not contain NaN or Inf?

8 visualizzazioni (ultimi 30 giorni)
Hello!
I have been trying to use the Lidar Toolbox to estimate the transformation between a lidar sensor and a camera using the checkerboard. So far, I've created a copy of the the MATLAB example EstimateLCTransformExample. Everything is executed correctly, the checkerboard is detected in both the images and the PCD files. However, whenever the transformation function (estimateLidarCameraTransform) is executed I get the following error:
Error using svd
Input to SVD must not contain NaN or Inf.
[U,~,V] = svd(Ml'*Mc);
initialRotation = computeInitialRotation(lidarEdgeDirection, imageEdgeDirection, ...
lidar.internal.calibration.computeInitialTransform(lidar3DCorners, imageCorners3d, verbose);
tform = computeTransformUsingCorners(lidarCheckerboardPlanes, ...
Additionally, I attach the script I have been using:
imageDataPath = 'D:\TEC\10mo Semestre\VTTC\Fotos';
imds = imageDatastore(imageDataPath);
imageFileNames = imds.Files;
ptCloudFilePath = 'D:\TEC\10mo Semestre\VTTC\Lidar';
pcds = fileDatastore(ptCloudFilePath,'ReadFcn',@pcread);
pcFileNames = pcds.Files;
focalLength = [628.8, 387.33];
principalPoint = [701.57, 701.57];
imageSize = [720, 1280];
intrinsics = cameraIntrinsics(focalLength,principalPoint,imageSize)
cameraIntrinsicFile = fullfile(imageDataPath,'calibration.mat');
squareSize = 45;
[imageCorners3d,planeDimension,imagesUsed] = estimateCheckerboardCorners3d( ...
imageFileNames,intrinsics,squareSize);
pcFileNames = pcFileNames(imagesUsed);
[lidarCheckerboardPlanes,framesUsed] = detectRectangularPlanePoints( ...
pcFileNames,planeDimension,'RemoveGround',true);
framesUsed
imagFileNames = imageFileNames(imagesUsed);
imageFileNames = imageFileNames(framesUsed);
pcFileNames = pcFileNames(framesUsed);
imageCorners3d = imageCorners3d(:,:,framesUsed);
tform= estimateLidarCameraTransform(lidarCheckerboardPlanes, imageCorners3d);

Risposte (1)

Cris LaPierre
Cris LaPierre il 29 Set 2021
Your input to svd is Ml'*Mc. Based on the error message, it would appear at least one value in the resulting calculation is NaN or Inf.

Categorie

Scopri di più su Labeling, Segmentation, and Detection in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by