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
pym2.c
Package: gsnake.rar [view]
Upload User: shhuayu888
Upload Date: 2013-03-28
Package Size: 1788k
Code Size: 4k
Category:
Windows Develop
Development Platform:
Unix_Linux
- /****************************************************************************
- File Name : pym1.c
- Purpose : Getting gaussian image and edge map
- Date : Aug 31,1995
- GSNAKE API is jointly developed by the Information Technology Institute (ITI), Singapore, and the School of Applied Science, Nanyang Technological
- University (NTU), Singapore.
- These software programs are available to the user without any license or royalty fees. Permission is hereby granted to use, copy, modify, and distribute this software and its documentation for any purpose. ITI and NTU gives no warranty, express, implied, or statuary for the software and/or documentation provided, including, without limitation, waranty of merchantibility and warranty of fitness for a particular purpose. The software provided hereunder is on an "as is" basis, and ITI and NTU has no obligation to provide maintenance, support, updates, enhancements, or modifications.
- GSNAKE API is available for any UNIX compatible system. User feedback, bugs, or software and manual suggestions should be sent via electronic mail to one of the following, who may or may not act on them as he/she desires :
- asschan@ntu.ac.sg
- kflai@iti.gov.sg
- ***************************************************************************/
- #include "gsnake.h"
- void testmain(char *,int,int, int );
- void printhelp();
- void getparam(int, char **, int *, int *, int *);
- main(int argc,char **argv)
- {
- int plevel=2;
- int i_level=0;
- int magnify =1;
- if (argc==1) printhelp();
- else {
- getparam(argc,argv,&plevel,&i_level,&magnify);
- testmain(argv[1],plevel,i_level,magnify);
- return(0);
- }
- }
- void testmain( char *imgfile, /* image file */
- int pymlevel, /* pyramid levels */
- int i_level, /* level of interest */
- int mag) /* maginification factor */
- {
- IMAGE myimage1,
- *myimage2; /* IMAGE object */
- PYRAMID mypyramid; /* PYRAMID object */
- EDGE *myedge; /* EDGE object */
- if ( myimage1.read( imgfile ) ) {
- printf("nUnable to get image.n");
- exit(-1);
- }
- /* Placing image into pyramid object by using another image */
- mypyramid.putRawImg( &myimage1 );
- /* generating pyramid by default conditioning parameters */
- mypyramid.generate( pymlevel, 1 );
- if ( !i_level )
- i_level = mypyramid.getLevel() - 1;
- /* get edge map and Guassian images of interest */
- myimage2 = mypyramid.getGauss( i_level );
- myedge = mypyramid.getEdge( i_level );
- /* Showing gaussian image at level */
- if ( myimage2 && myedge) {
- printf("nShowing level %d Gaussian image", i_level);
- myimage2->show( mag*i_level );
- printf("nPress enter to continue .");
- getchar();
- printf("nShowing level %d edge map", i_level);
- myedge->show( mag*i_level );
- printf("nPress enter to continue.");
- getchar();
- }
- else
- printf("nLevel specified is invalid.");
- printf("nEnd of testn");
- }
- void getparam(int ac, char **av,int *plev, int *lev,int *Mfactor)
- {
- register int i;
- char *inputstr;
- for (i=2; i<ac; i++) {
- if (*(av[i]) != '-') continue;
- inputstr = av[i]+2;
- switch( *(av[i]+1) ) {
- case 'M' :
- *Mfactor=atoi(inputstr);
- break;
- case 'L' :
- *plev=atoi(inputstr);
- break;
- case 'l' :
- *lev = atoi(inputstr);
- break;
- default: break;
- }
- }
- }
- void printhelp()
- {
- printf("nnCreation of pyramid");
- printf("n Usage :OOpym2 <image> [ option ]");
- printf("n [ option ] ");
- printf("n -M : Magnification factor, default 1 ");
- printf("n -L : Level of pyramid, default 2");
- printf("n -l : Level of image to take. Default top levelnn");
- }