Help with transformPointsForward function
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mark Stoessel
el 19 de Abr. de 2022
Respondida: Mark Stoessel
el 21 de Abr. de 2022
Hello, I'm fairly new to Matlab and having trouble with the transformPointsForward function. I'm trying to transform a matrix based on a set of reference points and subsequent dervied transformation matrix. For background, these sets of cell body coordinates taken on different days (day1 and day2) in three dimentions. The images are largely the same but have small devations both translationally and perhaps rotationally. I use day2trans = transformPointForward(day2, tform) and get the the error: Check for incorrect argument data type or missing argument in call to function. For reference day2 is a 37x3 double array and tform is my 3x3 transfromation matrix. According to the documentation, transformPointsForward can take a 2 or 2D set of points to tranform and a transformation matrix and calculate the resulting transformation. Would appreciate any assistance
fprintf('Select input folder'); %hope to automate soon and look for CSVs in folder and run in batch
dir=uigetdir();
cd(dir);
file=uigetfile(('*.csv'), 'Choose a File');
T = readtable(file);
Data=table2array(T);
day1 = rmmissing(Data(:,1:3)); % moves days into separate arrays and removes NaN
day2 = rmmissing(Data(:,4:6));
ref2=rmmissing(Data(:,8:10)); % ~8 (points) x 3 (x y z) matrix for day 2
ref1=rmmissing(Data(:,11:13)); % ~8 (points) x 3 (x y z) matrix for day 1
% Order is just a quirk in how my program spits it out. Will be used as reference points for alignment
%transform the points
%tform * ref1 = ref2
%tform * ref1 * inverseref1 = ref2 * inverseref1
%tform = ref2 * inverseref1
tform = pinv(ref1) * ref2;
day2trans = transformPointsForward(day2, tform);
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!