Hey There,
I'd like to write a single videoline, which is stored on DDR-RAM, in a Mat Object.
I have initialized an int-Array and convert it to a Mat Object:
int Video_Line = (int *) calloc(1920, sizeof(int)); //Allocate 1920 1D int Array
Mat videoline = Mat(1, 1920, CV_8UC1, Video_Line); //Convert to Mat
Now the write function:
for(int i=0; i <= 1920; i++) { unsigned long val = getAddressValue((DPRAM_START+i)+(3
i)); unsigned short int YCb = val; unsigned int YCr = (val >> 16 );
Video_Line[i+d] = YCr; Video_Line[i+1+d] = YCb; d++; }
My Problem: The format does not make any sense. It should be like:
Mat = [Y0, Cr0, Y1, Cb1, Y2, Cr2, ...]
But the result is:
Mat = [80, 4b, 0, 0, 80, 4b, 0, 0, 80, 4b, 0, 0, 80, 4b, 0, 0, 80, 4b, 0, 0, ]
How can I set up YCrCb-format for Mat? Best regards,
Michael