-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhistory.txt
308 lines (306 loc) · 7.15 KB
/
history.txt
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
a
a.shape
b = a.view((np.uint16, 2))
b = a.view((np.uint16, 1))
b.shape
import cv2
cv2.imwrite("test.jp2", b)
set OPENCV_IO_ENABLE_JASPER=ON
set OPENCV_IO_ENABLE_JASPER:ON
## ---(Wed Oct 16 13:59:23 2019)---
import glymur, numpy as np
pwd
cd Development/
cd bilateral-filter/
pwd
jp2 = glymur.Jp2k('zeros.jp2', data=np.zeros((640, 480), dtype=np.uint8))
jp2 = glymur.Jp2k('zeros.jp2', data=np.zeros((640, 480), dtype=np.float32))
jp2 = glymur.Jp2k('zeros.jp2', data=np.zeros((640, 480), dtype=np.uint16))
a = run_bilateral_filter('Z_l3.png', 3, 0.01, 0.5)
from bilateral_filter import run_bilateral_filter
a = run_bilateral_filter('Z_l3.png', 3, 0.01, 0.5)
b = a.view((np.uint16, 2))
b = a.view((np.uint16, 1))
b
jp2 = glymur.Jp2k('zeros.jp2', b)
b.shape
jp2 = glymur.Jp2k('zeros.jp2', b[:,:,0])
jp2 = glymur.Jp2k('zeros2.jp2', b[:,:,1])
import cv2
im = cv2.imread('Z_l0.png', cv2.IMREAD_UNCHANGED)
im
im.shape
jp2 = glymur.Jp2k('Z_l0_converted.jp2', im)
r = im[:,:,0]
im[:,:,0] = im[:,:,1]
im[:,:,1] = r
jp2 = glymur.Jp2k('Z_l0_converted.jp2', im)
from glymur.core import COLOR, OPACITY
ctype = [COLOR, COLOR, COLOR, OPACITY]
from glymur.core import RED, GREEN, BLUE, WHOLE_IMAGE
asoc = [RED, GREEN, BLUE, WHOLE_IMAGE]
cdef = glymur.jp2box.ChannelDefinitionBox(ctype, asoc)
print(cdef)
boxes = jp2.box
boxes[2].box.append(cdef)
jp2_rgba = jp2.wrap("goodstuff_rgba.jp2", boxes=boxes)
inim = cv2.imread('Z_l0.png', cv2.IMREAD_UNCHANGED)
inim = inim.view((np.uint8, 4))
inim.shape
jp2 = glymur.Jp2k('Z_l0_converted.jp2', inim)
boxes = jp2.box
boxes[2].box.append(cdef)
jp2_rgba = jp2.wrap("goodstuff_rgba.jp2", boxes=boxes)
cv2.imwrite('test.png', inim)
jp2 = glymur.Jp2k('Z_l0_converted_0.jp2', inim[:,:,0])
jp2 = glymur.Jp2k('Z_l0_converted_0.jp2', inim[:,:,1])
jp2 = glymur.Jp2k('Z_l0_converted_0.jp2', inim[:,:,0])
jp2 = glymur.Jp2k('Z_l0_converted_1.jp2', inim[:,:,1])
jp2 = glymur.Jp2k('Z_l0_converted_2.jp2', inim[:,:,2])
jp2 = glymur.Jp2k('Z_l0_converted_3.jp2', inim[:,:,3])
a = run_bilateral_filter('Z_l3.png', 3, 0.01, 1)
a = run_bilateral_filter('Z_l3.png', 3, 0.1, 1)
a = run_bilateral_filter('Z_l3.png', 3, 0.01, 1.5)
a = run_bilateral_filter('Z_l3.png', 3, 0.001, 2)
a = run_bilateral_filter('Z_l3.png', 3, 2, 2)
a = run_bilateral_filter('Z_l0_crop.png', 3, 0.1, 2)
inim = cv2.imread('Z_l0_crop.png', cv2.IMREAD_UNCHANGED)
inim.shape
inim
f = inim.view((np.float32,1))
f
inim
a = cv2.imwread('Z_L0.png', cv2.IMREAD_UNCHANGED)
a = cv2.imread('Z_L0.png', cv2.IMREAD_UNCHANGED)
a
a.shape
b = a[1:200,1:200,:]
b
cv2.imwrite('Z_l0_crop.png', b)
b = a[1:500,1:500,:]
cv2.imwrite('Z_l0_crop.png', b)
a = run_bilateral_filter('Z_l0_crop.png', 3, 0.1, 2)
blur = cv2.blur(b,(5,5))
cv2.imwrite('Z_l0_crop_blur5.png', blur)
blur = cv2.blur(b,(3,3))
cv2.imwrite('Z_l0_crop_blur5.png', blur)
cv2.imwrite('Z_l0_crop_blur3.png', blur)
blur = cv2.blur(b,(5,5))
cv2.imwrite('Z_l0_crop_blur5.png', blur)
gblur = cv2.GaussianBlur(b,(5,5),0)
cv2.imwrite('Z_l0_crop_gblur5.png', gblur)
gblur = cv2.GaussianBlur(b,(3,3),0)
cv2.imwrite('Z_l0_crop_gblur3.png', gblur)
cv2.imwrite('Z_l0_crop_blur3.png', blur)cd ..
cd ..
cd EclConverter/
ConvertEclToImages.py
runfile('C:/Users/sicatrb/Development/EclConverter/ConvertEclToImages.py', wdir='C:/Users/sicatrb/Development/EclConverter')
pwd
runfile('C:/Users/sicatrb/Development/EclConverter/ConvertEclToImages.py', wdir='C:/Users/sicatrb/Development/EclConverter')
## ---(Wed Oct 16 15:33:28 2019)---
runfile('C:/Users/sicatrb/Development/EclConverter/ConvertEclToImages.py', wdir='C:/Users/sicatrb/Development/EclConverter')
runfile('C:/Users/sicatrb/Development/EclConverter/ConvertEclToImages.py', wdir='C:/Users/sicatrb/Development/EclConverter')
runfile('C:/Users/sicatrb/Development/EclConverter/ConvertEclToImages2.py', wdir='C:/Users/sicatrb/Development/EclConverter')
from ecl import EclGrid
from ecl.grid import EclGrid
pwd
cd ..
cd bilateral-filter/
import cv2
im = cv2.imread('Z_l0_crop.png', cv2.IMREAD_UNCHANGED)
im
imf = im.view((np.float32, 1))
import numpy as np
imf = im.view((np.float32, 1))
imf
imf = imf * 5000
imf
imf = imf + 5000
imf
imf = imf * 1000
imf
import math
imf = floor(imf)
imf = math.floor(imf)
imf = imf * 10
imf
cv2.imwrite('imf.png', imf.view((np.uint8, 4)))
imf.shape
imu = imf.view((np.uint8, 4))
imu
imu.shape
imu = imu[:,:,0,:]
cv2.imwrite('imf.png', imu)
imf
im = cv2.imread('Z_l0_crop.png', cv2.IMREAD_UNCHANGED)
imf = im.view((np.float32, 1))
imf
imf = imf + 1
imf
imf = imf * 1000000000
imf
imf = imf / 10
imf
imf = imf / 10
imf
imf = im.view((np.float32, 1))
imf
imf = imf + 1
imf = imf * 5000000
imf
imf = imf.view((np.int32, 1))
imf
imf = im.view((np.float32, 1))
imf
imf = imf * 500000
imf = imf + 500000
imf
imf.round(0)
imf
imf = imf.round(0)
imf
imf.dtype
imf = im.view((np.float32, 1))
imf.dtype
imf = imf * 50000
imf.dtype
imf = imf + 50000
imf.dtype
imf
imf = imf.round(0)
imf
cv2.imwrite('imf.png', imf)
imb = imf.view((np.uint8, 4))
imb
img.shape
imb.shape
imb = imb[:,:,0,:]
imb = imf.view((np.uint8, 4))
imb = imb[:,:,0,:]
cv2.imwrite('imf.png', imb)
imbf = imb.view((np.float32, 1))
imbf
imbf = imbf - 50000
imbf = imbf / 50000
imbf
imbfu = imbf.view((np.uint8, 4))
imbfu.shape
imbfu = imbfu[:,:,0,:]
cv2.imwrite('imbfu.png', imbfu)
imbf
imf = cv2.imread('Z_l0_crop.png', cv2.IMREAD_UNCHANGED)
imf
imf = imf.view((np.float32, 1))
imf
a = cv2.imread('Z_L3.png', cv2.IMREAD_UNCHANGED)
b = cv2.imread('filtered_Z_l3.png_d3_si2_ss2.png', cv2.IMREAD_UNCHANGED)
a
a = a.view((np.float32, 1))
b = b.view((np.float32, 1))
a
b
b = cv2.imread('filtered_Z_l3.png_d3_si0.01_ss1.png', cv2.IMREAD_UNCHANGED)
b = b.view((np.float32, 1))
b
a
a = cv2.imread('Z_L0.png', cv2.IMREAD_UNCHANGED)
b = cv2.imread('filtered_Z_l0.png_d3_si0.01_ss0.5.png', cv2.IMREAD_UNCHANGED)
b = b.view((np.float32, 1))
a = a.view((np.float32, 1))
a
b
ai = cv2.imread('Z_l0_crop.png', cv2.IMREAD_UNCHANGED)
ai = ai.view((np.float32, 1))
ai
ai = ai * 100000
ai = ai + 100000
ai
ai.round(0)
ai.dtype
ai = cv2.imread('Z_l0_crop.png', cv2.IMREAD_UNCHANGED)
ai = ai.view((np.float32, 1))
ai = ai * 1000
ai.dtype
ai = ai + 1000
ai.dtype
ai
ai.round(0)
ai
ai = ai * 1000
ai.dtpe
ai.dtype
ai
ai = ai / 1000000
ai
ai.dtype
ai = cv2.imread('Z_l0_crop.png', cv2.IMREAD_UNCHANGED)
ai = ai.view((np.float32, 1))
ai = ai * 10000
ai.dtype
ai = ai / 1000
ai = ai * 1000000
ai
ai = cv2.imread('Z_l0_crop.png', cv2.IMREAD_UNCHANGED)
ai = ai.view((np.float32, 1))
ai = ai + 1
ai = ai * 500000
ai
ai.dtype
ai = cv2.imread('Z_l0_crop.png', cv2.IMREAD_UNCHANGED)
ai = ai.view((np.float32, 1))
ab = ai + 1
ab
ab = ab * 10000
ab
ab = ab * 100
ab
ab = ab.round(0)
ab
abu = ab.view((np.uint8, 4))
abu
abu = abu[:,:,0,:]
abu
cv2.imwrite('abu.png', abu)
from bilateral_filter import run_bilateral_filter
ab
ab = ab.astype(np.int32)
ab
abu = ab.view((np.uint8, 4))
cv2.imwrite('abu.png', abu)
abu.shape
abu = abu[:,:,0,:]
cv2.imwrite('abu.png', abu)
abu
abu.shape
a = abu[:,:,0]
abu[:,:,0] = abu[:,:,3]
abu[:,:,3] = a
abu
abu[:,:,3] = a
a
abu = cv2.imread('abu.png')
abu
abu = cv2.imread('abu.png', cv2.IMREAD_UNCHANGED)
abu
abb = abu[:,:,0]
abb
abu[:,:,0] = abu[:,:,3]
abu
abu[:,:,3] = abb
abu
abu.shape
abu = cv2.imread('abu.png', cv2.IMREAD_UNCHANGED)
abb = abu[:,:,1]
abb
abu
abb = abu[:,:,0]
abb
abb.shape
ax = abb
ax
abu[:,:,3] = ax
abu
abu[:,:,0] = 0
abu
cv2.imwrite('abu.png', abu)