How can I calculate in MATLAB the entropy and mutual information of points moving through 3D space?

39 Views Asked by At

I have 838 points from a 3D reconstruction of an object and I want to know the best way to calculate the entropy of each point and the mutual information between them. I have 3D coordinates for each point over a 700 frame trajectory. I'm using these measures to quantify which parts of the object are the most complex.

I calculated the distance between each point and use that vector to construct a histogram. Then, I normalized the histogram and used Shannon's entropy to sum over all the bins. But I want to know if there is a better method using all three dimensions, as well as a method for calculating mutual information. This is how my code is set up right now:

% traj is the distance vector, 838 x 700 in dimension
[rownum, colnum] = size(traj);
ENT = [];

for i = 1:rownum
    point = traj(i,:);
    [N,edges] = histcounts(point); % get values from histogram
    p = N/length(point); % make the probability distrution by dividing by N
    entropy = -sum(p .*log(p)); % calculate total entropy for one vertex
    p(p==0) = [];
    ENT = [ENT; entropy];
    
end

Thank you for your help!

0

There are 0 best solutions below