Ho do computers see images? – Opencv with Python
Tutorials
0
We’re going to understand today how do computers see images. I’m going to explain that using python with opencv.
Here below the python code used in the video tutorial:
import cv2
import numpy as np
# Black square
img = np.zeros((10, 10, 3), np.uint8)
img[0, 0] = (255, 0, 0) # Blue
img[0, 1] = (0, 255, 0) # Green
img[0, 2] = (0, 0, 255) # Red
img[1, 0] = (0, 150, 150) # Yellow (green + red)
img[1, 1] = (150, 0, 180) # Magenta (blue + red)
# Resizing the image x100 to see each pixel big
img = cv2.resize(img, (1000, 1000), interpolation=cv2.INTER_AREA)
# Show the image
cv2.imshow("Image", img)
cv2.waitKey(0)
Hi there, I’m the founder of Pysource.
I help Companies, Freelancers and Students to learn easily and efficiently how to apply visual recognition to their projects.
For Consulting/Contracting Services, check out this page.