线性插值如何在特征矩阵中插入点以使它们具有相同的大小(Linear interpolation how to insert points in a feature matrix in order to make them of equal size)
在唇读项目中。 对于每个视频,我有一个不相等的帧数的数据集,提取了一个特征矩阵,其中行数是帧数,列是提取的特征的值。 问题是视频的帧数不相同。 我需要使用线性插值并添加缺失点使它们相等。
In a lip reading project. I have a data set of not equal number of frames for each video a feature matrix was extracted where the number of rows is the number of frames and the columns is the value of the feature extracted. The problem is that the videos are not of equal number of frames. I need to make them equal using linear interpolation and adding the missing point.
最满意答案
newframes=11 %number of frames you want interpolate_data=interpn(1:size(Data,1),1:size(Data,2),Data,linspace(1,size(Data,1),newframes),1:size(Data,2))对于第二维,索引是不受影响的,没有插值。 对于第一维,linspace用于定义具有newframes值的插值网格。
newframes=11 %number of frames you want interpolate_data=interpn(1:size(Data,1),1:size(Data,2),Data,linspace(1,size(Data,1),newframes),1:size(Data,2))For the second dimensions, indices are untouched to have no interpolation. For the first dimension linspace is used to define a interpolation grid with newframes values.
更多推荐
发布评论