Leptonica 1.68
C Image Processing Library

baselinetest.c

Go to the documentation of this file.
00001 /*====================================================================*
00002  -  Copyright (C) 2001 Leptonica.  All rights reserved.
00003  -  This software is distributed in the hope that it will be
00004  -  useful, but with NO WARRANTY OF ANY KIND.
00005  -  No author or distributor accepts responsibility to anyone for the
00006  -  consequences of using this software, or for whether it serves any
00007  -  particular purpose or works at all, unless he or she says so in
00008  -  writing.  Everyone is granted permission to copy, modify and
00009  -  redistribute this source code, for commercial or non-commercial
00010  -  purposes, with the following restrictions: (1) the origin of this
00011  -  source code must not be misrepresented; (2) modified versions must
00012  -  be plainly marked as such; and (3) this notice may not be removed
00013  -  or altered from any source or modified source distribution.
00014  *====================================================================*/
00015 
00016 /*
00017  * baselinetest.c
00018  *
00019  *   - e.g., use keystone.png as the input image
00020  *   - to get plots of baseline locations and other derived
00021  *     parameters, set DEBUG_PLOT to 1 in baseline.c 
00022  */
00023 
00024 #include "allheaders.h"
00025 
00026 main(int    argc,
00027      char **argv)
00028 {
00029 char        *filein, *fileout;
00030 NUMA        *na;
00031 PIX         *pixs, *pixd;
00032 PTA         *pta;
00033 static char  mainName[] = "baselinetest";
00034 
00035     if (argc != 3)
00036         return ERROR_INT(" Syntax:  baselinetest filein fileout", mainName, 1);
00037 
00038     filein = argv[1];
00039     fileout = argv[2];
00040     pixs = pixRead(filein);
00041 
00042 #if 1
00043         /* Test function for deskewing using projective transform
00044          * on linear approximation for local skew angle */
00045     pixd = pixDeskewLocal(pixs, 10, 0, 0, 0.0, 0.0, 0.0);
00046     pixWrite(fileout, pixd, IFF_TIFF_G4);
00047 
00048         /* test baseline finder */
00049     na = pixFindBaselines(pixd, &pta, 1);
00050 /*    ptaWriteStream(stderr, pta, 1); */
00051     pixDestroy(&pixd);
00052     numaDestroy(&na);
00053     ptaDestroy(&pta);
00054 #endif
00055 
00056 #if 0
00057         /* Test function for finding local skew angles */
00058     na = pixGetLocalSkewAngles(pixs, 10, 0, 0, 0.0, 0.0, 0.0, NULL, NULL);
00059     numaDestroy(&na);
00060 #endif
00061 
00062     pixDestroy(&pixs);
00063     return 0;
00064 }
00065 
00066 
00067 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines