admin
|
Another email question - >Hi, could you just explain me how the "unsigned char *frame_buf" (the >picture) is structured? Is it an array of YUV values, with 3 entries >for every pixel of the image? Are there any headers? I'm just asking >because I wanted to work a bit on the vision functions on the firmware. > There aren't any headers. The U and V are subsampled by the OV9655, so the frame buffer format is actually UYVY - each Y pixel uses its adjacent U and V to form a complete YUV, and in the image processing code, we sometimes average the 2 Y pixels - ix = index(xx,yy); //y = (((unsigned int)frame_buf[ix+1] + (unsigned int)frame_buf[ix+3])) >> 1; y = (((unsigned int)frame_buf[ix+1] + (unsigned int)frame_buf[ix+3])) >> 1; u = (unsigned int)frame_buf[ix]; v = (unsigned int)frame_buf[ix+2]; The total frame buffer size is actually imgWidth*imgHeight*2. The OV9655 basically counts a pixel as a 16-bit UY or VY pair.
|