Untitled2.ipynb - Colaboratory
Untitled2.ipynb - Colaboratory
ipynb - Colaboratory
1 import cv2
2 import urllib.request
3 from google.colab.patches import cv2_imshow # for image display
4 import matplotlib.pyplot as plt
5 import numpy as np
6 hola = np.array([[1.5, 0.5, 0],[0, 1, 0],[0, 0, 1]])
7
8 x = np.array([[0,50,50,0,0],[0,0,50,50,0],[1,1,1,1,1]])
9
10 print(x)
11
12 xp= hola @ x
13
14 print(xp)
15 plt.imshow(np.ones([100,100])*255, clim=(0.0,1.0), cmap="gray")
16 plt.plot(xp[0,:], xp[1,:], "r")
17 plt.plot(xp[0,:], xp[1,:], "*b")
18 plt.show()
[[ 0 50 50 0 0]
[ 0 0 50 50 0]
[ 1 1 1 1 1]]
[ 1. 1. 1. 1. 1.]]
https://colab.research.google.com/drive/1JyXDtjknYMXnx1qSog4R6KLW1a0BaQWr#scrollTo=wpk9dIAQ27TM&printMode=true 1/3
9/9/21 14:01 Untitled2.ipynb - Colaboratory
https://colab.research.google.com/drive/1JyXDtjknYMXnx1qSog4R6KLW1a0BaQWr#scrollTo=wpk9dIAQ27TM&printMode=true 2/3
9/9/21 14:01 Untitled2.ipynb - Colaboratory
https://colab.research.google.com/drive/1JyXDtjknYMXnx1qSog4R6KLW1a0BaQWr#scrollTo=wpk9dIAQ27TM&printMode=true 3/3