Learn Before
Concept
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
Updated 2021-06-22
Tags
Python Programming Language
Data Science