Info

This question is closed. Reopen it to edit or answer.

I am trying to construct a matlab code that will identify marker switching in motion capture, then search through the other markers in the same frame and identify the other switched marker, then switch them back.

1 view (last 30 days)
Here's what I have so far (the data set I'm looking at is called static)
%check for marker switching
for i=1:42 %for all columns
for j=1:size(static, i) %for all rows
if abs(static (i,j)-static(i,j-1))>5 %if difference is greater then 5
temp=100; %establish temp
for ii=i:3:42 %for all columns of the same coordinate
if abs(static (ii,j)-static(i,j-1))<temp %search for difference lower then temp
temp=abs(static (ii,j)-static(i,j-1)); %if lower replace temp with difference
temp_val=static(ii,j); %if lower save value
temp_i=ii; %if lower save location
end
end
static(temp_i,j)=static(i,j); %swap values
static(i,j)=temp_val; %swap values
end
end
end

Answers (0)

Community Treasure Hunt

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

Start Hunting!