From the course: Computer Vision on the Raspberry Pi 4
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Running a simple image processing example
From the course: Computer Vision on the Raspberry Pi 4
Running a simple image processing example
- [Instructor] To see how OpenCV and NumPy process images. It helps to work through a simple example. This video shows how to read an image from a file, modify its content and save it to another file. To be specific, I'm going to perform five operations. I'll start by removing the blue content from the image and making its first 10 rows gray. Then I'll center it by subtracting it's mean and standardize it by dividing it by its standard deviation. To start, I'll create an image named image array. I'll read the image data by calling CV2.imread. This accepts a file name, which I'll set to car.jpg and an image type, which all set to CV2.imread_color. You can think of image array as a set of two dimensional arrays, one for blue, one for green, and one for red. To remove the blue content from the image, the third array must be set to zero and the pixels must be set to zero. The first dimension of the array corresponds to the…