Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
BLUR.C
Upload User: gzsenex
Upload Date: 2013-02-24
Package Size: 25984k
Code Size: 1k
Category:
Graph program
Development Platform:
C/C++
- #define MAX
- #include "fftlib.h"
- int
- main (int argc, char *argv[])
- {
- int n=0, nr, nc;
- IMAGE im1, p;
- COMPLEX_IMAGE fft1, fft2;
- float x, xi;
- int i,j;
- printf ("Image Restoration System module 3 - Blurn");
- /* Try to open standard image files. */
- if (argc < 4)
- {
- printf ("BLUR input psf outputnn");
- exit (0);
- }
- im1 = Input_PBM (argv[1]);
- if (im1 == 0)
- {
- printf ("No such file as '%s'n", argv[1]);
- exit(1);
- }
- p = Input_PBM (argv[2]);
- if (p == 0)
- {
- printf ("No such file as '%s'n", argv[2]);
- exit(1);
- }
- if (im1->info->nr != im1->info->nc)
- {
- printf ("Input image is not square. Use ALIGN.n");
- exit(0);
- }
- if (p->info->nr != p->info->nc)
- {
- printf ("PSF image is not square. Use ALIGN.n");
- exit(0);
- }
- if (im1->info->nr != p->info->nr)
- {
- printf ("Input and PSF images differ in size.n");
- exit (0);
- }
- nr = im1->info->nr; nc = im1->info->nc;
- image_fftoc (im1, &fft1);
- normalize_set();
- image_fftoc (p, &fft2);
- normalize_clear();
- for (i=0; i<nr; i++)
- for (j=0; j<nc; j++)
- {
- x = fft1[i][j]; xi = fft1[i][j+nc];
- cprod (fft2[i][j], fft2[i][j+nc], &x, &xi);
- fft1[i][j] = x; fft1[i][j+nc] = xi;
- }
- freecomplex (fft2); fft2 = (COMPLEX_IMAGE)0;
- image_fftinvoc (fft1, &fft2);
- freecomplex (fft1); fft1 = (COMPLEX_IMAGE)0;
- filt_toint (fft2, p, 0);
- Output_PBM (p, argv[3]);
- }