資源簡介
供圖像處理初學者參考用,用隨機數方法對原圖像加高斯噪聲
代碼片段和文件信息
#include
#include
#define?w?64
#define?h?64
unsigned?char?Trans(float?o);//像素值變為0-255的char?//
float?GauseNoise(float?D);//產生均值為0,標準差為D的高斯噪聲//
void?main()
{ static?unsigned?char?Image[h][w];
????static?float?Image1[h][w];
int?ij;
float?phi=1.5;
FILE?*fp1*fp2;
fp1=fopen(“f:\\geman.raw““rb“);
fread(Image1w*hfp1);
for(i=0;i for(j=0;j Image1[i][j]=(float)Image[i][j];
????????????//abc=GauseNoise(13);
//printf(“%f\n“
評論
共有 條評論