0% found this document useful (0 votes)
220 views

Untitled2.ipynb - Colaboratory

The document imports libraries for computer vision, image display, and linear algebra. It defines two numpy arrays, hola and x, and performs a matrix multiplication of hola and x, storing the result in xp. It then prints xp and creates a plot with xp values to display an image.

Uploaded by

Ana Velez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
220 views

Untitled2.ipynb - Colaboratory

The document imports libraries for computer vision, image display, and linear algebra. It defines two numpy arrays, hola and x, and performs a matrix multiplication of hola and x, storing the result in xp. It then prints xp and creates a plot with xp values to display an image.

Uploaded by

Ana Velez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

9/9/21 14:01 Untitled2.

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]]

[[ 0. 75. 100. 25. 0.]

[ 0. 0. 50. 50. 0.]

[ 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

check 0 s se ejecutó 13:57

https://colab.research.google.com/drive/1JyXDtjknYMXnx1qSog4R6KLW1a0BaQWr#scrollTo=wpk9dIAQ27TM&printMode=true 3/3

You might also like