To show you the coordinate system in OpenCV and how to access individual pixels, we are going to show you a low-resolution image of the OpenCV logo:
![](https://static.packt-cdn.com/products/9781789344912/graphics/assets/05fc4aae-b9fd-469d-ad2a-355e805e5c07.png)
This logo has a dimension of 20 × 18 pixels, that is, this image has 360 pixels. So, we can add the pixel count in every axis, as shown in the following image:
![](https://static.packt-cdn.com/products/9781789344912/graphics/assets/104f4697-cba0-4e4c-9191-13137ebd6039.png)
Now, we are going to look at the indexing of the pixels in the form (x,y). Notice that pixels are zero-indexed, meaning that the upper left corner is at (0, 0), not (1, 1). Take a look at the following image, which indexes three individual pixels. As you can see, the upper left corner of the image is the coordinates of the origin. Moreover, y coordinates get larger as they go down:
![](https://static.packt-cdn.com/products/9781789344912/graphics/assets/d3c85bc1-1983-4dee-9c18-613cd70729eb.png)
The information for an individual pixel can be extracted from an image in the same way as an individual element of an array is referenced in Python. In the...