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

  • 大小: 29KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-27
  • 語言: Matlab
  • 標(biāo)簽: nl-means??fast??nl-means??

資源簡介

nl-means算法及fast nl-means matlab

資源截圖

代碼片段和文件信息

#include?“mex.h“
#include?“math.h“
#include?“string.h“
/*???undef?needed?for?LCC?compiler??*/
#undef?EXTERN_C
/*?Multi-threading?libraries?*/
#ifdef?_WIN32
#include?
#include?
#else
#include?
#endif

__inline?double?pow2(double?a)?{?return?a*a;?}

double?*?gaussian_kernel_2D(int?kernelratio){
????/*?Create?the?Gaussian?2D?kernel?*/
????int?kernelsize?npixels?x?y?i?j?p;
????double?sumK?sigma?*K;
????kernelsize=kernelratio*2+1;
????sigma=((double)kernelsize)/4.0;?p=0;
????npixels=kernelsize*kernelsize;
????K=(double*)malloc(npixels*sizeof(double));
????for?(i=0;?i????????for?(j=0;?j????????????x=i-kernelratio;?y=j-kernelratio;
????????????K[p]?=?exp(-((pow2(x)+pow2(y))/(2.0*pow2(sigma))));
????????????p++;
????????}
????}
????/*?Normalize?kernel?*/
????sumK=0;?for(i=0;?i????for(i=0;?i????return?K;
}

double?*?gaussian_kernel_3D(int?kernelratio)?{
????/*?Create?the?Gaussian?3D?kernel?*/
????int?kernelsize?npixels?x?y?z?i?j?k?p;
????double?sumK?sigma?*K;
????kernelsize=kernelratio*2+1;?sigma=((double)kernelsize)/4.0;?p=0;
????npixels=kernelsize*kernelsize*kernelsize;
????K=(double*)malloc(npixels*sizeof(double));
????for?(i=0;?i????????for?(j=0;?j????????????for?(k=0;?k????????????????x=i-kernelratio;?y=j-kernelratio;?z=k-kernelratio;
????????????????K[p]?=?exp(-((pow2(x)+pow2(y)+pow2(z))/(2.0*pow2(sigma))));?p++;
????????????}
????????}
????}
????/*?Normalize?kernel?*/
????sumK=0;?for(i=0;?i????for(i=0;?i????return?K;
}

void?get2Dvectors(double?*I?int?*Isize?double?*V?int?*Vsize?int?kernelratio?int?*block?double?*K?int?ThreadID?int?Nthreads)?{
????int?indexI?indexI_part1?indexI_part2?indexI_part3;
????int?indexV=0;
????int?kernelsize;
????int?npixels2;
????int?C1;
????int?x?y?p;
????int?tz?ik?jk;
????int?block_size[2];

????block_size[0]=block[2]-block[0]+1;
????block_size[1]=block[3]-block[1]+1;
????kernelsize=2*kernelratio+1;
????C1=-(block[0]+block[1]*block_size[0])*Vsize[0];
????npixels2=Isize[0]*Isize[1];
????/*?Loop?through?the?block?*/
????for(y=block[1];?y<=block[3];?y++)?{
????????for(x=block[0]+ThreadID;?x<=block[2];?x+=Nthreads)?{
????????????indexV=(x+y*block_size[0])*Vsize[0]+C1;
????
????????????/*?Get?a?patch*/
????????????indexI_part1=0;
????????????for(tz=0;?tz????????????????p=0;
????????????????indexI_part3=(y-kernelratio)*Isize[0];
????????????????indexI_part2=x-kernelratio+indexI_part1;
????????????????indexI=indexI_part2+?indexI_part3;
????????????????for?(jk=0;?jk????????????????????for?(ik=0;?ik????????????????????????V[indexV]=K[p]*I[indexI];
????????????????????????indexV++;?indexI++;
????????????????????????p++;
????????????????????}
????????????????????indexI_p

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????8859??2010-09-07?15:50??NLMF.m
?????文件????????3510??2010-09-07?17:17??NLMF2Dtree.m
?????文件???????12141??2010-04-28?18:48??image2vectors_double.c
?????文件???????12162??2010-04-28?18:48??image2vectors_single.c
?????文件???????10757??2005-09-26?17:08??lena.jpg
?????文件????????1335??2010-09-07?12:05??license.txt
?????文件???????15772??2010-04-28?18:48??vectors_nlmeans_double.c
?????文件???????15724??2010-04-28?18:48??vectors_nlmeans_single.c

評論

共有 條評論