yaj.py
406 Bytes
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
__author__ = 'chunk'
# import mjsteg
import numpy as np
# a = mjsteg.Jsteg("res/test2.jpg")
# compY,compCr,compCb = a.coef_arrays
#
# res = np.array([np.split(arr,arr.shape[1]/8, axis=1) for arr in np.split(compY,compY.shape[0]/8)])
#
# print res.shape
#
# print res[0,0:20]
import jpegObj
b = jpegObj.Jpeg("res/test2.jpg")
c = b.getCoefBlocks(channel='Y')
print c
print c.shape