Help with transformPointsForward function

10 Ansichten (letzte 30 Tage)
Mark Stoessel
Mark Stoessel am 19 Apr. 2022
Beantwortet: Mark Stoessel am 21 Apr. 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);

Akzeptierte Antwort

Mark Stoessel
Mark Stoessel am 21 Apr. 2022
Figured it out!

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by