tvdeconv_C程序

所属分类:图形图象
开发工具:C/C++
文件大小:90KB
下载次数:6
上传日期:2018-04-28 11:45:12
上 传 者luvky_girl
说明:  全变分图像处理程序; 实现超分辨;图像去噪;图像恢复
(C program of TV algorithm; superresolution; denoising ; image recover;)

文件列表:
tvdeconv_C程序\tvdeconv_20120607\basic.c (1483, 2012-03-21)
tvdeconv_C程序\tvdeconv_20120607\basic.h (5704, 2012-03-21)
tvdeconv_C程序\tvdeconv_20120607\cliio.c (12611, 2012-03-28)
tvdeconv_C程序\tvdeconv_20120607\cliio.h (1515, 2012-03-21)
tvdeconv_C程序\tvdeconv_20120607\conv.c (11777, 2012-03-30)
tvdeconv_C程序\tvdeconv_20120607\conv.h (2220, 2012-03-30)
tvdeconv_C程序\tvdeconv_20120607\doxygen.conf (9923, 2012-05-03)
tvdeconv_C程序\tvdeconv_20120607\dsolve_inc.c (5439, 2012-05-16)
tvdeconv_C程序\tvdeconv_20120607\einstein.bmp (18400, 2012-03-28)
tvdeconv_C程序\tvdeconv_20120607\example.sh (518, 2012-05-16)
tvdeconv_C程序\tvdeconv_20120607\imageio.c (70628, 2017-07-03)
tvdeconv_C程序\tvdeconv_20120607\imageio.h (2779, 2012-03-21)
tvdeconv_C程序\tvdeconv_20120607\imblur.c (16405, 2012-04-09)
tvdeconv_C程序\tvdeconv_20120607\imdiff.c (17971, 2012-03-30)
tvdeconv_C程序\tvdeconv_20120607\kernels.c (4872, 2012-03-21)
tvdeconv_C程序\tvdeconv_20120607\kernels.h (594, 2012-03-21)
tvdeconv_C程序\tvdeconv_20120607\license.txt (1366, 2012-03-28)
tvdeconv_C程序\tvdeconv_20120607\makefile.gcc (2842, 2012-05-16)
tvdeconv_C程序\tvdeconv_20120607\makefile.vc (2398, 2012-05-16)
tvdeconv_C程序\tvdeconv_20120607\num.h (778, 2012-03-21)
tvdeconv_C程序\tvdeconv_20120607\randmt.c (11358, 2012-03-21)
tvdeconv_C程序\tvdeconv_20120607\randmt.h (16197, 2012-03-26)
tvdeconv_C程序\tvdeconv_20120607\tvdeconv.c (7822, 2012-06-08)
tvdeconv_C程序\tvdeconv_20120607\tvreg.c (14099, 2012-06-08)
tvdeconv_C程序\tvdeconv_20120607\tvreg.h (2250, 2012-03-21)
tvdeconv_C程序\tvdeconv_20120607\tvregopt.h (15611, 2012-03-21)
tvdeconv_C程序\tvdeconv_20120607\usolve_dct_inc.c (9286, 2012-06-08)
tvdeconv_C程序\tvdeconv_20120607\usolve_dft_inc.c (10400, 2012-05-16)
tvdeconv_C程序\tvdeconv_20120607\util_deconv.h (5064, 2012-03-30)
tvdeconv_C程序\tvdeconv_20120607\zsolve_inc.c (7077, 2012-05-16)
tvdeconv_C程序\tvdeconv_20120607 (0, 2018-04-27)
tvdeconv_C程序 (0, 2018-04-27)

Total Variation Deconvolution using Split Bregman Pascal Getreuer, pascal.getreuer@yale.edu, Yale University Version 20120607 (June 7, 2012) == Overview == This C source code accompanies with Image Processing On Line (IPOL) article "Total Variation Deconvolution using Split Bregman" at http://www.ipol.im/pub/algo/g_tv_deconvolution/ This code is used by the online IPOL demo: http://www.ipol.im/pub/algo/g_tv_deconvolution/ Future software releases and updates will be posted at http://dev.ipol.im/~getreuer/code/ == License (BSD) == Files randmt.c and randmt.h are copyright Makoto Matsumoto, Takuji Nishimura, Seiji Nishimura, Nicolas Limare, and Pascal Getreuer and are distributed under the BSD license conditions described in the headers of those files. File einstein.bmp is a standard test image. All other files are distributed according to the simplified BSD license. You should have received a copy of this license along this program. If not, see . == Program Usage == This source code includes three command line programs: tvdeconv, imblur, and imdiff. * tvdeconv: runs total variation regularized image deconvolution * imblur: blurs and adds noise to an image * imdiff: compares two images with various image metrics --- tvdeconv --- Usage: tvdeconv [param:value ...] input output where "input" and "output" are BMP files (JPEG, PNG, or TIFF files can also be used if the program is compiled with libjpeg, libpng, and/or libtiff). This program performs TV regularized deconvolution. Parameters K: blur kernel for deconvolution K:disk: filled disk kernel K:gaussian: Gaussian kernel K: read kernel from text or image file lambda: fidelity weight noise: noisy model noise:gaussian additive Gaussian noise (default) noise:laplace Laplace noise noise:poisson Poisson noise f: input file (alternative syntax) u: output file (alternative syntax) jpegquality: quality for saving JPEG images (0 to 100) --- imblur --- Usage: imblur [param:value ...] input output The imblur program blurs and adds noise to an image. Parameters K: blur kernel for deconvolution K:disk: filled disk kernel K:gaussian: Gaussian kernel K: read kernel from text or image file noise:: simulate noise with standard deviation sigma noise:gaussian: additive white Gaussian noise noise:laplace: Laplace noise noise:poisson: Poisson noise f: input file (alternative syntax) u: output file (alternative syntax) jpegquality: quality for saving JPEG images (0 to 100) --- imdiff --- Usage: imdiff [options] The imdiff program compares two images with various image metrics. Options: -m Metric to use for comparison, choices are max Maximum absolute difference, max_n |A_n - B_n| mse Mean squared error, 1/N sum |A_n - B_n|^2 rmse Root mean squared error, (MSE)^1/2 psnr Peak signal-to-noise ratio, -10 log10(MSE/255^2) mssim Mean structural similarity index -s Compute metric separately for each channel -p Remove a margin of pixels before comparison -D D parameter for difference image Alternatively, a difference image is generated by the syntax imdiff [-D ] The difference image is computed as D_n = 255/2 ((A_n - B_n)/D + 1). Values outside of the range [0,255] are saturated. Example: # Generate Gaussian noise with standard deviation 15 on "einstein.bmp" # and save the result to "blurry.bmp". ./imblur K:disk:1 noise:gaussian:5 einstein.bmp blurry.bmp # Perform TV regularized deconvolution with the split Bregman algorithm # on "blurry.bmp" and save the result to "deconv.bmp". ./tvdeconv K:disk:1 lambda:50 blurry.bmp deconv.bmp # Compare the original to the restored image ./imdiff einstein.bmp deconv.bmp Each of these programs prints detailed usage information when executed without arguments or "--help". == Compiling == Instructions are included below for compiling on Linux sytems with GCC, on Windows with MinGW+MSYS, and on Windows with MSVC. Compiling requires the FFTW3 Fourier transform library (http://www.fftw.org/). For supporting additional image formats, the programs can optionally be compiled with libjpeg, libpng, and/or libtiff. Windows BMP images are always supported. == Compiling (Linux) == To compile this software under Linux, first install the development files for libfftw, libjpeg, libpng, and libtiff. On Ubuntu and other Debian-based systems, enter the following into a terminal: sudo apt-get install build-essential libfftw3-dev libjpeg8-dev libpng-dev libtiff-dev On Redhat, Fedora, and CentOS, use sudo yum install make gcc libfftw-devel libjpeg-turbo-devel libpng-devel libtiff-devel Then to compile the software, use make with makefile.gcc: tar -xf tvdeconv_20120607.tar.gz cd tvdeconv_20120607 make -f makefile.gcc This should produce three executables, tvdeconv, imblur, and imdiff. Source documentation can be generated with Doxygen (www.doxygen.org). make -f makefile.gcc srcdoc == Compiling (Windows with MinGW+MSYS) == The MinGW+MSYS is a convenient toolchain for Linux-like development under Windows. MinGW and MSYS can be obtained from http://downloads.sourceforge.net/mingw/ The FFTW3 library is needed to compile the programs. FFTW3 can be obtained from http://www.fftw.org/ Instructions for building FFTW3 with MinGW+MSYS can be found at http://www.fftw.org/install/windows.html http://neuroimaging.scipy.org/doc/manual/html/devel/install/windows_scipy_build.html --- Building with BMP only --- The simplest way to build the tvdeconv programs is with support for only BMP images. In this case, only the FFTW3 library is required. Edit makefile.gcc and comment the LDLIB lines to disable use of libjpeg, libpng, and libtiff: #LDLIBJPEG=-ljpeg #LDLIBPNG=-lpng -lz #LDLIBTIFF=-ltiff Then open an MSYS terminal and compile the program with make CC=gcc -f makefile.gcc This should produce three executables, tvdeconv, imblur, and imdiff. --- Building with PNG, JPEG, and/or TIFF support --- To use the tvdeconv program with PNG, JPEG, and/or TIFF images, the following libraries are needed. For PNG: libpng and zlib For JPEG: libjpeg For TIFF: libtiff These libraries can be obtained at http://www.libpng.org/pub/png/libpng.html http://www.zlib.net/ http://www.ijg.org/ http://www.remotesensing.org/libtiff/ It is not necessary to include support for all of these libraries, for example, you may choose to support only PNG by building zlib and libpng and commenting the LDLIBJPEG and LDLIBTIF lines in makefile.gcc. Instructions for how to build the libraries with MinGW+MSYS are provided at http://permalink.gmane.org/gmane.comp.graphics.panotools.devel/103 http://www.gaia-gis.it/spatialite-2.4.0/mingw_how_to.html Once the libraries are installed, build the tvdeconv programs with the makefile.gcc included in this archive. make CC=gcc -f makefile.gcc This should produce three executables, tvdeconv, imblur, and imdiff. == Compiling (Windows with MSVC) == The express version of the Microsoft Visual C++ (MSVC) compiler can be obtained for free at http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express The FFTW3 library is needed to compile the programs. FFTW3 for MSVC can be obtained from http://www.fftw.org/install/windows.html Edit LIBFFTW3 lines at the top of makefile.vc to tell where the library files are installed. LIBFFTW3_DIR = "D:/libs/fftw" LIBFFTW3_INCLUDE = -I$(LIBFFTW3_DIR) LIBFFTW3_LIB = $(LIBFFTW3_DIR)/libfftw3-3.lib $(LIBFFTW3_DIR)/libfftw3f-3.lib --- Building with BMP only --- For simplicity, the makefile will build the programs with only BMP image support by default. Open a Visual Studio Command Prompt (under Start Menu > Programs > Microsoft Visual Studio > Visual Studio Tools > Visual Studio Command Prompt), navigate to the folder containing the sources, and enter nmake -f makefile.vc all This should produce three executables, tvdeconv, imblur, and imdiff. --- Building with PNG and/or JPEG support --- To include support for PNG and/or JPEG images, the libpng and libjpeg libraries are needed. Edit the LIB lines at the top of makefile.vc to tell where each library is installed, e.g., LIBJPEG_DIR = "C:/libs/jpeg-8b" LIBJPEG_INCLUDE = -I$(LIBJPEG_DIR) LIBJPEG_LIB = $(LIBJPEG_DIR)/libjpeg.lib Then compile using nmake -f makefile.vc all == Acknowledgements == This material is based upon work supported by the National Science Foundation under Award No. DMS-1004694. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.

近期下载者

相关文件


收藏者