test_steganal.py
1.1 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
__author__ = 'chunk'
import numpy as np
from mjpeg import *
from msteg.steganography import LSB, F3, F4, F5
from msteg.steganalysis import MPB
from common import *
timer = Timer()
sample = [[7, 12, 14, -12, 1, 0, -1, 0],
[6, 5, -10, 0, 6, 0, 0, 0],
[0, 6, -5, 4, 0, -1, 0, 0],
[0, -3, 0, 1, -1, 0, 0, 0],
[-3, 5, 0, 0, 0, 0, 0, 0],
[2, -1, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0]]
sample_key = [46812L, 20559L, 31360L, 16681L, 27536L, 39553L, 5427L, 63029L, 56572L, 36476L, 25695L, 61908L, 63014L,
5908L, 59816L, 56765L]
txtsample = [116, 104, 105, 115, 32, 105, 115, 32, 116, 111, 32, 98, 101, 32, 101, 109, 98, 101, 100, 101, 100, 46, 10]
if __name__ == '__main__':
timer = Timer()
timer.mark()
ima = Jpeg("res/test3.jpg", key=sample_key)
timer.report() # 0.006490s
ciq = ima.coef_arrays[colorMap['Y']]
timer.report() # 0.000019s
mpbSteg = MPB.MPB()
tpm = mpbSteg._get_trans_prob_mat_orig(ciq)
timer.report() # 1.365718s
print tpm, tpm.shape
pass