亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? flwtfilt.c

?? 大師寫的二代小波經典之作
?? C
字號:
/* *  -*- Mode: ANSI C -*- *  $Id: flwtfilt.c,v 1.5 1996/09/17 16:10:09 fernande Exp $ *  $Source: /sgi.acct/sweldens/cvs/liftpack/flwtfilt.c,v $ *  Author: Gabriel Fernandez, Senthil Periaswamy * *  A filter operator is included to process images. The idea is *  to modify the predicted values of the Gammas by some factor in *  order to smooth or enhance the original dataset. * *  The factor is called beta. If it is less than 1, the original *  image is smoothed. If it is greater than 1, the image is enhanced. *//* do not edit anything above this line *//* System header files */#include <ctype.h>#include <math.h>#include <stdio.h>#include <stdlib.h>/* FLWT header files */#include <flwterr.h>#include <flwtfilt.h>#include <util.h>/* Static declarations *//* static void (*pFilterFunction)(); */static voidFLWTFilter1D ( Vector, const int, const int, const int, const Flt );static voidFLWTFilter1DC ( Vector, const int, const int, const int,                        const Flt, const Flt,			const int, const int );/* code *//* * FilterQuery function: asks the user about the kind of filter that *                       has to be applied to the input dataset. */BetaFilterQuery ( void ){    Beta beta;    int opt;    char input[BUFSIZ];    boolean exit;        fprintf (stdout, "\n>>> Filter Operator Query <<<\n");    fprintf (stdout, "The following questions are useful to determine the\n"                     "parameters needed for the filter operator.\n");    /* Type of filter operator */    do {        fprintf (stdout, "\nType of filter: [L]inear, [C]ircular, "	                 "[R]ectangular, [F]unction ? ");        opt = tolower ( getc (stdin) );	fflush (stdin);	exit = TRUE;	if ( opt == 'l' ) {	    beta.mode = LINEAR;	    /* pFilterFunction = (&FLWTFilter1D); */	} else if ( opt == 'c' ) {	    beta.mode = CIRCULAR;	    /* pFilterFunction = NULL; */        } else if ( opt == 'r' ) {	    beta.mode = RECTANGULAR;	    /* pFilterFunction = NULL; */        } else if ( opt == 'f' ) {	    beta.mode = FUNCTION;	    /* pFilterFunction = NULL; */	} else {            Error ("FilterQuery", INVALID_ANSWER, RETURN);            exit = FALSE;        }    } while (!exit);    if ( opt == 'l' ) {	do {	    fprintf (stdout, "\nDifferent beta factors for X and Y [Y, N]? ");	    opt = tolower ( getc(stdin) );	    fflush (stdin);            exit = TRUE;            if ( opt == 'n' ) {	        do {	            fprintf (stdout, "\nGive value of beta: ");	            gets (input);		    fflush (stdin);	            beta.val1 = beta.val2 = (Flt)atof(input);	            if ( beta.val1 <= (Flt)0 ) {		        Error ("FilterQuery", INVALID_RELATIONAL_FLT, RETURN,                               "Beta", ">", 0.0);		        exit = FALSE;	            } else {		        exit = TRUE;		    }	        } while (!exit);            } else if ( opt == 'y' ) {	        do {	            fprintf (stdout, "\nGive value of beta for X: ");	            gets (input);		    fflush (stdin);	            beta.val1 = (Flt)atof(input);	            if ( beta.val1 <= (Flt)0 ) {		        Error ("FilterQuery", INVALID_RELATIONAL_FLT, RETURN,                               "Beta", ">", 0.0);		        exit = FALSE;	            } else {		        exit = TRUE;		    }	        } while (!exit);		do {	            fprintf (stdout, "\nGive value of beta for Y: ");	            gets (input);		    fflush (stdin);	            beta.val2 = (Flt)atof(input);	            if ( beta.val2 <= (Flt)0 ) {		        Error ("FilterQuery", INVALID_RELATIONAL_FLT, RETURN,                               "Beta", ">", 0.0);		        exit = FALSE;	            } else {		        exit = TRUE;		    }	        } while (!exit);            } else {	        Error ("FilterQuery", INVALID_ANSWER, RETURN);                exit = FALSE;	    }	} while (!exit);    } else if ( opt == 'c' || opt == 'r' ) {	do {	    fprintf (stdout, "\nGive value of beta in the middle: ");	    gets (input);	    fflush (stdin);	    beta.val1 = (Flt)atof(input);	    if ( beta.val1 <= (Flt)0 ) {                Error ("FilterQuery", INVALID_RELATIONAL_FLT, RETURN,                       "Beta", ">", 0.0);		exit = FALSE;	    } else {		exit = TRUE;	    }	} while (!exit);	do {	    fprintf (stdout, "\nGive value of beta in the border: ");	    gets (input);	    fflush (stdin);	    beta.val2 = (Flt)atof(input);	    if ( beta.val2 <= (Flt)0 ) {                Error ("FilterQuery", INVALID_RELATIONAL_FLT, RETURN,                       "Beta", ">", 0.0);		exit = FALSE;	    } else {		exit = TRUE;            }	} while (!exit);    } else if ( opt == 'f' ) {        Error ("FilterQuery", CUSTOM, ABORT,                "Function filter is not supported yet. Exiting...\n");    } else {        Error ("FilterQuery", FATAL_ERROR, ABORT);        /* NOTREACHED */    }    /* Return the beta structure filled up */    return beta;}/* * FilterAPI function: manages the beta structure to see what kind of *                     operations have to be done. */voidFilterAPI ( Matrix Data, const int sizeX, const int sizeY,                         const int N, const int nTilde,                         const Beta beta, const int levels ){    if ( beta.mode == LINEAR ) {	FLWTFilter2D ( Data, sizeX, sizeY, N, nTilde, beta, levels );    } else if ( beta.mode == CIRCULAR ) {	FLWTFilter2D ( Data, sizeX, sizeY, N, nTilde, beta, levels );    } else if ( beta.mode == RECTANGULAR ) {	fprintf (stderr, "Not implemented rectangular option yet."	                 "Nothing is done.\n");    } else {	Error ("FilterAPI", FATAL_ERROR, RETURN);        /* NOTREACHED */    }}/* * FLWTFilter2D function: returns an enhanced image by multiplying *                        each wavelet detail coefficient at a particular *                        scale s by some weight w_s. The weights are *                        different for each scale. Data is the image you *                        wish to enhance, and Beta is a base weight factor *                        you wish to apply to the detail coefficients in *                        each scale. The original beta value is applied *                        the coarsest level, (beta)^2 is applied to the *                        previous level, and so on, until (beta)^max_level *                        is applied to the finest leveli (level 1). */voidFLWTFilter2D ( Matrix Data, const int sizeX, const int sizeY,                            const int N, const int nTilde,                            const Beta beta, const int levels ){    int x, y,        n,          /* maximum number levels */        nX, nY,     /* number of iterations in X and Y directions */        step,       /* step size of current level */        max_step;   /* maximum step for coefficients in last level */    Flt maxN,       /* maximum number of vanishing moments */        fBetaX,     /* beta factor for the X direction */        fBetaY;     /* beta factor for the Y direction */    /* Calculate number of iterations n. It is the maximum  */    /* value such that the following relation is satisfied. */    /*        (2^n)*(N-1) <= L < (2^(n+1))*(N-1) + 1        */    /* Where L = max (signal's length in X-Y direction).    */    /* and N = max (# dual vanish mom & # real vanish mom)  */    /* Hence, solving for n, we have the following equation */    /* for all the cases:  n = floor (log_2((L-1)/(N-1))    */    maxN = (Flt)MAX(N, nTilde) - (Flt)1;   /* max vanishing moments */    /* Iterations in X */    nX = (sizeX == 1) ? 0 : (int)logBaseN ( (Flt)(sizeX-1)/maxN, (Flt)2 );    nX = (nX < 0) ? 0 : MIN (levels, nX);   /* find lowest level */    /* Iterations in Y */    nY = (sizeY == 1) ? 0 : (int)logBaseN ( (Flt)(sizeY-1)/maxN, (Flt)2 );    nY = (nY < 0) ? 0 : MIN (levels, nY);   /* find lowest level */    /* Total number of iterations */    n  = MAX(nX, nY);   /* find minimum number of iterations */    /* Calculate the maximum beta factor for each direction */    fBetaX = (Flt)1;    for ( x=0 ; x<nX ; x++ )        fBetaX *= beta.val1;    fBetaY = (Flt)1;    for ( y=0 ; y<nY ; y++ )        fBetaY *= beta.val2;    /* Apply beta operator to rows and columns */    max_step = (n==0) ? 0 : 1<<n;   /* maximum step */    for ( step=1 ; step<max_step ; step<<=1 ) {        /* For the rows */        if (nX-- > 0) {            for ( y=0 ; y<sizeY ; y+=step ) {	        if ( beta.mode == LINEAR ) {                    FLWTFilter1D ( &Data[y][0], sizeX, 1, step, fBetaX );		} else if ( beta.mode == CIRCULAR ) {		    FLWTFilter1DC ( &Data[y][0], sizeX, 1, step,		                    beta.val1, beta.val2, y, nX );		}                /* (*pFilterFunction) ( &Data[y][0], sizeY, 1, step, fBetaX ); */            }	    fBetaX /= beta.val1;        }        /* For the columns */        if (nY-- > 0) {            for ( x=0 ; x<sizeX ; x+=step ) {	        if ( beta.mode == LINEAR ) {                    FLWTFilter1D ( &Data[0][x], sizeY, sizeX, step, fBetaY );		} else if ( beta.mode == CIRCULAR ) {		    FLWTFilter1DC ( &Data[0][x], sizeY, sizeX, step,		                    beta.val1, beta.val2, x, nY );		}                /* (*pFilterFunction) ( &Data[0][x], sizeY, 1, step, fBetaY ); */            }	    fBetaY /= beta.val2;        }    }}/* * FLWTFilter1D function: applies the given factor beta to the given set of *                        coefficients. */static voidFLWTFilter1D ( Vector Data, const int len, const int incr, const int step,                            const Flt beta ){    register int gammaIdx;    int stepIncr, size;    /* Initialize some variable */    stepIncr = (step*incr) << 1;    gammaIdx = stepIncr >> 1;    size = len*incr;    /* Step through Gammas and apply Beta factor */    while (gammaIdx < size) {        Data[gammaIdx] *= beta;        gammaIdx += stepIncr;    }}/* * FLWTFilter1DC function: applies a circular filter to the given set of *                         wavelet coefficients. */static voidFLWTFilter1DC ( Vector Data, const int len, const int incr, const int step,                             const Flt betaStart, const Flt betaStop,			     const int xy, const int levels ){    register Vector gammaPtr;    int stepIncr, x, step2, k;    Flt i, j, s, beta, interval = betaStop - betaStart;    if ( xy > len ) {        Error ( "FLWTFilter1DC", INVALID_RELATIONAL_INT, ABORT, "xy", "<=", len );    }    /* Initialize some variables */    x = 0;    step2 = step << 1;    stepIncr = step2*incr;    gammaPtr = Data + (stepIncr >> 1);    /* Step through Gammas and apply Beta factor */    for ( x=0 ; x<len ; x+=step2 ) {        Flt dist;	i = (Flt)x / (Flt)len - (Flt)0.5;	j = (Flt)xy / (Flt)len - (Flt)0.5;        dist = j*j + i*i;	s = dist*(Flt)len/(Flt)255;   /* s lies b/w 0 and 1 */	if ( betaStart <= betaStop ) {	    s = s*interval + betaStart;         } else {            s = (Flt)1 - s;            s = betaStop - s*interval;        }	beta = s;	for ( k=0 ; k<levels ; k++ )	    beta *= s;        *(gammaPtr) *= beta;        gammaPtr += stepIncr;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久夜色精品国产欧美乱极品| 最新不卡av在线| 亚洲视频一区在线| 水蜜桃久久夜色精品一区的特点| 国产乱子伦视频一区二区三区| 欧美三片在线视频观看| 国产精品婷婷午夜在线观看| 日本va欧美va精品| 一本在线高清不卡dvd| 国产人成一区二区三区影院| 麻豆国产欧美日韩综合精品二区 | 日韩专区在线视频| 91在线精品一区二区| 精品国产91久久久久久久妲己| 午夜av一区二区| 色偷偷88欧美精品久久久| 国产清纯美女被跳蛋高潮一区二区久久w| 亚洲一区二区三区四区在线观看 | 狠狠色丁香婷综合久久| 欧美一级精品在线| 免费在线观看不卡| 欧美一区三区四区| 日本vs亚洲vs韩国一区三区| 欧美一级淫片007| 蜜臀99久久精品久久久久久软件| 欧美狂野另类xxxxoooo| 亚洲二区视频在线| 欧美日韩一区久久| 亚洲成a人片在线观看中文| 色综合天天性综合| 亚洲欧美日韩精品久久久久| av不卡免费电影| 一区二区三区四区中文字幕| 91黄色在线观看| 午夜成人免费电影| 欧美一区二区三区电影| 久久精品国产99| www久久久久| 国产a级毛片一区| 国产精品久久久久四虎| 97久久超碰国产精品| 一区二区三区资源| 欧美精选一区二区| 另类小说视频一区二区| 久久久国产午夜精品| 99国产精品99久久久久久| 亚洲日本在线天堂| 欧美猛男男办公室激情| 美腿丝袜亚洲色图| 久久精品视频一区二区三区| 成人免费视频播放| 依依成人精品视频| 日韩欧美中文字幕制服| 国产高清不卡一区二区| 国产精品免费久久久久| 在线观看一区二区视频| 美女爽到高潮91| 国产精品乱人伦中文| 欧美日韩久久一区二区| 激情五月婷婷综合| 亚洲黄色av一区| 欧美大度的电影原声| 成人av高清在线| 午夜国产精品影院在线观看| 久久嫩草精品久久久精品| 色偷偷久久一区二区三区| 免费高清在线一区| 精品一区二区精品| 成人免费视频网站在线观看| 亚洲人成小说网站色在线| 欧美一区二区三区的| 国产福利91精品一区| 亚洲一级片在线观看| 久久久亚洲综合| 日韩写真欧美这视频| 高清国产午夜精品久久久久久| 亚洲激情网站免费观看| 2019国产精品| 欧美丝袜自拍制服另类| 国产黄色精品网站| 亚洲大片免费看| 亚洲欧洲av色图| 精品国产自在久精品国产| 欧洲av一区二区嗯嗯嗯啊| 国产精品亚洲视频| 免费一级欧美片在线观看| 亚洲精品精品亚洲| 久久免费午夜影院| 日韩一区二区三区视频在线 | 国产精品69毛片高清亚洲| 亚洲影院理伦片| 国产精品污www在线观看| 欧美大片一区二区| 在线不卡免费欧美| 欧美日韩中文国产| 91网站黄www| 丁香天五香天堂综合| 久久国产生活片100| 日本伊人色综合网| 亚洲成人黄色影院| 亚洲成人av福利| 亚洲狼人国产精品| 亚洲色图欧美激情| 1000部国产精品成人观看| 欧美韩日一区二区三区四区| 国产无人区一区二区三区| 亚洲精品一区二区三区99| 精品久久免费看| 精品少妇一区二区三区免费观看| 日韩欧美一级精品久久| 在线播放国产精品二区一二区四区| 在线国产电影不卡| 欧美伊人久久久久久久久影院 | 色先锋资源久久综合| 99视频精品全部免费在线| av在线不卡网| 久久奇米777| 欧美日韩在线亚洲一区蜜芽| 在线免费观看一区| 欧美另类高清zo欧美| 欧美性色黄大片| 欧美日韩国产综合一区二区| 欧美情侣在线播放| 久久综合五月天婷婷伊人| 欧美一级欧美一级在线播放| 日韩女优视频免费观看| 国产视频一区不卡| 国产精品卡一卡二| 综合在线观看色| 亚洲一区二区三区免费视频| 日韩电影在线一区| 精品一区二区免费视频| 大陆成人av片| 欧美午夜寂寞影院| 日韩一级片网址| 中文在线资源观看网站视频免费不卡| 中文字幕亚洲不卡| 亚洲成人先锋电影| 国精产品一区一区三区mba桃花| 成人激情免费网站| 欧洲国产伦久久久久久久| 日韩女优视频免费观看| 国产精品久久久久久久久果冻传媒 | 日韩一区在线看| 亚洲电影一区二区三区| 精品伊人久久久久7777人| 成人sese在线| 91精品国产综合久久香蕉的特点| 久久久久久久综合日本| 一区二区视频在线| 青青草原综合久久大伊人精品优势| 激情文学综合网| 欧美色网站导航| 26uuu亚洲综合色欧美| 亚洲欧美在线视频| 日韩av一区二区三区| 成人黄色一级视频| 日韩欧美亚洲国产另类| 国产精品成人一区二区艾草 | av网站一区二区三区| 在线播放视频一区| 精品1区2区在线观看| 亚洲婷婷在线视频| 精品一区精品二区高清| 91色综合久久久久婷婷| 欧美一区二区三区四区五区| 中文字幕一区二区视频| 免费在线成人网| 欧美亚洲一区二区三区四区| 精品久久久久久最新网址| 亚洲伊人色欲综合网| 国产成人av电影在线播放| 91精品国产综合久久精品图片| 中文字幕 久热精品 视频在线| 麻豆精品国产91久久久久久| 欧美伊人久久大香线蕉综合69 | 欧美视频日韩视频| 国产精品美女久久久久aⅴ | 国产亚洲精品aa| 日本午夜一本久久久综合| 日本精品一级二级| 国产日韩欧美制服另类| 看国产成人h片视频| 欧美视频精品在线| 亚洲国产你懂的| 高潮精品一区videoshd| 精品入口麻豆88视频| 日本午夜精品视频在线观看| 欧美丝袜丝交足nylons| 亚洲欧美另类久久久精品| 成人av集中营| 1024精品合集| 91蜜桃网址入口| 亚洲国产高清在线| 国产精品一区二区视频| 久久久亚洲午夜电影| 国产精品一区二区在线观看网站| www亚洲一区| 国产高清不卡二三区| 欧美国产日本韩|