91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡(jiǎn)介

本程序是用Cuda C 編寫(xiě)實(shí)現(xiàn)的圖像去噪算法,去噪思想是在空域中對(duì)圖像中的噪聲進(jìn)行自適應(yīng)去噪處理,針對(duì)的是椒鹽噪聲,先對(duì)椒鹽噪聲進(jìn)行確定,之后再處理。本程序的執(zhí)行效率非常高。最高加速比達(dá)三個(gè)數(shù)量級(jí)。

資源截圖

代碼片段和文件信息

//?CUDA?utilities?and?system?includes
#include?
//?Includes
#include?
#include?
#include?
#include?
#include?“SobelFilter_kernels.h“
//?includes?project
#include?????//?includes?cuda.h?and?cuda_runtime_api.h
#include?????//?standard?utility?and?system?includes

//函數(shù)聲明
bool?readBmp(char?*bmpName);
bool?saveBmp(char?*bmpName?unsigned?char?*imgBuf?int?width?int?height?int?biBitCount?RGBQUAD?*pColorTable);
unsigned?char?computAve(unsigned?char?*arrint?n);
unsigned?char?computMed(unsigned?char?*arrint?n);
unsigned?char?computSignalMed(unsigned?char?*arrint?n);
void?medFilter(unsigned?char?*imgBufint?width?int?heightint?biBitCount?);
void?initializeData(char?*file)?;

const?char?*sSDKsample?=?“CUDA?Adapt?Denoise?Filter!“;?

//?定義用于保存的文件名
char?*denoiseGPU=“DenoiseGPU.bmp“;
char?denoiseCPU[]=“DenoiseCPU.bmp“;

static?int?imWidth??=?0;???//?Image?width
static?int?imHeight?=?0;???//?Image?height

unsigned?char?*?pixels?=?NULL;?//?主機(jī)端的源圖像數(shù)據(jù)?
unsigned?char?*?imgDes?=?NULL;?//?CPU上處理理的結(jié)果指針
int?bmpWidth;
int?bmpHeight;
RGBQUAD?*pColorTable;
int?biBitCount;
float?imageScale?=?1.f;????????//?Image?exposure
enum?SobelDisplayMode?g_SobelDisplayMode;

int?*pArgc???=?NULL;
char?**pArgv?=?NULL;

//extern?“C“?void?runAutoTest();
void?runAutoTest();
////////////////////////////////////////////////////////////////////////////////
//?These?are?CUDA?Helper?functions
//?This?will?output?the?proper?CUDA?error?strings?in?the?event?that?a?CUDA?host?call?returns?an?error
#define?checkCudaErrors(err)???????????__checkCudaErrors?(err?__FILE__?__LINE__)

inline?void?__checkCudaErrors(?cudaError?err?const?char?*file?const?int?line?)
{
????if(?cudaSuccess?!=?err)
{
fprintf(stderr?“%s(%i)?:?CUDA?Runtime?API?error?%d:?%s.\n“
???????????????????file?line?(int)err?cudaGetErrorString(?err?)?);
exit(-1);
?????}
}

????//?This?will?output?the?proper?error?string?when?calling?cudaGetLastError
????#define?getLastCudaError(msg)??????__getLastCudaError?(msg?__FILE__?__LINE__)

????inline?void?__getLastCudaError(?const?char?*errorMessage?const?char?*file?const?int?line?)
????{
????????cudaError_t?err?=?cudaGetLastError();
????????if(?cudaSuccess?!=?err)?{
????????????fprintf(stderr?“%s(%i)?:?getLastCudaError()?CUDA?error?:?%s?:?(%d)?%s.\n“
????????????????????file?line?errorMessage?(int)err?cudaGetErrorString(?err?)?);
????????????exit(-1);
????????}
????}???
//?end?of?CUDA?Helper?Functions

void?initializeData(char?*file)
{
????size_t?file_length=?strlen(file);

if(!strcmp(&file[file_length-3]?“bmp“))
{
if(!readBmp(file))
{
printf(“Failed?to?load?BMP?image?file:?%s\n“?file);
????????????exit(-1);
}
}
else?
{
????????cudaDeviceReset();
????????exit(-1);
????}????
imWidth=(int)bmpWidth;
imHeight=(int)bmpHeight;
????setupTexture(imWidth?imHeight?pixels);//使用CUDA數(shù)組?

?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????目錄???????????0??2013-12-06?13:06??MySobelFilter\
?????目錄???????????0??2013-01-07?14:54??MySobelFilter\Debug\
?????文件???????22442??2012-11-15?13:14??MySobelFilter\Debug\BuildLog.htm
?????文件??????????37??2012-11-15?13:14??MySobelFilter\Debug\SobelFilter.device-link.options
?????文件?????????145??2012-11-15?13:14??MySobelFilter\Debug\SobelFilter.exe.intermediate.manifest
?????文件??????253569??2012-11-15?13:14??MySobelFilter\Debug\SobelFilter.obj
?????文件?????3083264??2012-11-15?13:14??MySobelFilter\Debug\SobelFilter.pdb
?????文件??????241618??2012-11-15?13:14??MySobelFilter\Debug\SobelFilter_kernels.cu.obj
?????文件??????????65??2012-11-15?13:14??MySobelFilter\Debug\mt.dep
?????文件??????722783??2012-11-15?13:14??MySobelFilter\Debug\rendercheck_gl.obj
?????文件??????683008??2012-11-15?13:14??MySobelFilter\Debug\vc80.idb
?????文件??????233472??2012-11-15?13:14??MySobelFilter\Debug\vc80.pdb
?????文件???????12171??2013-01-07?14:52??MySobelFilter\SobelFilter.cpp
?????文件????????9495??2013-01-07?14:53??MySobelFilter\SobelFilter_kernels.cu
?????文件?????????637??2013-01-02?12:50??MySobelFilter\SobelFilter_kernels.h
?????文件?????9849856??2012-11-15?13:43??MySobelFilter\SobelFilter_vs2005.ncb
?????文件???????19456??2012-11-15?13:43??MySobelFilter\SobelFilter_vs2005.suo
?????文件????????2657??2012-12-06?08:57??MySobelFilter\SobelFilter_vs2005.vcproj.HI7QXQWSECZ1E3V.Administrator.user
?????文件????31281152??2013-01-07?14:53??MySobelFilter\SobelFilter_vs2010.sdf
?????文件????????1249??2012-01-26?04:38??MySobelFilter\SobelFilter_vs2010.sln
?????文件???????33792??2013-01-07?14:53??MySobelFilter\SobelFilter_vs2010.suo
?????文件???????12644??2013-01-02?13:34??MySobelFilter\SobelFilter_vs2010.vcxproj
?????文件?????????143??2012-12-11?13:13??MySobelFilter\SobelFilter_vs2010.vcxproj.user
?????目錄???????????0??2013-01-07?14:54??MySobelFilter\Win32\
?????目錄???????????0??2013-01-07?14:54??MySobelFilter\Win32\Debug\
?????文件???????25660??2013-01-07?14:50??MySobelFilter\Win32\Debug\CL.read.1.tlog
?????文件?????????682??2013-01-07?14:50??MySobelFilter\Win32\Debug\CL.write.1.tlog
?????文件????????2647??2013-01-07?09:29??MySobelFilter\Win32\Debug\SobelFilter.Build.CppClean.log
?????文件?????????381??2013-01-07?14:50??MySobelFilter\Win32\Debug\SobelFilter.exe.intermediate.manifest
?????文件?????????117??2013-01-07?14:50??MySobelFilter\Win32\Debug\SobelFilter.lastbuildstate
?????文件??????213695??2013-01-07?14:50??MySobelFilter\Win32\Debug\SobelFilter.obj
............此處省略61個(gè)文件信息

評(píng)論

共有 條評(píng)論