Leptonica 1.68
C Image Processing Library
|
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 #ifndef LEPTONICA_WATERSHED_H 00017 #define LEPTONICA_WATERSHED_H 00018 00019 /* 00020 * watershed.h 00021 * 00022 * Simple data structure to hold watershed data. 00023 * All data here is owned by the L_WShed and must be freed. 00024 */ 00025 00026 struct L_WShed 00027 { 00028 struct Pix *pixs; /* clone of input 8 bpp pixs */ 00029 struct Pix *pixm; /* clone of input 1 bpp seed (marker) pixm */ 00030 l_int32 mindepth; /* minimum depth allowed for a watershed */ 00031 struct Pix *pixlab; /* 16 bpp label pix */ 00032 struct Pix *pixt; /* scratch pix for computing wshed regions */ 00033 void **lines8; /* line ptrs for pixs */ 00034 void **linem1; /* line ptrs for pixm */ 00035 void **linelab32; /* line ptrs for pixlab */ 00036 void **linet1; /* line ptrs for pixt */ 00037 struct Pixa *pixad; /* result: 1 bpp pixa of watersheds */ 00038 struct Pta *ptas; /* pta of initial seed pixels */ 00039 struct Numa *nasi; /* numa of seed indicators; 0 if completed */ 00040 struct Numa *nash; /* numa of initial seed heights */ 00041 struct Numa *namh; /* numa of initial minima heights */ 00042 struct Numa *nalevels; /* result: numa of watershed levels */ 00043 l_int32 nseeds; /* number of seeds (markers) */ 00044 l_int32 nother; /* number of minima different from seeds */ 00045 l_int32 *lut; /* lut for pixel indices */ 00046 struct Numa **links; /* back-links into lut, for updates */ 00047 l_int32 arraysize; /* size of links array */ 00048 l_int32 debug; /* set to 1 for debug output */ 00049 }; 00050 typedef struct L_WShed L_WSHED; 00051 00052 #endif /* LEPTONICA_WATERSHED_H */