How to implement an algoritm for image processing
Hi there!
I'm using an STM32F746 disco with an OV9655 camera module. I have already configured all necessary peripherals: LTDC, FMC and DCMI.
What I want to do exactly is tell the camera in which buffer I want it to save the image. In the meantime, process the previous image using the CPU. When I finished processing the image, I want to tell the LCD to display it.
Maybe it will better br understood if you see this:
while (1)
{
// HAL_Delay(500);
//DCMI->CR |= (1U << 0);
switch (sequence) {
case SEQ_1:
/* 1- Capture -> Buff_1 */
Take_a_frame( buff_address[0] );
sequence = SEQ_2;
break;
case SEQ_2:
/* 1- Capture -> Buff_2 2- Pocess Buff_1 */
Take_a_frame( buff_address[1] );
processar( );
sequence = SEQ_3;
break;
case SEQ_3:
/* 1- Capture -> Buff_3 2- Process Buff_2 3- Buff_1 -> LCD */
Take_a_frame( buff_address[2] );
processar( );
Show_frame( buff_address[0] );
sequence = SEQ_4;
break;
case SEQ_4:
/* 1- Capture -> Buff_1 2- Process Buff_3 3- Buff_2 -> LCD */
Take_a_frame( buff_address[0] );
processar( 2 );
Show_frame( buff_address[1] );
sequence = SEQ_5;
break;
case SEQ_5:
/* 1- Capture -> Buff_2 2- Process Buff_1 3- Buff_3 -> LCD */
Take_a_frame( buff_address[1] );
processar( );
Show_frame( buff_address[2] );
sequence = SEQ_3;
break;
default:
break;
}
}
I have tried to configure the camera in different ways: Snapshot mode, continuous mode, whith the DMA in circular of normal mode... But it gives me a lot of problems.
Could someone tell me if I'm doing the right thing when using 3 buffers? How should the camera be configured? (shapshot or continuous) How should the DMA be configured? (normal or sircular). What would be a more efficient way to do it?
Thanks in advance!