Professional Documents
Culture Documents
1
1.1 .........................................................................1
1.2 ...............................................................1
2............................................................................2
2.1 Visual C++ ........................................................................2
2.2 .....................................................................................2
3............................................................3
3.1 .....................................................................3
3.2 ...............................................................4
4. LSB ....................................................................................5
5. LSB BMP ...............................................6
5.1 .....................................................................6
5.2 .........................................................................6
5.3 .....................................................................................7
5.4 .....................................................................................7
5.4.1 ............................................................................7
5.4.2 ...............................................................................8
5.5 ...................................................................................13
5.5.1 .............................................................................13
5.5.2 .............................................................................13
6................................................................................................14
..................................................................................................14
............................................................................................15
0
1.
1.1
,
93
,.
1.2
1994
IEEE ICIPIEEE ICASSPACM
Multimedia Proceedings of IEEE Signal
Processing IEEE Journal of Selected Areas on
CommunicationCommunications of ACM
NTT
Vigo IBM
Watson CASony
NEC
,
1
2.
(Visual)
Visual C++
Visual C++ Windows
2.2
MFC MFC Visual C++
Windows C++ Windows API
Windows MFC
Wizard,Visual C++ MFC
SDIMDI
Class Wizard
Windows Class Wizard
3.
3.1
(1)
LSB L.F.Turner R.G.van Schyndel
LSB
LSB
LSB
(2)
DFT
FFTDCTDWT
(3)
JPEGMPEG
VOD(Video Oil Demand)
Hartung MPEG-2
Hartung MPEG-2
DCT Huffman
DCT
DCT Huffman
Huffman n1 n0 , n1
n0 , ,
(4)NEC
NECCox
N(0,1)
DCT ()1000
DCT
N(0,1)
(5)
HVS HAS
JND
3.2
3
x
x
G w E w A
m
x
K1 K2 / /
D
/ /
K3 K4
3-1
3-1
GmxK1
w
xwK2E
xw
E
F(x)F(xw)=F(x)w.
,,
, ,
x , K3
xw x
K3 x
4. LSB
LSB
4
8
RGB 24 RGB 8
0 1
8 g
7
g bi 2i
i 0
i
bi i bi{01}
8 LSB 0
MSB
0 7
LSB
LSB
LSB
()
LSB
ASCII 8 8
8 N
N/8 24 RGB
,
5. LSB BMP
5.1
,, LSB ,
LSB 4
5.2
bmp
bmp
24 bmp
5.3
5-1
: bmp , CFileDialog
LSB
LSB
(1)24bmp,
(2):,,
(3),
(4):
.
6
LSB
BMP
5-1
5.4
5.4.1
24 , ,
, ,
,LSB
5-2
7
24
Y N
bmp
5-2
5.4.2
MFC
.dsw, Resourceview Menu
Toolbar 5-3
5-3
1 BMP
24 bmp
CDialog CFileDialog
TRUE FALSE
CDib Load()
bmp
static char szFilter[] = "BMP Files(*.BMP)|*.BMP||";
CFileDialog FileDlg( TRUE, NULL, NULL, OFN_HIDEREADONLY,
szFilter );// bmp
2
8
.bmp
.bmp, 5-4 5-5
5-6
CDib Watermarkingin()
LSB
CDib DrawContrast()
5-7
9
5-7
void CDib::Watermarkingin()//
{
unsigned char bmpdata;//
unsigned char efdata;//
int t = 7;
int x[8];
int s[8];
int last_bit; // bit
for(UINT i1 = 0, i2 = 0; i1 <= bitmap_size - 1, i2 <=
embfile_size - 1; i1++)
{//
bmpdata = *p;//bmpdat *p
for (int j = 0; j <= 7; j++)
{// bit
x[j] = bmpdata & 1;
bmpdata >>= 1;
}
last_bit = x[0];
x[0] = x[1] ^ x[2] ^ x[3] ^ x[4] ^ x[5] ^ x[6] ^ x[7];
if (t == 7)
{// s[]
efdata = *q;
for (j = 0; j <= 7; j++)
{
s[j] = efdata & 1;
efdata >>= 1;
}
}
x[0] ^= s[t];// ,
if (last_bit == 0) //
{
*p |= x[0];
}
else
{
*p &= 254 + x[0];
}
p++;//
t--;
10
if (t == -1) // 8 , s[]
{
t = 7;
q++;
i2++;
}
}
}
3
.bmp
5-7
.bmp CDib Watermarkingout()
RGB
8
4
7
g b 2i
i 0
i
CDib SavePicked()
5-8
void CDib::Watermarkingout()//
{
for (UINT i1 = 0, i2 = 0; i1 <= bitmap_size - 1, i2 <=
embfile_size - 1; i1++)
{
bmpdata = *p;
for (int j = 0; j <= 7; j++) // bit
{
x[j] = bmpdata & 1;
bmpdata >>= 1;
}
s[t] = x[0] ^ x[1] ^ x[2] ^ x[3] ^ x[4] ^ x[5] ^ x[6] ^
11
x[7];
t--;
if (t == -1) //s[7] s[0]
{
*q = s[7] * 128 + s[6] * 64 + s[5] * 32 + s[4] * 16 +
s[3] * 8 + s[2] * 4 + s[1] * 2 + s[0];
t = 7;
i2++;
q++;
}
p++;}
.bmp
.bmp.bmp .bmp
5.5
5.5.1
5.5.2
5.4.2
24 bmp
24 bmp ASCII 8
8 8
N N/8,
5-5
12
5-9
6.
(
)
LSB , LSB
LSB
LSB
,
,
,
,,
,
13
[1] ,,. .[M] :,2004.
[2] ,,. --.[M] :
,2006.
[3] ,,. .[M] :,2006.
[4] . .[M] :,2005.
[5] . Visual C++.[M] :
,2004.
[6] ,,. . [M]:
,2006.
[7] . . [M]:,2005.
[8] . . [M]2005.
[9] . .[M]
2004.
[10] . Visual C++ 6.0. [M]2005.
[11] . Visual C++.[M] 2000.
[12] . .[M] 2003.
14