• PUDN用户
    了解作者
  • C/C++
    开发工具
  • 1KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 10 积分
    下载积分
  • 110
    下载次数
  • 2010-04-13 20:23
    上传日期
这是一个伽玛图像校正程序,首先读入原始图像,然后利用事先在matlab中计算得到的对每个灰度值校正后的数值替代原灰度值即可。
gamma.rar
  • gamma.c
    3.6KB
内容介绍
/***************************************************************************/ /* */ /* Experiement3 . C */ /* */ /* File In/Out and Processing Gamma Calibration */ /* */ /* 2004/04/05 */ /* */ /***************************************************************************/ #include <stdio.h> #include <math.h> #define TRUE 1 #define FALSE 0 #define BUFSIZE 4096 /* the buffer size is 64*64=4096 */ /* Global declarations */ int in_buffer[BUFSIZE]; /* processing data buffers */ int out_buffer[BUFSIZE]; /* Functions */ static int gamma(int *input, int *output); static void dataIO(void); void main() { int *input = &in_buffer[0]; int *output = &out_buffer[0]; puts("the 3rd experiment started\n"); /* loop forever */ while(TRUE) { /* * Read input data using a probe-point connected to a host file. * Write output data to a graph connected through a probe-point. */ // read the input image data. dataIO(); puts("processing\n"); /* Processing Gamma Calibration*/ gamma(input, output); // write the output image. // the output file is result.dat. dataIO(); } } /* * ======== processing gamma calibration======== * * FUNCTION: apply gamma calibration to enhance the brightness of dark are in an image. * * PARAMETERS: address of input and output buffers. * * RETURN VALUE: TRUE. */ static int gamma(int *input, int *output) { int i; /* the given gamma value is 0.65.*/ /* please try other gamma values. */ int LUT[256]={0, 7, 11, 14, 17, 20, 22, 25, 27, 29, 31, 33, 35, 37, 39, 40, 42, 44, 46, 47, 49, 50, 52, 53, 55, 56, 58, 59, 61, 62, 63, 65, 66, 68, 69, 70, 71, 73, 74, 75, 76, 78, 79, 80, 81, 83, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98,100,101,102, 103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123, 124,125,126,127,128,129,130,131,131,132,133,134,135,136,137,138,139,140,141,141,142, 143,144,145,146,147,148,149,149,150,151,152,153,154,155,155,156,157,158,159,160,160, 161,162,163,164,165,165,166,167,168,169,169,170,171,172,173,173,174,175,176,177,177, 178,179,180,181,181,182,183,184,185,185,186,187,188,188,189,190,191,191,192,193,194, 194,195,196,197,197,198,199,200,200,201,202,203,203,204,205,206,206,207,208,208,209, 210,211,211,212,213,213,214,215,216,216,217,218,218,219,220,221,221,222,223,223,224, 225,225,226,227,228,228,229,230,230,231,232,232,233,234,234,235,236,236,237,238,238, 239,240,240,241,242,242,243,244,244,245,246,246,247,248,248,249,250,250,251,252,252, 253,254,254,255}; /*replace the brightness with a calibrated value.*/ for(i=0;i<BUFSIZE;i++){ output[i]=LUT[input[i]]; } return(TRUE); } /* * ======== dataIO ======== * * FUNCTION: read input signal and write processed output signal. * * PARAMETERS: none. * * RETURN VALUE: none. */ static void dataIO() { /* do data I/O */ return; }
评论
    相关推荐
    • SDL_gamma.rar
      Gamma correction support for Linux.
    • gamma1.rar
      伽玛函数(Gamma函数),也叫欧拉第二积分,是阶乘函数在实数与复数上扩展的一类函数。该函数在分析学、概率论、偏微分方程和组合数学中有重要的应用。与之有密切联系的函数是贝塔函数,也叫第一类欧拉积分。可以...
    • Gamma校正的快速算法及其C语言实现.zip
      显示器 Gamma校正的快速算法及其C语言实现推荐
    • ld9040_gamma.rar
      Gamma level definitions.
    • gamma-function.rar
      gamma函数的一阶导数 很简单但是收敛很快
    • gamma_filter.rar
      a way for image denoising in space domain.
    • e_gamma.rar
      NumberOfBits must be greater than zero.
    • gamma_table.rar
      TI OMAP3 ISP - Default gamma table for all components.
    • matlab开发-Gamma
      matlab开发-Gamma。在整个复平面上计算一个非常精确的伽玛函数。
    • gamma.rar
      bchweight m,crtgamma m,crtgammapoly m,hamcode m编码相关,