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.

Regarding IMGLIB on video capturing

Hi, I was doing video capturing lately. However I need to do some processing on the raw data before I display the image on the monitor. However I do not see the correct output image obtained after processed. Here's a part of the coding where I have did some editing on the main image capturing part. It's a grayscale loopback.

I was first defined 2 arrays for intermediate processing. The resolution that I'm using is 800 * 600.

#include "img_median_3x3.h"
unsigned char inputRawData[480000]={0};
unsigned char processedRawData[480000]={0};

 while(1){
                 for(i = 0; i < numLines; i++) {
                 DAT_copy(capFrameBuf->frame.iFrm.y1 + i * capLinePitch, inputRawData, disLinePitch);   //Copy the raw data from captured frame buffer to an array(inputRawData)
                 CACHE_wbInvAllL2(CACHE_WAIT);
                  }
                  IMG_median_3x3_c(inputRawData, 800, processedRawData);                                                  //Sending the inputRawData into the IMGLIB to process.
                  for(i=0;i < numLines; i++) {
                 DAT_copy(processedRawData, disFrameBuf->frame.rpFrm.buf + i * disLinePitch, disLinePitch); //Copy the processed data and display on monitor.
                 CACHE_wbInvAllL2(CACHE_WAIT);
                 }

                FVID_exchange(disChan, &disFrameBuf);         
                frames ++;             
                }

It does show something on monitor but it is not desired ones. Here's the image before processing and after processing. Any idea what I should do to resolve that problem?

I had checked on the processing in between the input image and output, it suppose does not give any error.

@Tim: Temporarily on hold communication part. Had read your reply and thanks for helping.

Edited on 21/01/2008: As I tried to check on the input data, which i was trying to copy the image data into inputRawData array, I found that the data copied is incorrect. What I'm trying to check is by doing this way.

#include "img_median_3x3.h"
unsigned char inputRawData[480000]={0};
unsigned char processedRawData[480000]={0};

 while(1){
                 for(i = 0; i < numLines; i++) {
                 DAT_copy(capFrameBuf->frame.iFrm.y1 + i * capLinePitch, inputRawData, disLinePitch);   //Copy the raw data from captured frame buffer to an array(inputRawData)
                 CACHE_wbInvAllL2(CACHE_WAIT);
                  }
                  //IMG_median_3x3_c(inputRawData, 800, processedRawData);                                                  //Sending the inputRawData into the IMGLIB to process.

                 DAT_copy(inputRawData, processedRawData, disLinePitch);  

                  for(i=0;i < numLines; i++) {
                 DAT_copy(processedRawData, disFrameBuf->frame.rpFrm.buf + i * disLinePitch, disLinePitch); //Copy the processed data and display on monitor.
                 CACHE_wbInvAllL2(CACHE_WAIT);
                 }

                FVID_exchange(disChan, &disFrameBuf);         
                frames ++;             
                }

At this stage I found that it's not a proper image. I will try on getting the raw data captured by camera while waiting for comments and guides at the same time.

Regards,
Matthew

  • I am curious what device you are using and how you are capturing and displaying the image?

    Matthew said:
    At this stage I found that it's not a proper image. I will try on getting the raw data captured by camera while waiting for comments and guides at the same time.

    In this case you may want to try taking a look at the image from the CCS image viewer (if your image is in a planar (non interleaved) color format) to see if this is happening on the capture end or the display end.

    Vertical streaks like this is a bit odd, usually if there is a configuration issue you would end up with horizontal streaks, I suppose this could mean that the display is reading the same line from the buffer over and over instead of continuing to increment down the image.

  • Hi brad and bernie,

    It appears that I had made mistakes on the cache coherency. I had solved the problem for that, and so far it is okay. I think the image is not really perfect as it maybe cause of noises ( what I had done is sobel on the video capturing).

    I will try on median soon.

     

    Thanks and regards,

    Matthew