• 大小: 76KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-05-12
  • 语言: 其他
  • 标签: 数字水印  

资源简介

经典教程《Digital Watermarking and Steganography》的配套源码,对数字水印方向的学者来说绝对是个很好的学习资料,其中所包含的水印技术都是通用算法,适合图像,语音和视频等通用方向。电子版书籍见我的其他资源

资源截图

代码片段和文件信息

/*-------------------------------------------------------------------
E_BLIND -- embed a watermark by simply adding a message pattern

Arguments:
c -- image to be watermarked(changed in place)
width -- width of image
height -- height of image
m -- one-bit message to embed
alpha -- embedding strength
wr -- refrence pattern(width*height array of doubles)

Return value:
none
--------------------------------------------------------------------*/

void E_BLIND( unsigned char *c int width int height
  int m double alpha double *wr )
{
static double wm[ MAX_IMG_SIZE ];  /*pattern that encodes m*/

/*Encode the massage in a pattern*/
ModulateOneBit( m wr wm width heigth );

/*Scale and add pattern to image(with clipping and rounding)*/
AddScaledPattern( c width height alpha wm );
}

/*-------------------------------------------------------------------
D_LC -- detect watermarks using linear correlation
  
Arguments:
c -- image
width -- width of img
height -- height of img
tlc -- detection threshold
wr -- reference pattern(width by height array of doubles)

Return value:
decoded message(0 or 1) or NO_WMK if no watermark is found
--------------------------------------------------------------------*/

int D_LC( unsigned char *c int width int height
  double tlc double *wr )
{
double lc;  /*linear correlation*/
int m;      /*decoded message(or NO_WMK)

/*Find the linear correlation between the image and the reference pattern */
lc = ImgPatInnerProduct( c wr width height ) / ( width * height );

/*Decode the massage*/
if( lc > tlc )
m = 1;
else if(lc < -tlc)
m = 0;
else
m = NO_WMK;;

return m;
}

/*-------------------------------------------------------------------------
ModulateOneBit -- encode a 1-bit message by either copying or negating
  a given reference pattern
Arguments:
m -- message to be encoded
wr -- reference pattern
wm -- where to store resulting message pattern
width -- width of wm
height -- height of wm

Return value:
none
--------------------------------------------------------------------------*/
void ModulateOneBit( int m double *wr double *wm
 int width int height )
{
int i; /*index into patterns*/

if( m == 0 )
for( i = 0; i < width * height; i = i + 1 )
wm[ i ] = -wr[ i ];
else
for( i = 0; i < width * height; i = i + 1)
wm[ i ] = wr[ i ];
}

/*----------------------------------------------------------------------------
AddScaledPattern -- scale and add a pattern to an image with clipping
and rounding

This multiplies w by alpha to obtain the added pattern and adds it to the
image clipping and rounding each pixel to an 8-bit integer.

Arguments:
c -- imge to which to add pattern(changed in place)
width -- width of image
height -- height of image
alpha -- scaling factor_
w -- pattern to scace a

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       4588  2017-05-05 20:05  数字水印书本源码(Source code for digital watermarking book)\C1 E_BLIND & D_LC.c

     文件      12980  2017-05-05 10:33  数字水印书本源码(Source code for digital watermarking book)\C10 E_LATTICE & D_LATTICE.c

     文件       5918  2017-05-03 22:34  数字水印书本源码(Source code for digital watermarking book)\C11 E_BLIND_D_WHITE.cpp

     文件       1943  2017-05-03 22:21  数字水印书本源码(Source code for digital watermarking book)\C12 E_BLK_BLIND_D_WHITE_BLK_CC.cpp

     文件      15262  2017-05-05 17:08  数字水印书本源码(Source code for digital watermarking book)\C13 E_PERC_GSGALE_D_LC.cpp

     文件       5035  2017-05-05 17:08  数字水印书本源码(Source code for digital watermarking book)\C14 E_PERC_SHAPE_LC.cpp

     文件       2532  2017-05-05 17:07  数字水印书本源码(Source code for digital watermarking book)\C15 E_PERC_OPT_D_LC.cpp

     文件        937  2017-05-07 11:21  数字水印书本源码(Source code for digital watermarking book)\C16 E_MOD & D_LC.cpp

     文件      18780  2017-05-07 11:29  数字水印书本源码(Source code for digital watermarking book)\C17 E_DCTQ & D_DCTQ.cpp

     文件       7069  2017-05-07 11:31  数字水印书本源码(Source code for digital watermarking book)\C18 E_SFSIG & D_SFSIG.cpp

     文件       4456  2017-05-07 11:31  数字水印书本源码(Source code for digital watermarking book)\C19 E_PXL & D_PXL.cpp

     文件       2372  2017-05-07 15:06  数字水印书本源码(Source code for digital watermarking book)\C2 E_FIXED_LC &  D_LC.c

     文件      13110  2017-05-05 20:11  数字水印书本源码(Source code for digital watermarking book)\C3 E_BLK_BLIND & D_BLK_CC.c

     文件       7498  2017-05-05 20:11  数字水印书本源码(Source code for digital watermarking book)\C4 E_SIMPLE_8 & D_SIMPLE_8.c

     文件       8301  2017-05-05 20:11  数字水印书本源码(Source code for digital watermarking book)\C5 E_TRELLIS_8 & D_TRELLIS_8.c

     文件       2416  2017-05-03 20:18  数字水印书本源码(Source code for digital watermarking book)\C6 E_BLK_8 & D_BLK_8.c

     文件       5255  2017-05-04 20:34  数字水印书本源码(Source code for digital watermarking book)\C7 E_BLK_FIXED_CC & D_BLK_CC.c

     文件       4759  2017-05-03 21:50  数字水印书本源码(Source code for digital watermarking book)\C8 E_BLK_FIXED_R & D_BLK_CC.c

     文件       5501  2017-05-04 20:40  数字水印书本源码(Source code for digital watermarking book)\C9 E_DIRTY_PAPER & D_DIRTY_PAPER.c

     文件      38064  2018-04-19 21:32  数字水印书本源码(Source code for digital watermarking book)\数字水印书本源码(Source code for digital watermarking book).rar

     目录          0  2018-04-22 18:20  数字水印书本源码(Source code for digital watermarking book)

----------- ---------  ---------- -----  ----

               166776                    21


评论

共有 条评论