0 like 0 dislike
1 view
in Python by anonymous Bilge (165k points)
matrix işlemleri

2 Answers

0 like 0 dislike
by anonymous Bilge (165k points)
python matrix value
import numpy as np
import matplotlib.pyplot as plt

fig, ax = plt.subplots()

min_val, max_val = 0, 15

intersection_matrix = np.random.randint(0, 10, size=(max_val, max_val))

ax.matshow(intersection_matrix, cmap=plt.cm.Blues)

for i in range(15):
for j in range(15):
c = intersection_matrix[j,i]
ax.text(i, j, str(c), va='center', ha='center')

plt.show(ax)
0 like 0 dislike
by anonymous Bilge (165k points)
import cv2
import numpy as np
matrix = cv2.imread("my.png", 0) # Görüntüden bir kanal seçiyoruz.

print(matrix)
print(np.shape(matrix)) # row,col ex.(534, 300)
print(matrix.shape)     # row,col matrix boyutları
print(len(matrix))      # matrix satır sayısı
print(len(matrix[0]))   # matrix sutun sayısı (1. row'un boyutu)
...