Skip to content

Commit 1960302

Browse files
authored
Merge pull request #198 from jclu2688/master
updated order of color channels
2 parents 7c41ee7 + 7b8e0ab commit 1960302

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/Module3_IntroducingNumpy/VectorizedOperations.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ If $X$ is an $N$-dimensional array, and $j$ (with $j \leq N$) axes are specified
586586

587587
A digital image is simply an array of numbers, which instructs a grid of pixels on a monitor to shine light of specific colors, according to the numerical values in that array.
588588

589-
An RGB-image can thus be stored as a 3D NumPy array of shape-$(V, H, 3)$. $V$ is the number of pixels along the vertical direction, $H$ is the number of pixels along the horizontal, and the size-3 dimension stores the red, blue, and green color values for a given pixel. Thus a $(32, 32, 3)$ array would be a 32x32 RBG image.
589+
An RGB-image can thus be stored as a 3D NumPy array of shape-$(V, H, 3)$. $V$ is the number of pixels along the vertical direction, $H$ is the number of pixels along the horizontal, and the size-3 dimension stores the red, green, and blue color values for a given pixel. Thus a $(32, 32, 3)$ array would be a 32x32 RGB image.
590590

591591
It is common to work with a collection of images. Suppose we want to store N images in a single array; thus we now consider a 4D shape-$(N, V, H, 3)$ array.
592592

@@ -716,7 +716,7 @@ array([[20, 24],
716716
153422.97903817348
717717

718718
# 3. The minimum blue value, respective to each image.
719-
# the colors are ordered red-blue-green along axis-3
719+
# the colors are ordered red-green-blue along axis-3
720720
>>> min_blue = images[:, :, :, 2].min(axis=(1, 2))
721721
>>> min_blue.shape
722722
(100,)

0 commit comments

Comments
 (0)