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.

Rotate Image on C6748 Video loopback

Hello !!

I would like to flip image in the video loopback example given bye Texas. I d'ont know how to access to the image matrix ou image pointers to do this.

The other solution is to use openCV and use the flip function in cxcore.h .but the facedetect demo give just a precompiled librairie. That anyone know how to import openCV drivers to the DSP c6748. I didn't found any link or tutorial about this.

Think you for your help

  • Hi,

    Thanks for your post.

    OpenCV 1.1 is an initial version of the vision library which was built using C code. OpenCV 2.x migrates all of this initial software to a C++ code base and adds several new APIs to vision library. You should start determining  which APIs you need for your algorithm and identify which version provides you all this functionality. OpenCV does run on the DSP but there is some porting effort involved to cross compile it.

    The version of OpenCV libraries included in the OAMPL138 BIOS SDK is version 1.1 and not OpenCV 2.4 which is the current version. We do have have cvFlip function inside of OpenCV 1.1 version that you can use but for API reference, you would have to refer to OpenCV 1.1 documentation.

    I think, you need to call the flip function from cxcore header file.

    CVAPI(void) cvFlip( const CvArr* src, CvArr* dst CV_DEFAULT(NULL), int flip_mode CV_DEFAULT(0));

    The cxcore library of OpenCV is integrated for identifying the face and the face detect demo integrates prebuild OpenCV functions for facedetect and the OpenCV libraries are located at c6sdk_02_00_00_00\demos\facedetect\bin

    There is also gpio flip code proposed in the below E2E post through DIP switches for horizontal & vertical flip functions, please check it which would help you understand better:

    http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/t/341382.aspx?pi301046=2

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.
    -------------------------------------------------------------------------------------------------------
  • Think you very much for your reply !!

    I think it is difficult and it need much efforts. I try now to flip image in the the code given in startweare ( video llpback).

    Could you tell me how to acess to the pixel on the video loopback . I know the transformation to do but i don"t how to process the image matrix or how to acess to it ( wich pointer i need to use)

    Could you explain me.

    Sorry for my bad english

    Best regards

  • Hi Anouini mustapha,

    Think you very much for your reply !!

    Could you tell me how to acess to the pixel on the video loopback . I know the transformation to do but i don"t how to process the image matrix or how to acess to it ( wich pointer i need to use)

    We can provide our suggestions , inputs and ideas on your project requirement then you should develop it on your own.

    Thanks for your understanding.

    All the best for your developments.

  • Hello !!

    The answer is in the post below

    think you !!

  • I come bacj to give the solution of the problem that i have get. To do mirror flip we need just to make those changes in the bcr422sp_to_rgb565_dsp.c function that convert the Ycbcr422 to rgb565.

    for vertical flip we change:

     cbcr_src_p = (unsigned char *)cbcr_src + (num_lines-i) * src_pitch;
      y_data_p = (unsigned char *)y_data + (num_lines-i) * y_pitch;
      rgb_data_p = (unsigned short *)rgb_data + i * rgb_pitch;

    by :

    cbcr_src_p = (unsigned char *)cbcr_src + i * src_pitch;
     y_data_p = (unsigned char *)y_data + i * y_pitch;
     rgb_data_p = (unsigned short *)rgb_data + (num_lines-i-1) * rgb_pitch;

    For Horizontal flip we need to change :

    _amem4(&rgb_data_p[j + 6]) = rgb_76;
    _amem4(&rgb_data_p[j + 4]) = rgb_54;
    _amem4(&rgb_data_p[j + 2]) = rgb_32;
    _amem4(&rgb_data_p[j + 0]) = rgb_10;

    By :

    _amem4(&rgb_data_p[num_pixels - j-7]) = rgb_76;
    _amem4(&rgb_data_p[num_pixels - j - 5]) = rgb_54;
    _amem4(&rgb_data_p[num_pixels -j - 3]) = rgb_32;
    _amem4(&rgb_data_p[num_pixels - j -1]) = rgb_10;

    For both horizontal and vertical flip we need to make the both changes:

    Those changes are tested.Please to make verified answer to close this thread

    Think you !!


       

  • Hi Mustapha,

    Sounds good.

    Thanks for your update and  I hope it could help others too.