フィルターのクリア

How to use undistorImage with multiple images?

3 ビュー (過去 30 日間)
mikel lasa
mikel lasa 2020 年 11 月 15 日
コメント済み: Image Analyst 2020 年 11 月 18 日
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!

採用された回答

Image Analyst
Image Analyst 2020 年 11 月 15 日
編集済み: Image Analyst 2020 年 11 月 15 日
See the FAQ:
In the middle of the loop, call a function that processes just the current image.
  2 件のコメント
mikel lasa
mikel lasa 2020 年 11 月 18 日
I tried this and it WORKS! thank you for the help!
Image Analyst
Image Analyst 2020 年 11 月 18 日
Are you then ready to "Accept this answer"? Thanks in advance.

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by