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.

read multiple images and store in different loacations

HI,

   I am very new to the world of video processing.I want to process on two different images.  Can anybody tell me how I can read multiple images through camera and stored it in different variables.

Thanks

 

  • Hi,

    Your question is too general and vague. Please be as specific and detailed as possible. Also, please include which device, camera, color space, you are talking about.

  • HI,

      I am using tms320dm6437EVM board .I am trying to grab three frames from camera in Y:Cb:Cr format and store just Y component of them in 2-dimensional variables.

    this is the code i use to capture thee different images and store this images in three different variables  int  I_frame[720][480],int B_frame[720][480],int P_frame[720][480],

    I have wriiten code here (supposed to work this way) which will capture image from camera and store it in I_frame and display it then after some delay it will capture different image from camera and store it in B_frame and display it  and then will capture different image from camera and store it in P_frame and display it 

     

    But I see that  delay is appear just once after that it doesn't appear. So I dont get three different images .

    Can you please tell me Am I doing right way or what is right way to capture images and store it in variables.?

    Thanks

     

    CODE:

     

    while (status==0 && flag<3) 

      {

          for (i = 0;i <100000 ;i++)                  //this loop is here

                          {

                                for (j = 0;j < VECTOR_SIZE;j++)      //to insert delay so

                                {

                                  }                                    //image can be changed on camera

                           }                                        //

     

    FVID_exchange(hGioVpfeCcdc, &frameBuffPtr); //this function capture image and

                                                                                           // store it on  frameBuffPtr->frame.frameBufferPtr

    get_frame((frameBuffPtr->frame.frameBufferPtr)); //this will get Y component of image and store in read_frame[720][480]

                  if(flag==0)

                     {

                     memcpy(I_frame,read_frame,sizeof(read_frame));  //copy captured image in I_frame

                      memcpy(write_frame,I_frame,sizeof(write_frame)); //copy I_frame in write_frame so can be displayed 

                     }                                                                                              //using display_frame function

                  else if (flag==1)

                  {

                    memcpy(B_frame,read_frame,sizeof(read_frame));   //copy captured image in B_frame

                    memcpy(write_frame,B_frame,sizeof(write_frame));//copy B_frame in write_frame so can be displayed 

                  }                                               //using display_frame function

                 else

                 {

                  memcpy(P_frame,read_frame,sizeof(read_frame));  //copy captured image in P_frame

                  memcpy(write_frame,P_frame,sizeof(write_frame));//copy P_frame in write_frame so can be displayed 

                   }                                               //using display_frame function

             

            display_frame((frameBuffPtr->frame.frameBufferPtr));      //write data from write_frame to &frameBuffPtr

            FVID_exchange(hGioVpbeVid0, &frameBuffPtr);               //display the image

     

    flag=flag+1;

    }

     

     

    void get_frame (void * frame)

    {

    int j,k, n;

    n = 1;

     

     

    for (j = 0;j < 720;j++)

    {

       for (k = 0;k < 480;k++)

       {

            read_frame[j][k]= * (((unsigned char * )frame)+n);

    n=n+2;

       }

    }

    }

    void display_frame (void * frame)

    {

    int j,k, n;

    n = 1;

    for (j = 0;j < 720;j++)

    {

       for (k = 0;k < 480;k++)

       {

            * (((unsigned char * )frame)+n)=write_frame[j][k];

    * (((unsigned char * )frame)+n+1)= 128;

    n=n+2;

       }

    }

    }

     

  • HI,

     

    From this webpage (http://wiki.davincidsp.com/index.php?title=Accessing_pixels_in_a_frame_on_DM643x) i think to capture fresh frame for process which is currently available on camera screen, I have to invalidate cache every time I call FVID_exchange.

     

    Can any one please tell me how to invalidate cache in dm6437?

     

    Thanks

  • Satya, Thank you for providing all the information. I will forward this to our BIOS team. They should be able to comment.

  • I'll ask the PSP team to weigh in...

  • Satya,

    I think that the example you pointed to does what you want. A new frame is grabbed via FVI_exchange() then the CPU will read the buffer (which cache the video data), modify it and save it back in the cache. Tthen at the end BCACHE_wbInv() is called to write the modified buffer back to DDR and invalidate the CACHE.

    Other CACHE operation are possible depending on the scenario. See the BIOS user's guide - SPRU403Q at page 45 section 2.2 for the list of all BCACHE fct.

    Regards,

    A.