| 1 | /********************************************************************** |
| 2 | jlclassify_lib.h: classify raster image |
| 3 | Author(s): [email protected] |
| 4 | Copyright (C) 2016-2020 European Union (Joint Research Centre) |
| 5 | |
| 6 | This file is part of jiplib. |
| 7 | |
| 8 | jiplib is free software: you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation, either version 3 of the License, or |
| 11 | (at your option) any later version. |
| 12 | |
| 13 | jiplib is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with jiplib. If not, see <https://www.gnu.org/licenses/>. |
| 20 | ***********************************************************************/ |
| 21 | #pragma once |
| 22 | |
| 23 | enum CLASSIFIER { NONE = 0, SVM = 1, ANN = 2, SML = 3}; |
| 24 | |
| 25 | static CLASSIFIER getClassifier(const std::string &method){ |
| 26 | std::map<std::string,CLASSIFIER> methodMap; |
| 27 | methodMap["SVM"]=SVM; |
| 28 | methodMap["svm"]=SVM; |
| 29 | methodMap["ANN"]=ANN; |
| 30 | methodMap["ann"]=ANN; |
| 31 | methodMap["SML"]=SML; |
| 32 | methodMap["sml"]=SML; |
| 33 | if(methodMap.count(method)) |
| 34 | return(methodMap[method]); |
| 35 | else |
| 36 | return(NONE); |
| 37 | }; |
| 38 |