提问人:Adam 提问时间:11/3/2023 更新时间:11/3/2023 访问量:15
如何在MATLAB中计算在3D空间中移动的点的熵和互信息?
How can I calculate in MATLAB the entropy and mutual information of points moving through 3D space?
问:
我有 838 个来自对象 3D 重建的点,我想知道计算每个点的熵以及它们之间的互信息的最佳方法。我有 700 帧轨迹上每个点的 3D 坐标。我正在使用这些措施来量化对象的哪些部分最复杂。
我计算了每个点之间的距离,并使用该向量构建直方图。然后,我对直方图进行了归一化,并使用香农熵对所有条柱求和。但是我想知道是否有更好的方法使用所有三个维度,以及计算互信息的方法。这就是我现在的代码设置方式:
% 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
感谢您的帮助!
答: 暂无答案
评论