Hello,
I want to implement video stabilisation on dm6437. It's my MsC final thesis project.
Firstly,I have to do motion estimation.For testing before capturing the frames.I defined two frame matrices.
It's square matrice.I defined N * N matrices ,16 *16 matrice I defined like this:
The algorithm based on phase correlation.I can two dimensional fft of this frames like this :
void fft(void* currentFrame,int yRows, int xPixels)
{
int i = 0, j = 0;
int y = 0,t=0;
int *xp;
int FFTSize = N * N;
float scale = 8;
xPixels = 4;
gen_twiddle_fft16x32(w_16x16, N);
//fftrow
for(i = 0; i < 2 * N * N ; i++)
{
if(i % 2 == 0)
{
x_16x16[i] = *( ( ( int *)currentFrame ) + i ) ; ;
}
else
x_16x16[i] = 0;
}
for(i = 0; i < 2 * FFTSize; i += 2 * N)
{
DSP_blk_move((short *)(x_16x16 + i),(short *)(lineIn), 4 * N );
DSP_fft16x32(w_16x16, N, lineIn, lineOut);
DSP_blk_move((short *)(lineOut),(short *)(y_16x16 + i), 4 * N );
}
//fftcolumn
DSP_mat_trans2(y_16x16,256, 256 , y2_16x16);
for(i = 0; i < 2 * FFTSize; i += 2 * N)
{
DSP_blk_move((short *)(y2_16x16 + i),(short *)(lineIn), 4 * N );
DSP_fft16x32(w_16x16, N, lineIn, lineOut);
DSP_blk_move((short *)(lineOut),(short *)(FFTOut + i), 4 * N );
}
// Transpose of array
DSP_mat_trans2(FFTOut, 256, 256 , y2_16x16);
}
The code worked correct.But in real time application,I select frame dimension 256 *256.
When I defined matrices 32 *32 dimensions it's worked correct.When I defined matrices 64* 64 dimensions,I scaled fftrow lineout array.I divide this array elements by 100.
When I defined 128 * 128 dimensions, I scaled fftrow lineout array too,I divide this array elements by 571.
But If I define 256 *256 dimensions matrices,I can't find the correct solutions.I scaled LineOut arrays by a alot of numbers .
If anyone interested to my project file ,I can send all of it.
How Can I progress effective and faster motion estimation algorithm based on phase correlation?
It's very important for me because it is my Msc project.
Sorry for long question and english.
Best Regards..