1 2 /////////////////////////////////////////////////////////// 3 // // 4 // SAGA // 5 // // 6 // System for Automated Geoscientific Analyses // 7 // // 8 // Tool Library: // 9 // imagery_segmentation // 10 // // 11 //-------------------------------------------------------// 12 // // 13 // slic.h // 14 // // 15 // Olaf Conrad (C) 2019 // 16 // // 17 //-------------------------------------------------------// 18 // // 19 // This file is part of 'SAGA - System for Automated // 20 // Geoscientific Analyses'. SAGA is free software; you // 21 // can redistribute it and/or modify it under the terms // 22 // of the GNU General Public License as published by the // 23 // Free Software Foundation, either version 2 of the // 24 // License, or (at your option) any later version. // 25 // // 26 // SAGA is distributed in the hope that it will be // 27 // useful, but WITHOUT ANY WARRANTY; without even the // 28 // implied warranty of MERCHANTABILITY or FITNESS FOR A // 29 // PARTICULAR PURPOSE. See the GNU General Public // 30 // License for more details. // 31 // // 32 // You should have received a copy of the GNU General // 33 // Public License along with this program; if not, see // 34 // <http://www.gnu.org/licenses/>. // 35 // // 36 //-------------------------------------------------------// 37 // // 38 // e-mail: oconrad@saga-gis.org // 39 // // 40 // contact: Olaf Conrad // 41 // Institute of Geography // 42 // University of Hamburg // 43 // Germany // 44 // // 45 /////////////////////////////////////////////////////////// 46 47 //--------------------------------------------------------- 48 #ifndef HEADER_INCLUDED__slic_H 49 #define HEADER_INCLUDED__slic_H 50 51 52 /////////////////////////////////////////////////////////// 53 // // 54 // // 55 // // 56 /////////////////////////////////////////////////////////// 57 58 //--------------------------------------------------------- 59 #include <saga_api/saga_api.h> 60 61 62 /////////////////////////////////////////////////////////// 63 // // 64 // // 65 // // 66 /////////////////////////////////////////////////////////// 67 68 //--------------------------------------------------------- 69 class CSLIC : public CSG_Tool_Grid 70 { 71 public: 72 CSLIC(void); 73 74 // virtual CSG_String Get_MenuPath (void) { return( _TL("Segmentation") ); } 75 76 77 protected: 78 79 virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); 80 virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); 81 82 virtual bool On_Execute (void); 83 84 85 private: 86 87 bool m_bNormalize; 88 89 CSG_Parameter_Grid_List *m_pGrids; 90 91 CSG_Grid *m_Centroid; 92 93 94 int Get_Feature_Count (void); 95 double Get_Feature (int k, int x, int y); 96 97 int Fit_To_Grid_System (double Value, int Coordinate); 98 99 100 bool Get_Polygons (CSG_Grid &Segments); 101 bool Get_Grids (CSG_Grid &Segments); 102 103 bool Get_Segments (CSG_Grid &Segments); 104 105 bool Get_Edge (CSG_Grid &Edge); 106 107 bool Get_Centroids (int Size); 108 bool Del_Centroids (void); 109 110 bool Get_Generalized (CSG_Grid &Segments); 111 112 }; 113 114 115 /////////////////////////////////////////////////////////// 116 // // 117 // // 118 // // 119 /////////////////////////////////////////////////////////// 120 121 //--------------------------------------------------------- 122 #endif // #ifndef HEADER_INCLUDED__slic_H 123 124