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.

Could I use VPSS to do image processing in the format RGB with DM6437?

Hi,

I would like to process image in the format of RGB888.(since I have some C functions in hand)

I am just new to DSP and use DM6437 to evaluate image processing algorithm.

 

I used the sample code at C:\dvsdk_1_01_00_15\psp_1_00_02_00\pspdrivers\system\dm6437\bios\dm6437_evm  to start working with 6437.

 

Firstly, I access each pixel in YUV format by declare unsigned char *test;

and access by

test=(unsigned char *)FBAddr->frame.frameBufferPtr;

for (j=720*240; j<=720*250;j++)

{

           *((test) + (2 * j)) = 128;

}

 

it works.

 

However, I try to write functions ycbcr2rgb(Uint8* src, Int32 width, Int32 height, Uint8* des);  and void rgb2ycbcr(Uint8* src, Int32 width, Int32 height, Uint8* des);

and declare  unsigned char testBGR[720*480*3];  unsigned char testYUV[720*480*2]; in the global scope.

using 

memcpy(testYUV, test, sizeof(unsigned char)*720*480*2);

ycbcr2rgb(testYUV, 720, 480, testBGR);

rgb2ycbcr(testBGR, 720, 480, testYUV);

memcpy(test, testYUV, sizeof(unsigned char)*720*480*2);

 

in the main function.

But it crashes with

Trouble Halting Target CPU:

Error 0x00000020/-1060

Error during: Execution, 

An unknown error prevented the emulator from accessing the processor

in a timely fashion.

Could someone help me with the problem?

In addition, I study the user guide spraak8 Understanding the DaVinci Preview Engine and find that there is a process from RGB to YUV422

Could I process the data just after I capture from the camera with format RGB?


Thanks a lot


BR,

Hank 

  • Hank,

    No, you can not use the original data captured from sensor since it is in RGB Bayer format, not the RGB888 format you'd want. Your current approach of converting YUV to RGB is correct. WRT to your debug effort, since you are using CCS on DM6437, can you please use single step and find out where exactly you program crashes? Make sure the pointers and arrays you defined point to valid data and/or have enough space.

    Xiangdong

  • Xiangdong,

     

    Thanks for your response.

    There is another question. The format you mentioned(RGB Bayer) is obtained from CCDC or after vpfe?

    Ths,

    Hank

  • Hi,

     

    Bayer RGB data is from CCDC, you can use Previewer module in vpfe to convert bayer RGB into YUV422.

     

    Thx,

    Brijesh Jadav

  • Hi,

    Ths for your sharing.

    There is another question.

    The document of VPSS indicates that it can display two video and two OSD windows simultaneously.

    So that I would like to display two windows with the same size. For example, I would like to capture the camera and display at video 0 and draw some lines or other processing over video 0, as video 1.

    However, I need to let video 1 transparent. But I think only OSD windows can be transparent. 

     

    So I claim one video 0 window and one OSD window. (just change beinitParams.id   from   PSP_VPBE_VIDEO_1, PSP_VPBE_VIDEO_0  to   PSP_VPBE_VIDEO_0 and PSP_VPBE_OSD_0), but it fails.  Does any one what I should do for this situation?

     

    Thanks a lot

     

    BR,

    Hank

  • Yes, video windows can only overlay and no blending is allowed there. So video window 1 is always on top of video window 0 and must be contained by video window 0. If you want to blend the two windows. You must use the OSD window to draw those lines. OSD window 1 can be used as attribute window for bit-wise blending control.

     

    Regards,

    Xiangdong

  • Xiangdong,

    Thanks for your reply.

    One remaining problem is that could I only use vid0 and osd0 to display?

    I mean I don't need 4 windows but 2 with blending.

     

    Thanks in advance.

     

    BR,

    Hank