pym1.c
来自「图像中非刚性曲线的蛇形检测算法」· C语言 代码 · 共 96 行
C
96 行
/****************************************************************************
File Name : pym1.c
Purpose : pyramid generation
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 :
kflai@iti.gov.sg
asschan@ntu.ac.sg
***************************************************************************/
#include "xwindow.h"
#include "gsnake.h"
void testmain(char *,int,int );
void printhelp();
void getparam(int, char **, int *, int *);
main(int argc,char **argv)
{
int level,magnify;
magnify =1;
level = 2;
if (argc==1) printhelp();
else {
getparam(argc,argv,&magnify,&level);
testmain(argv[1], level,magnify);
return(0);
}
}
void testmain( char *imgfile, /* image file */
int level, /* Gaussian pyramid level */
int mag) /* magnification factor */
{
PYRAMID mypyramid;
if ( mypyramid.putRawImg( imgfile ) ) {
printf("Unable to read image file.");
exit(-1);
}
else {
/* generating pyramid to default conditioning parameters */
/* in verbose mode */
mypyramid.generate( level, 1 );
mypyramid.show( mag, level );
getchar();
xwin_close();
}
}
void getparam(int ac, char **av, int *Mfactor,int *lev)
{
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' :
*lev=atoi(inputstr);
break;
default: break;
}
}
}
void printhelp()
{
printf("\n\nCreation of pyramid");
printf("\n Usage :OOpym1 <image> [ option ] ");
printf("\n [ option] ");
printf("\n -M :Magnification factor, default 1 ");
printf("\n -L :Level of pyramid, default 2\n\n");
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?