Blame view

test_steganal.py 1.1 KB
26e2fe9f   Chunk   MPB steganalysis ...
1
2
3
__author__ = 'chunk'

import numpy as np
c6c61f81   Chunk   staged.
4
from mjpeg import *
04cd1acf   Chunk   before 开题答辩~~~
5
6
from msteg.steganography import LSB, F3, F4, F5
from msteg.steganalysis import MPB
26e2fe9f   Chunk   MPB steganalysis ...
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

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()
b69b6985   Chunk   py module refract...
31
    ima = Jpeg("res/test3.jpg", key=sample_key)
04cd1acf   Chunk   before 开题答辩~~~
32
    timer.report()  # 0.006490s
26e2fe9f   Chunk   MPB steganalysis ...
33

b69b6985   Chunk   py module refract...
34
    ciq = ima.coef_arrays[colorMap['Y']]
04cd1acf   Chunk   before 开题答辩~~~
35
    timer.report()  # 0.000019s
26e2fe9f   Chunk   MPB steganalysis ...
36
37

    mpbSteg = MPB.MPB()
04cd1acf   Chunk   before 开题答辩~~~
38
39
    tpm = mpbSteg._get_trans_prob_mat_orig(ciq)
    timer.report()  # 1.365718s
26e2fe9f   Chunk   MPB steganalysis ...
40
41
42

    print tpm, tpm.shape
    pass