Skip to content

Commit 8192ed0

Browse files
committed
1 parent b5a4e75 commit 8192ed0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/examples/bayer_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@
5858
# values A, B, C, D and arranged like so:
5959
#
6060
# byte 1 byte 2 byte 3 byte 4 byte 5
61-
# AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD AABBCCDD
61+
# AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD DDCCBBAA
6262
#
6363
# Here, we convert our data into a 16-bit array, shift all values left by
6464
# 2-bits and unpack the low-order bits from every 5th byte in each row,
6565
# then remove the columns containing the packed bits
6666

6767
data = data.astype(np.uint16) << 2
6868
for byte in range(4):
69-
data[:, byte::5] |= ((data[:, 4::5] >> ((4 - byte) * 2)) & 0b11)
69+
data[:, byte::5] |= ((data[:, 4::5] >> (byte * 2)) & 0b11)
7070
data = np.delete(data, np.s_[4::5], 1)
7171

7272
# Now to split the data up into its red, green, and blue components. The

0 commit comments

Comments
 (0)