Hi! i want to use only Y component of YCbCr and display just this Y component.
how can i do this?
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.
Hi! i want to use only Y component of YCbCr and display just this Y component.
how can i do this?
The DMP VPFE User's Guide explains the way data is stored in DDR memory after capture. Your algorithm will receive a pointer to a buffer containing the captured data, and you can ignore the Chroma components or run an EDMA operation to pack the Y data the way you prefer; it will be easiest to just ignore the Chroma values and step through the array accessing the Y values at their existing locations.
For your output, place the output Y values in similar locations as defined for the output color format you choose. The Chroma values may be don't care or may need to be filled with 0x00/0x04 or 0x40 or 0xFF/0xFB depending on your output format and your display device. This fill step can likely be done once for each output buffer, then during operation you will only write new values to the Y locations.
If this answers your question, please click the Verify Answer button below. If not, please reply back with more information.
thanks randy. i try values that you gave but i couldnt see gray scale image.
code is like this;
for(i = 0; i < (height * width * 2) ; i+=2)
*(currentFrame + i) = 0 x04;
what i miss in this code? or what else can i do?
Are you writing to the right places, per the VPFE User's Guide?
What do you see?
Can you try different values?
Try filling the entire array, including Y, with the same value and see what you get on the display. Try different values and see how the display changes.
i solve my problem like this;
for( xx = 0; xx < (yRows * xPixels)*2; xx+=2 )//just operating on the chroma, every other byte thus increment by 2
*( ( (unsigned char*)currentFrame ) + xx ) = 0x80; //set all chroma to midpoint 0x80
i wanna ask you something else;
for example i'm trying to take Y components from captured images to in a array like this is this true way to take Y components?
for( i = 1; i < (yRows * xPixels)*2; i+=2 )
{
*( ( (unsigned char*)Ycomponent) + k) = *( ( (unsigned char*)currentFrame ) + i ) ;
k++;
}
You tried a new value and now you have gray-scale. Excellent work. You can change the values written to Cb and Cr, and view the effects on the display if you are interested in learning about the Chroma values in a color display.
Since the even numbered bytes are the Cb/Cr values, then the odd numbered bytes will be the Y values, so your second for-loop should pull out the data. If this completes your original question, please pick the best-answer post(s) of this thread and mark them with Verify Answer so future readers will find the answer quickly. Your thread above may be the one with the best answer.
Two suggestions to consider:
1) Instead of using the DSP to copy the Y values, use a QDMA channel to do the copy. Depending on setup time, it will be faster even if the DSP has to wait for it to complete.
2) Instead of copying the Y values into a packed array, just work with them in the full array. Depending on the algorithms you plan to use on the Y values, this may not affect your processing time at all, and would save the copy time.
To learn about the QDMA or the use of EDMA3 for #1 above, please see the documentation on the EDMA3 Low Level Drivers (LLD) that come with the DM6437 PSP software. Then if you have further questions once you have tried some of those examples, start a new thread on this forum and then on this thread you can post a link to that new one to tie them together.
Regards,
RandyP