How to compute space-time gradients in video processing

1 回表示 (過去 30 日間)
shab shekan
shab shekan 2011 年 6 月 28 日
Hi guys, how can compute or examine the space-time gradients ∇Pi = (Pxi, Pyi, Pti ) of the intensity at each pixel within video frames? I realy need it.
  1 件のコメント
shab shekan
shab shekan 2011 年 8 月 11 日
another way to compute space time gradient is
gradx1 = imfilter(seq,[-1 1] /2,'same');
grady1 = imfilter(seq,[-1 1]'/2,'same');
gradt1 = imfilter(seq,reshape([-1 1],[1 1 2])/2,'same');
seq is a space-time patch (stpatch) from video file around a pixel with size 7*7*3.
But I have problem in gradt1. if you run this filters on simple 3D matrix, you will find out that gradt1(:,:,3) is very different against gradt1(:,:,1) and gradt1(:,:,2).
and it makes me in crazy.
I found this code in net, and nobody answere me on there.
please check this code and analyze this code, and explain to me. I can understand how does it compute temporal gradient(gradt)?
If it need change to compute 7*7*3 volume, please tell me.

サインインしてコメントする。

回答 (2 件)

David Young
David Young 2011 年 6 月 28 日
The issue with image gradients is usually how much smoothing of the image data to do. This is a question not just of the noise in the images, but also of the spatial and temporal scales at which you want to estimate the gradients. You may well have to experiment with smoothing techniques and their associated parameters to get a useful result.
If you are happy to estimate the temporal gradient from only a pair of frames (more precise estimation methods may use more than 2 frames), and you are happy with Gaussian smoothing, then you could use the function gradients_xyt from this FEX contribution.
  1 件のコメント
shab shekan
shab shekan 2011 年 7 月 2 日
Thank you David,that's great, it solved my problem.I check it few minutes after you answere, but I forgote to appreciate.
Thank.

サインインしてコメントする。


Sean de Wolski
Sean de Wolski 2011 年 6 月 28 日
  1 件のコメント
shab shekan
shab shekan 2011 年 7 月 2 日
thank you Sean, I had checked it.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by