資源簡介
阿里巴巴泄露門使用的傅里葉變換隱藏水印(含源碼)
相對(duì)于空域方法,頻域加盲水印的方法隱匿性更強(qiáng),抵抗攻擊能力更強(qiáng)。這類算法解水印困難,你不知道水印加在那個(gè)頻段,而且受到攻擊往往會(huì)破壞圖像原本內(nèi)容。本文簡要科普通過頻域手段添加數(shù)字盲水印。對(duì)于web,可以添加一個(gè)背景圖片,來追蹤截圖者。所謂盲水印,是指人感知不到的水印,包括看不到或聽不見(沒錯(cuò),數(shù)字盲水印也能夠用于音頻)。其主要應(yīng)用于音像作品、數(shù)字圖書等,目的是,在不破壞原始作品的情況下,實(shí)現(xiàn)版權(quán)的防護(hù)與追蹤。添加數(shù)字盲水印的方法簡單可分為空域方法和頻域方法,這兩種方法添加了冗余信息,但在編碼和壓縮情況不變的情況下,不會(huì)使原始圖像大小產(chǎn)生變化(原來是10MB添加盲水印之后還是10MB)。
代碼片段和文件信息
#include?“fft2.h“
FFT2::FFT2(QWidget?*parent?Qt::WFlags?flags)
:?QMainWindow(parent?flags)
{
ui.setupUi(this);
connect(ui.actionOpenSIGNAL(triggered())thisSLOT(SLOT_LoadPixmap()));
}
FFT2::~FFT2()
{
}
bool?isPow2(int?x)
{
return?!(x&(x-1));
}
void?FFT2::SLOT_LoadPixmap()
{
QString?filename?=?QFileDialog::getOpenFileName(
this
“Image“
QDir::currentPath()
“Image?file?(*.*)“);
if?(!filename.isNull())?
{?
if(!m_Resmap.load(filename))
{
QMessageBox::information(this“Error““Could?not?load?target?file“QMessageBox::Ok);
return;
}
m_Resmap=m_Resmap.scaled(256256);
SortImage();
}?
}
void?FFT2::SortImage()
{
complex?*pcplx;
int?*powerMax;float?*Amp;
int?wh;
QImage?imagetRImagetGImagetBImagefRImagefGImagefBImageRImageGImageBImage;
QColor?rgb;
image=m_Resmap.toImage();
RImage=QImage(m_Resmap.width()m_Resmap.height()QImage::Format_ARGB32);
GImage=RImage;
BImage=RImage;
fRImage=RImage;
fGImage=RImage;
fBImage=RImage;
for?(int?y=0;y {
for?(int?x=0;x {
rgb=image.pixel(xy);
RImage.setPixel(QPoint(xy)QColor(rgb.red()00).rgba());
GImage.setPixel(QPoint(xy)QColor(0rgb.green()0).rgba());
BImage.setPixel(QPoint(xy)QColor(00rgb.blue()).rgba());
}
}
tRImage=RImage;
tGImage=GImage;
tBImage=BImage;
power=(int?*)malloc(sizeof(int)*m_Resmap.height()*m_Resmap.width());
Amp=(float?*)malloc(sizeof(float)*m_Resmap.height()*m_Resmap.width());
pcplx=(complex?*)malloc(sizeof(complex)*m_Resmap.height()*m_Resmap.width());
//Sort?R
//////////////////////////////////////////////////////////////////////////
Max=0;
h=m_Resmap.height();
w=m_Resmap.width();
for?(int?y=0;y {
for?(int?x=0;x {
rgb=image.pixel(xy);
pcplx[y*h+x].im=0;
pcplx[y*h+x].re=rgb.red();
}
}
FFT_2(pcplxpcplxh);
FFT_2_Shift(pcplxpcplxh);
for?(int?y=0;y {
for?(int?x=0;x {
power[y*h+x]=sqrt(pcplx[y*h+x].im*pcplx[y*h+x].im+pcplx[y*h+x].re+pcplx[y*h+x].re);
Amp[y*h+x]=atan(pcplx[y*h+x].im/pcplx[y*h+x].re);
//power[y*h+x]=log(long?double(1+3*power[y*h+x]));
if?(power[y*h+x]>Max)
{
Max=power[y*h+x];
}
}
}
for?(int?y=0;y {
for?(int?x=0;x {
fRImage.setPixel(xyQColor(power[y*h+x]*255/Maxpower[y*h+x]*255/Maxpower[y*h+x]*255/Max).rgba());
RImage.setPixel(xyQColor((Amp[y*h+x]+1.571)*255/3.1416(Amp[y*h+x]+1.58)*255/3.1416(Amp[y*h+x]+1.58)*255/3.1416).rgba());
}
}
//Sort?G
//////////////////////////////////////////////////////////////////////////
Max=0;
h=m_Resmap.height();
w=m_Resmap.width();
for?(int?y=0;y {
for?(int?x=0;x {
rgb=image.pixel(xy);
pcplx[y*h+x].im=0;
pcplx[y*h+x].re=rgb.green();
}
}
FFT_2(pcplxpcplxh);
FFT_2_Shift(pcplxpcplxh);
for?(int?y=0;y {
for?(i
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-06-07?10:43??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\
?????目錄???????????0??2017-05-26?15:18??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\
?????目錄???????????0??2017-05-26?15:18??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\
?????文件??????????36??2017-05-24?17:22??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2.opensdf
?????文件?????????879??2017-05-22?15:13??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2.sln
?????文件???????22528??2017-05-25?12:27??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2.suo
?????文件????????6781??2017-05-26?15:05??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\fft2.cpp
?????文件?????????448??2017-05-25?11:45??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\fft2.h
?????文件??????????64??2017-05-22?15:13??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\fft2.qrc
?????文件???????11360??2017-05-25?11:01??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\fft2.ui
?????文件???????10658??2017-05-22?17:20??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\FFT2.vcxproj
?????文件????????2835??2017-05-22?17:20??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\FFT2.vcxproj.filters
?????文件?????????575??2017-05-22?17:12??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\FFT2.vcxproj.user
?????目錄???????????0??2017-05-26?15:18??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\GeneratedFiles\
?????目錄???????????0??2017-05-26?15:18??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\GeneratedFiles\Debug\
?????文件????????2758??2017-05-25?11:45??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\GeneratedFiles\Debug\moc_fft2.cpp
?????文件?????????668??2017-05-22?17:12??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\GeneratedFiles\qrc_fft2.cpp
?????目錄???????????0??2017-05-22?15:13??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\GeneratedFiles\Release\
?????文件???????13991??2017-05-25?11:04??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\GeneratedFiles\ui_fft2.h
?????文件?????????163??2017-05-22?15:13??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\main.cpp
?????文件????????5362??2017-05-25?11:48??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\Pt_FFT.cpp
?????文件?????????532??2017-05-25?09:10??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\Pt_FFT.h
?????目錄???????????0??2017-05-22?15:13??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\FFT2\Resources\
?????目錄???????????0??2017-05-26?15:18??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\Win32\
?????目錄???????????0??2017-05-26?15:18??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\Win32\Debug\
?????文件??????102400??2017-05-26?15:05??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\FFT2?-附件3?二維傅里葉變換\Win32\Debug\FFT2.exe
?????目錄???????????0??2017-06-07?09:17??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\ImageSigner?-?附件5?Release?版本的ImageSigner\
?????目錄???????????0??2017-06-07?09:17??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\ImageSigner?-?附件5?Release?版本的ImageSigner\ImageSigner\
?????文件??????????36??2017-06-07?09:08??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\ImageSigner?-?附件5?Release?版本的ImageSigner\ImageSigner.opensdf
?????文件?????????900??2017-06-02?11:31??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\ImageSigner?-?附件5?Release?版本的ImageSigner\ImageSigner.sln
?????文件???????24064??2017-06-07?00:27??三角函數(shù)到傅里葉變換再到語音識(shí)別與數(shù)字水印\ImageSigner?-?附件5?Release?版本的ImageSigner\ImageSigner.suo
............此處省略161個(gè)文件信息
評(píng)論
共有 條評(píng)論