Overlapping sliding window over an image using blockproc or im2col?

OK, this is quite a complex question. I’ll try and break this up into separate parts and will answer each question separately. Question #1 blockproc can be used to implement my function on a sliding window using the BorderSize and TrimBorder arguments. B = blockproc(A,[64,64],fun,’BorderSize’,[5,5], ‘TrimBorder’, ‘false’); I realize that this creates a block of … Read more

I am looking for a simple algorithm for fast DCT and IDCT of matrix [NxM]

Here is mine computation of 1D FDCT and IFDCT by FFT with the same length: //————————————————————————— void DFCTrr(double *dst,double *src,double *tmp,int n) { // exact normalized DCT II by N DFFT int i,j; double nn=n,a,da=(M_PI*(nn-0.5))/nn,a0,b0,a1,b1,m; for (j= 0,i=n-1;i>=0;i-=2,j++) dst[j]=src[i]; for (j=n-1,i=n-2;i>=0;i-=2,j–) dst[j]=src[i]; DFFTcr(tmp,dst,n); m=2.0*sqrt(2.0); for (a=0.0,j=0,i=0;i<n;i++,j+=2,a+=da) { a0=tmp[j+0]; a1= cos(a); b0=tmp[j+1]; b1=-sin(a); a0=(a0*a1)-(b0*b1); if (i) … Read more

Extracting DCT coefficients from encoded images and video

Well, I did a bit of reading and my original question seems to be an instance of wishful thinking. Basically, it’s not possible to get the DCT coefficients from H.264 video frames for the simple reason that H.264 doesn’t use DCT. It uses a different transform (integer transform). Next, the coefficients for that transform don’t … Read more