Another approach to MapView lifecycle delegation

MapView needs lifecycle delegation in order to work so this is just an another approach to this problem

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Computer vision for kids

What is computer vision?

Computer vision is an interdisciplinary scientific field that deals with how computers can be made to gain a high-level understanding of digital images or videos.

Can computers really see images in your hard drive? No. Computers are actually unable to recognize or look at pictures the manner in which we people would. In this way, we would need to figure out how to change over these pictures into numbers.

So a colored image is made out of a 3-dimensional matrix of 3 colors; Red, Green, and Blue. For a grayscale or a black and white image there is only one channel.

OpenCV (Open Source Computer Vision Library) is an open-source computer vision and machine learning software library. It mainly focuses on image processing, video capture, and analysis including features like face detection and object detection. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in commercial products. Being a BSD-licensed product, OpenCV makes it easy for businesses to utilize and modify the code.

We can use cv2.imread function to do this. First, make a variable and use the function to read the image using its path as the first parameter.

In here the ‘1’ and ‘0’ represent the type of the image. If we put ‘1’ then it will be read in RGB (Coloured) or if we put ‘0’ then it will be read as grayscale or black and white image. OpenCV will read the read as a numpy array or in English a matrix of numbers. So if the image is colored it will be a 3d matrix or if it is a grayscale one it will be a 2d matrix.

If you print the img variable you will be able to see the image is now converted to a matrix! And if you print the shape of the image you can see the Numpy array with the number of rows and columns.

We can use cv2.imshow function to display the image you just read.

Here the first parameter is the name of the window and the second one is the object we read before. When we are using the imshow function we have to use waitkey in order to wait until a user presses a key, unless the window gets closed as soon as it opens.

If you want to resize the image you read you can simply use cv2.resize function.

The first parameter is the object we read and the second one is the size we want it to be resized. You can also use the original image properties for the parameters as well. Here is how you can do it.

So here you go with the super basic functionalities of computer vision using OpenCV. Let’s meet again to continue with the session later! Godspeed.

Add a comment

Related posts:

Stanford Medicine magazine delves into the joy and power in discovery

When Brianna Rivera was a junior in high school, she believed she couldn’t fit into an advanced high school biology class. That changed when she joined a Stanford science program at San Jose’s Andrew…

Karlsruhe schickt einen klaren Appell an uns alle

Gerade hat das Bundesverfassungsgericht die Sanktionen in der Hartz-IV-Gesetzgebung teilweise für verfassungswidrig erklärt. Das Gericht verweist in seinem Urteil dabei auf einen zentralen Punkt, der…

Mastering Unsupervised

The new Tabular Playground Series for July 2022 on Kaggle is estimating a y_label for a 98000 x 29 sized X feature matrix. At first glance, I thought kmeans can solve this problem, because in my…