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
gho1.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 : gho1.c
- Purpose : find one g-snake by generalized Hough transform
- 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"
- #include "xwindow.h"
- void testmain(char *, char *, int, short);
- void printhelp();
- void getparam(int ac, char** av, int *);
- main(int argc, char **argv)
- {
- int Magnify = 1;
- short Level = 1;
- char *confile;
- if (argc < 3)
- printhelp();
- else {
- getparam(argc,argv, &Magnify );
- testmain(argv[1], argv[2], Magnify, Level);
- return(0);
- }
- }
- void testmain( char *imgfile, /* image file */
- char *cfile, /* contour file */
- int mag, /* magnification factor */
- short level ) /* pyramid level */
- {
- PYRAMID mypyramid; /* PYRAMID object */
- EDGE *edgemap; /* EDGE object */
- CONTOUR mycontour; /* CONTOUR object */
- CONTOUR *localised; /* CONTOUR object */
- SNAXEL *sptr; /* SNAXEL object */
- GHOUGH GHT_OBJ; /* GHOUGH object */
- int row, col; /* image of col x row */
- if ( mypyramid.putRawImg(imgfile) )
- exit (-1);
- if (mycontour.read(cfile))
- exit(-1);
- /* Generate pyramid in verbose mode to level 3 */
- mypyramid.generate(level, 1);
- /* Get highest level in pyramid */
- printf("n Perform localization ... waitn");
- edgemap = mypyramid.getEdge(level - 1);
- localised = GHT_OBJ.localize( &mycontour, edgemap );
- /* show image */
- mypyramid.rawImg->show(mag);
- for ( sptr=localised->getHead(); sptr; sptr=sptr->getNext() )
- sptr->show( mypyramid.rawImg,
- ROUNDOFF(sptr->getRow())*mag,
- ROUNDOFF(sptr->getCol())*mag);
- printf("nPress enter to end.");
- getchar();
- }
- void getparam( int ac,
- char** av,
- int *mag )
- {
- register int i;
- char *inputstr;
- for (i=1; i<ac; i++) {
- if( *av[i] != '-' )
- continue; /* illegal input */
- inputstr = av[i]+2;
- switch( *(av[i]+1) ) {
- case 'M' :
- *mag=atoi(inputstr);
- break;
- }
- }
- }
- void printhelp()
- {
- printf("nnLocalisation of contour on image");
- printf("n Usage :OOgho1 <image> <contour> [ option ]");
- printf("n [ option ]");
- printf("n -M : Magnification factor, default 1nn");
- }