📄 imgclass.c
字号:
/****************************************************************************
File Name : imgclass.c
Purpose : classify various templates
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 printhelp();
void testmain( char **imgsample );
main( int argc, char **argv )
{
char **imgsamples ;
imgsamples = &argv[1] ;
if( argc < 2 )
printhelp();
else
testmain( imgsamples );
}
void testmain( char **imgsamples ) /* image samples */
{
register short i ;
CLASSIFY shape(_EDGE) ;
shape.Nrxy = 3 ; /* allow some stretching in diagonal direction */
if( shape.read("ellip.con") != NOERROR ||
shape.read("rect.con") != NOERROR ) {
printf("cannot find contour files\n") ;
exit(-1) ;
}
for(i=0; *imgsamples; i++, imgsamples++) {
IMAGE myImage ;
if( myImage.read(*imgsamples) != NOERROR )
break ;
int id = shape.classify(&myImage, _MARGIN_PROB) ;
printf("%s : %s\n", *imgsamples, shape.getLabel(id) ) ;
shape.dump(*imgsamples) ;
}
exit(0) ;
}
void printhelp()
{
printf("\n To classify various templates");
printf("\n Usage : imgclass <image samples>\n\n");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -