Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

bgr555 means: each (8bit) channel in a bgr image gets reduced to 5 bits, like:

(red >> 3);

then we end up with 15 bits, which are stored in 2 8bit channels, with the high nibble in the first channel, and the low one in the 2nd.

 b1 b2 b3 b4 b5 r1 r2 r3 r4 r5 r1 r2 r3 r4 r5

 [   first channel    ] [ second channel    ]

also, this format is rarely used directly in computer-vision, it's more a temporary compression format (e.g. some android devices use this)

bgr555 means: each (8bit) channel in a bgr image gets reduced to 5 bits, like:

(red >> 3);

then we end up with 15 bits, which are stored in 2 8bit channels, with the high nibble in the first channel, and the low one in the 2nd.

 b1 b2 b3 b4 b5 r1 r2 r3 r4 r5 g1 g2 g3 g4 g5 r1 r2 r3 r4 r5

 [   first channel    ] [ second channel    ]

if you use only the 2nd channel in your code, you get the lower green bits and all of the red bits, which kinda explains, why it will trigger on "brown".

also, this format is rarely used directly in computer-vision, it's more a temporary compression format (e.g. some android devices use this)

bgr555 means: each (8bit) channel in a bgr image gets reduced to 5 bits, bits (the lowest 3 bits get thrown away), like:

(red >> 3);

then we end up with 15 bits, which are stored in 2 8bit channels, with the high nibble in the first channel, and the low one in the 2nd.

 b1 b2 b3 b4 b5 g1 g2 g3 g4 g5 r1 r2 r3 r4 r5

 [   first channel    ] [ second channel    ]

if you use only the 2nd channel in your code, you get the lower green bits and all of the red bits, which kinda explains, why it will trigger on "brown".

also, this format is rarely used directly in computer-vision, it's more a temporary compression format (e.g. some android devices use this)