官术网_书友最值得收藏!

  • Mastering OpenCV 4 with Python
  • Alberto Fernández Villán
  • 181字
  • 2021-07-02 12:07:13

The coordinate system in OpenCV

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:

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:

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:

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 next section, we are going to see how we can do this.

主站蜘蛛池模板: 马边| 永年县| 肇州县| 航空| 蛟河市| 荣成市| 霞浦县| 成安县| 三都| 建始县| 新密市| 北海市| 鹤山市| 横峰县| 盱眙县| 饶阳县| 法库县| 南投县| 海淀区| 太保市| 开鲁县| 东宁县| 志丹县| 宜丰县| 岐山县| 淮滨县| 洛南县| 南昌县| 页游| 抚顺市| 雅安市| 云安县| 鄂伦春自治旗| 宁强县| 旬邑县| 确山县| 遂宁市| 弋阳县| 明水县| 连云港市| 瓦房店市|