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.

Input video format question while using IMGLIB

"IMG_sobel_3x3_8(const unsigned char *in_data, unsigned char *out_data, short cols, short rows)" is a function in IMGLIB. Which video format should I use as "in_data" while using this function?

I've tried UYVY but it did not work. So I transformed from UYVY to YUY2. I made it (the sequence below).

a. To transform in_data from UYVY to YUY2, and store it in "tmp1".

b. Declare "tmp2" and call IMG_sobel_3x3_8(tmp1,tmp2,cols,rows).

c. To transform tmp2 from YUY2 to UYVY and then out_data = tmp2.

Why does not the function deal with UYVY video format? Does all of functions in IMGLIB just deal with YUY2 video?

Thanks.

  • "IMG_sobel_3x3" accepts just only single channel image like Y, R, G, B.... only  because of the concept and dose not accept multi-channel image like UYVY, YUY2, RGB888 ...... I guess.

  • Thanks akira.

    As akira said, should I change the video format from UYVY to RGB? I did not find any information about video format limitation from IMGLIB reference .

    Why could I succeed in running my codec after changing from UYVU to YUY2 when program called IMG_sobel?

    Thanks.

  • In YUY2 format, the data is already separated. YYYYYYYY....UUUU..VVVV...

    So it is single channel image data. I think wrong result may happen in boundary of Y to U and U to V.

    If you want to use IMG_sobel, use Y, U, V separately in stead of using the YUY2 format which means you need to run IMG_sobel 3 times(For Y, for U and for V)

    You should read the C code in Algorithm of IMGLIB reference. The C code is just handling single channel.