📄 frthre.c
字号:
/*--------------------------- MegaWave2 module -----------------------------*//* mwcommand name = {frthre}; author = {"Jacques Froment"}; version = {"1.0"}; function = {"Thresold the pixel's gray-levels of a noisy fimage for optimal recovery"}; usage = { 'l':[noise=20.0]->noise "Absolute value of the additive noise", fimage->A "Input fimage", result<-B "Output image"};*//*--------------------------------------------------------------------------*/#include <stdio.h>#include <math.h>#include "mw.h"void frthre(A,B,noise)Fimage A,B;float *noise;{ register float *ptrA,*ptrB; register int i; if ((B = mw_change_fimage(B,A->nrow,A->ncol)) == NULL) mwerror(FATAL, 1, "Not enough memory !\n"); for (ptrA=A->gray, ptrB=B->gray, i=0; i < A->nrow*A->ncol; ptrA++, ptrB++, i++) { if (*ptrA > *noise) *ptrB = *ptrA - *noise; else if (*ptrA < - *noise) *ptrB = *ptrA + *noise; else *ptrB = 0.0; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -