[GEM-dev] Fwd: another videoDV4L bug

Mathieu Bouchard matju at artengine.ca
Mon Mar 19 17:05:20 CET 2007


On Mon, 19 Mar 2007, IOhannes m zmoelnig wrote:
> Ivica Ico Bukvic wrote:
>> After
>> m_image.image.fromYVYU(decodedbuf);
>> I added
>> m_image.image.swapRedBlue();
> unfortunately it is mostly not that simple (e.g. my philips-toUcam
> (driver) somehow presents data with red and blue swapped when accessed
> via V4L; i cannot just add swapRedBlue() to the code, since then all
> other devices will have red and blue swapped (and they would even need
> cpu power for getting the wrong colors).

IMHO, if you get swapped red and blue, then it's possible that it's 
actually U and V that are swapped, so you should replace this by a 
fromYUYV() or prepend fromYUYV() using a swapUV() and check whether the 
output looks better than swapRedBlue().

This is because 0.75*U = B-Y whereas 0.40*V = R-Y, and those two constants 
differ, so confusing U and V and then swapping reds and blues will cause 
reds to appear brighter and blues to appear dimmer, than if just U and V 
were swapped.

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
| Freelance Digital Arts Engineer, Montréal QC Canada


More information about the GEM-dev mailing list