This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem in Motion Estimation on Dm6437

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..

  • Ahmet,

    Can you elaborate on what kind of output do you get at 256*256 dimensions. Also please mention the DSPLIB version you are using.

    The scale factor must be 32767.5 in your code as mentioned in the documentation. No scaling is done with the function; thus the input data must be scaled by 2^(log2(nx)−ceil[log4(nx)−1]) to completely prevent overflow.

    Regards,

    Rahul

  • I'm using DSPLIB 64plus ,I get 256*256 dimensions integerdata.You mentioned that documentation.Which documentation is it? And I must be scaled the input data lineIn? I can't understand details.Could you help me please? Best Regards...