How to use undistorImage with multiple images?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
mikel lasa
le 15 Nov 2020
Commenté : Image Analyst
le 18 Nov 2020
Hello,
After getting my camera calibration parameters, I want to undistort all my 13 images using undistortImage function. My issue comes when I try undistort all the images in one function, is any way to do that?
You can see in my code that "imageFileNames" is a 13x1 array. Can I obtain somehow another 13x1 array with the undistorted images?
my code so far:
%%
clc; close all;clear all;
%% calibracion
% Create a set of calibration images.
%images = imageDatastore(fullfile(toolboxdir('vision'), 'visiondata','calibration', 'cal_1'));
images = imageDatastore(fullfile('C:\MASTER\VISION_ARTIFICIAL\computer_vision\ejercicio_calibracion\fotos_movil'));
imageFileNames = images.Files;
% DETECTA EL PATRON DE CALIBRACION, devuelve los puntos en el patron y el
% tamañano en celdal patron, en este caso es de 12 por 13
[imagePoints, boardSize] = detectCheckerboardPoints(imageFileNames);
% leer la primera imagen para conseguir el tamaño de la imagen
I = readimage(images,1);
imageSize = [size(I, 1), size(I, 2)];
% genera las coordenadas en el patron, 0,0 corresponde a la parte inferior
% izquierda del patron
squareSize = 15; % millimeters
worldPoints = generateCheckerboardPoints(boardSize, squareSize);
[params, imagesUsed, estimationErrors] = estimateCameraParameters(imagePoints, worldPoints,'ImageSize', imageSize,'EstimateSkew',true);
showReprojectionErrors(params);
figure;
showExtrinsics(params);
%% Rectificado de las imagenes
% remover distorsiones de cada imagen
J=undistortImage(imageFileNames(all,1),params);
figure;
imshowpair(I,J(1),'montage');
Thanks in davance and regards!
0 commentaires
Réponse acceptée
Image Analyst
le 15 Nov 2020
Modifié(e) : Image Analyst
le 15 Nov 2020
In the middle of the loop, call a function that processes just the current image.
2 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!