From the course: OpenCV for Python Developers

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Access and understand pixel data

Access and understand pixel data

From the course: OpenCV for Python Developers

Access and understand pixel data

- [Instructor] Sometimes it can be difficult to visualize data structures, but it is particularly important for computer vision applications to stay aware of what data you are accessing and keeping track of the data types. To get started, note that I've already changed my directory into the chapter two, module two begin folder, and additionally, we still have our opencv-logo png. Opening my Python3 environment, I'm going to import our NumPy library as well as our cv2 library. Next, I'm going to read back in our logo using cv2.imread, then opencv-logo.png, and this time I'm going to pass in a value of one. You could also pass in the value cv2.imread_color. This is telling opencv to try and load the image as a full color image. If we were to pass in a value of zero, we would actually read in the image as black and white. Now that we have loaded in our image, let's actually take a look at the data it contains. Simply…

Contents