Save Camera Calibration Parameters
Mostrar comentarios más antiguos
The export of camera parameters from the Camera Calibration toolbox creates its own type of variable that cannot be saved as a .mat. How can I save these so that I can load it when I want to use that camera instead of calibrating it every time? Is xml the only way?
Thanks, Erin
4 comentarios
Salaheddin Hosseinzadeh
el 13 de Mzo. de 2014
Erin can you tell me what's the type of the variables? Struct? Cell? Char? Double? or ... ?
Erin
el 13 de Mzo. de 2014
There is a command toStruct(cameraParams) which seems to work,so if you have created a cameraParameters object in your workspace
mycamParams = toStruct(cameraParams)
save mycamParams.mat mycamParams %Saves as a mat file
clear %clear variables in workspace
load('mycamParams.mat') %loads it back in and Matlab recognises it is a structure
mycamParams=cameraParameters(parameterStruct) % recreates the camera parameters object which you can then use to undistort images etc.
Aditi Singh
el 8 de Oct. de 2019
I have an image how can I find camera calibration for that.
Respuesta aceptada
Más respuestas (2)
Sean de Wolski
el 13 de Mzo. de 2014
0 votos
With MATLAB R2014a, you can generate equivalent code with the app.

4 comentarios
Sean de Wolski
el 13 de Mzo. de 2014
See the "Generate MATLAB Script" option.
Erin
el 13 de Mzo. de 2014
Image Analyst
el 13 de Mzo. de 2014
You can probably get a free upgrade if you purchased R2013b.
Erin
el 13 de Mzo. de 2014
You could write a customized save routine that exports the CameraParameters properties and saves them in a structure
function save_cameraParams(cpObject,fileName)
fields={'IntrinsicMatrix', 'RadialDistortion',etc...}
for ii=1:length(fields)
S.(fields{ii})=cpObject.(fields{ii});
end
save(fileName, 'S');
end
Then a similar one to reload and rebuild the vision.CameraParameters object,
function cpObject=load_cameraParams(fileName)
S=load(fileName); S=S.S
pairs=[fieldnames(S), struct2cell(S)].';
cpObject=vision.CameraParameters(pairs{:});
end
Categorías
Más información sobre MATLAB Support Package for USB Webcams en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!