cancel
Showing results for 
Search instead for 
Did you mean: 

how can I use FP AI Vison to activate an alarm ?I use my own trained neural network and try to get 1 or 0 according to my camera module.

agala.1
Associate II

hello, I try to get one when something not desired is detected by the camera and else 0 so I can use my custom trained CNN with the help of x cube ai.

Fp ai vision is used to display iamge on LCD how can I get my request by changing or adding the codes in it. I tried to add some code depending on the fp ai vision but it didn't work

1 REPLY 1
agala.1
Associate II

/**

 * @brief Get the subsequent frame available and:

 *    1. send it to LCD for display

 *    2. make it available for subsequent processing

 * @param App_Context_Ptr pointer to application context

 */

void APP_GetNextReadyFrame(AppContext_TypeDef *App_Context_Ptr)

{

 ValidationContext_TypeDef* Validation_Ctx_Ptr=&App_Context_Ptr->Test_ContextPtr->ValidationContext;

 uint8_t* cam_capture_buff = App_Context_Ptr->Camera_ContextPtr->camera_capture_buffer;

#if MEMORY_SCHEME != FULL_INTERNAL_MEM_OPT

 uint8_t* cam_frame_buff = App_Context_Ptr->Camera_ContextPtr->camera_frame_buffer;

#endif

  

 if((App_Context_Ptr->Operating_Mode == VALID) && (Validation_Ctx_Ptr->validation_completed ==0))

 {

  TEST_GetNextValidationInput(App_Context_Ptr->Test_ContextPtr, 

                cam_capture_buff);   

 } 

 else if((App_Context_Ptr->Operating_Mode == DUMP) && 

     (App_Context_Ptr->Test_ContextPtr->DumpContext.Dump_FrameSource == SDCARD_FILE))

 {

  TEST_GetNextDumpInput(App_Context_Ptr->Test_ContextPtr, 

             cam_capture_buff);

 }

 else

 {

  /* Wait for current camera acquisition to complete*/

  while(App_Context_Ptr->Camera_ContextPtr->new_frame_ready == 0);

 }

  

  

#if MEMORY_SCHEME != FULL_INTERNAL_MEM_OPT  

 if(App_Context_Ptr->Operating_Mode != VALID)

 {

  /****Coherency purpose: invalidate the camera_capture_buffer area in L1 D-Cache before CPU reading****/

  UTILS_DCache_Coherency_Maintenance((void*)cam_capture_buff, 

                    CAM_FRAME_BUFFER_SIZE, INVALIDATE);

 }

  

 /****Copy the camera_capture_buff buffer content onto the camera_frame_buff buffer so to release the camera capture buffer before triggering the subsequent camera frame capture****/

 for(uint32_t i=0;i<CAM_RES_WIDTH*CAM_RES_HEIGHT*RGB_565_BPP; i++)

 {

  *((uint8_t *)(cam_frame_buff + i)) = *((uint8_t *)(cam_capture_buff + i));

 }

#endif

}

ı think there should be a change in    1. send it to LCD for display part