2016-12-14 35 views

回答

0

- 对于每个像素,使用4个最近光流值的接近度和大小对其梯度进行插值。
- 然后将时间步应用于插值梯度值以生成目标位置。
- 由于得到的位置不会直接在网格上,我可能会根据原点像素的强度计算以目标为中心的高斯。然后使用该高斯将强度值添加到输出图像中的相邻单元格中。或者,您可以采用(原始像素的)强度,并将该强度加权分割到目的地位置最近的4个细胞中心。 (我觉得这样可能会使图像模糊不清)

0

使用理想的变形策略,最好基于插值。在matlab中,使用“interp2”效果很好。 Matlab的例子:

s = 40; %size of data 
t = 1; %time offset 

[x,y] = meshgrid(1:s,1:s); 

binIm = (x-(s/2)).^2 +((y-(s/2)).^2)*10 <((s/3))^2; 

subplot(2,2,1); imagesc(binIm); colormap gray;axis image; 
title('eliptical mask'); 

%some rotational flow (curl) 
Ur = 10*(y-(s/2))/(s/2); 
Vr = -10*(x-(s/2))/(s/2); 

%some zooming flow (divergent) 
Uz = 10*(x-(s/2))/(s/2); 
Vz = 10*(y-(s/2))/(s/2); 

binImR = interp2(double(binIm),x-t*Ur,y-t*Vr); 
subplot(2,2,3); imagesc(binImR); axis image;colormap gray; 
hold on; quiver(Ur,Vr); 
title('rotational flow'); 

binImZ = interp2(double(binIm),x-t*Uz,y-t*Vz); 
subplot(2,2,4); imagesc(binImZ); axis image;colormap gray; 
hold on; quiver(Uz,Vz); 
title('zooming flow'); 

注意的是,更大的你做“T”,更糟糕的逼近将成为,尤其是对旋转运动。