/ocr/ocrservice/jni/hydrogen/include/leptonica/watershed.h
C++ Header | 52 lines | 28 code | 4 blank | 20 comment | 0 complexity | afc830921f562ead3d83d40107c17b52 MD5 | raw file
1/*====================================================================* 2 - Copyright (C) 2001 Leptonica. All rights reserved. 3 - This software is distributed in the hope that it will be 4 - useful, but with NO WARRANTY OF ANY KIND. 5 - No author or distributor accepts responsibility to anyone for the 6 - consequences of using this software, or for whether it serves any 7 - particular purpose or works at all, unless he or she says so in 8 - writing. Everyone is granted permission to copy, modify and 9 - redistribute this source code, for commercial or non-commercial 10 - purposes, with the following restrictions: (1) the origin of this 11 - source code must not be misrepresented; (2) modified versions must 12 - be plainly marked as such; and (3) this notice may not be removed 13 - or altered from any source or modified source distribution. 14 *====================================================================*/ 15 16#ifndef LEPTONICA_WATERSHED_H 17#define LEPTONICA_WATERSHED_H 18 19/* 20 * watershed.h 21 * 22 * Simple data structure to hold watershed data. 23 * All data here is owned by the L_WShed and must be freed. 24 */ 25 26struct L_WShed 27{ 28 struct Pix *pixs; /* clone of input 8 bpp pixs */ 29 struct Pix *pixm; /* clone of input 1 bpp seed (marker) pixm */ 30 l_int32 mindepth; /* minimum depth allowed for a watershed */ 31 struct Pix *pixlab; /* 16 bpp label pix */ 32 struct Pix *pixt; /* scratch pix for computing wshed regions */ 33 void **lines8; /* line ptrs for pixs */ 34 void **linem1; /* line ptrs for pixm */ 35 void **linelab32; /* line ptrs for pixlab */ 36 void **linet1; /* line ptrs for pixt */ 37 struct Pixa *pixad; /* result: 1 bpp pixa of watersheds */ 38 struct Pta *ptas; /* pta of initial seed pixels */ 39 struct Numa *nasi; /* numa of seed indicators; 0 if completed */ 40 struct Numa *nash; /* numa of initial seed heights */ 41 struct Numa *namh; /* numa of initial minima heights */ 42 struct Numa *nalevels; /* result: numa of watershed levels */ 43 l_int32 nseeds; /* number of seeds (markers) */ 44 l_int32 nother; /* number of minima different from seeds */ 45 l_int32 *lut; /* lut for pixel indices */ 46 struct Numa **links; /* back-links into lut, for updates */ 47 l_int32 arraysize; /* size of links array */ 48 l_int32 debug; /* set to 1 for debug output */ 49}; 50typedef struct L_WShed L_WSHED; 51 52#endif /* LEPTONICA_WATERSHED_H */