Learn Before
Conceptual Breakdown of OpenCV Image Storage
OpenCV actively uses numpy arrays to store information for each pixel. We have BGR color channels that are being stored inside of each pixel.
[ [[0,0,0], [], [] [255,255,255]], [], [], ]
Color values are stored and it's array[row][col].
Where each channel's information is stored
blue green red [ 0, 0 , 0 ]
Values can span between 0 and 255. Therefore, it is important to understand that openCV doesn't actually do anything to the image beyond adjusting what information is stored where. i.e. If we wanted to rotate the image, it would just move the values accordingly. Thus it is important to understand that we can actually just manipulate the underlying values directly if we actually wanted to.
To access specific values
#specific index print(img[256][400]) #splicing print(img[256][40:400])
0
1
Tags
Python Programming Language
Data Science
Related
Installing and Importing OpenCV
Loading in Assets in OpenCV
Displaying Images
Resizing Images
Rotating Images
Conceptual Breakdown of OpenCV Image Storage
Slicing / Copying Portions of the Image
Creating Text
Project Directory Structure for OpenCV
Shape Creation in OpenCV
Writing Images (OpenCV)
Live Video Feed Processing in OpenCV