-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathders3.py
More file actions
144 lines (78 loc) · 2.08 KB
/
ders3.py
File metadata and controls
144 lines (78 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# coding: utf-8
# In[1]:
#adres http://matplotlib.org/users/image_tutorial.html
#Bu adrestende örnekleri inceleyebilirsiniz
# In[2]:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
#degisken img(min,max)
#inverce alacagiz
# In[3]:
img=mpimg.imread(r'C:\Users\Asus\Desktop\stinkbug.png')
# In[4]:
img.ndim
# In[5]:
img.shape
# In[6]:
plt.imshow(img)
plt.show()#yüzde 50 kırpılmış halidir
# In[7]:
img[:,100,:].max()#1.kolondaki butun renlerin max i
# In[8]:
img_1=img[1:375:2,:,:]#butun rgb yi al 2 ser artarak
# In[9]:
img_1=img[:,1:500:2,:]
# In[10]:
plt.subplot(1,2,1),plt.imshow(img)
plt.subplot(1,2,2),plt.imshow(img_1)
#plt.imshow(img_1)
plt.show()
# In[11]:
img.ndim,img.shape
# In[12]:
img_20=np.zeros((500,375,3))# boyutlarında img_20 adında matris oluşturur. Matris boyutları transpozesinde simetrik olacak
img_20.shape
# In[13]:
#3 tane rgb var her hucreye erismek icin o anki pixelin butun renklerini aldim
#for i in range(375):
#for j in range(500):
#img_20[j,i,:]=img(i,j,:)#img isimli 3 boyutlu kubun transpozu
#print(img[i,j,:])for i in range(375):
# In[14]:
for i in range(375):
for j in range(500):
img_20[j,i,:]=img[i,j,:]
# In[15]:
plt.subplot(1,2,1),plt.imshow(img)
plt.subplot(1,2,2),plt.imshow(img_20)
#plt.imshow(img_1)
plt.show()
# In[16]:
img_30=np.zeros((500,375,3))
img_30.shape
for i in range(375):
for j in range(500):
img_30[j,i,:]=1-img[i,j,:]#img isimli 3 boyutlu kubun transpozu
#img[i,j,:]
img_40=np.zeros((375,500,3))
img_40.shape
for i in range(375):
for j in range(500):
img_40[375-i-1,500-j-1,:]=1-img[i,j,:]
img_50=np.zeros((375,500,3))
img_50.shape
for i in range(375):
for j in range(500):
img_50[375-i-1,j,:]=1-img[i,j,:]
plt.subplot(2,3,1),plt.imshow(img)
plt.subplot(2,3,2),plt.imshow(img_20)
plt.subplot(2,3,3),plt.imshow(img_30)
plt.subplot(2,3,4),plt.imshow(img_30)
plt.subplot(2,3,5),plt.imshow(img_40)
plt.subplot(2,3,5),plt.imshow(img_50)
plt.show()
# In[ ]:
# In[ ]:
# In[ ]:
# In[ ]: