Help with transformPointsForward function

조회 수: 7 (최근 30일)
Mark Stoessel
Mark Stoessel 2022년 4월 19일
답변: Mark Stoessel 2022년 4월 21일
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);

채택된 답변

Mark Stoessel
Mark Stoessel 2022년 4월 21일
Figured it out!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by