ClassifierEMStrategy.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/rp/ClassifierEMStrategy.cpp
22 
23  \brief EM (Expectation-Maximization) strategy for pixel-based classification.
24 */
25 
26 // TerraLib
27 #include "../common/MatrixUtils.h"
28 #include "../common/progress/TaskProgress.h"
29 #include "../raster/Grid.h"
30 #include "../raster/PositionIterator.h"
31 #include "../raster/RasterIterator.h"
32 #include "../raster/Utils.h"
33 #include "ClassifierEMStrategy.h"
34 #include "Macros.h"
35 #include "Functions.h"
36 
37 // STL
38 #include <complex>
39 #include <iostream>
40 #include <map>
41 
42 // Boost
43 #include <boost/numeric/ublas/io.hpp>
44 #include <boost/numeric/ublas/lu.hpp>
45 #include <boost/numeric/ublas/matrix.hpp>
46 
47 namespace
48 {
49  static te::rp::ClassifierEMStrategyFactory classifierEMStrategyFactoryInstance;
50 }
51 
53 {
54  reset();
55 }
56 
58 
60 {
61  reset();
62 
66  m_epsilon = rhs.m_epsilon;
68 
69  return *this;
70 }
71 
73 {
75  m_maxIterations = 0;
76  m_maxInputPoints = 0;
77  m_epsilon = 0.0;
78  m_clustersMeans.clear();
79 }
80 
82 {
84 }
85 
87 {
88  m_isInitialized = false;
89 }
90 
92 
93 bool te::rp::ClassifierEMStrategy::initialize(te::rp::ClassifierStrategyParameters const* const strategyParams) throw(te::rp::Exception)
94 {
95  m_isInitialized = false;
96 
97  te::rp::ClassifierEMStrategy::Parameters const* paramsPtr = dynamic_cast<te::rp::ClassifierEMStrategy::Parameters const*>(strategyParams);
98 
99  if(!paramsPtr)
100  return false;
101 
102  m_parameters = *(paramsPtr);
103 
104  TERP_INSTANCE_TRUE_OR_RETURN_FALSE(m_parameters.m_numberOfClusters > 1, TE_TR("The number of clusters must be at least 2."))
105  TERP_INSTANCE_TRUE_OR_RETURN_FALSE(m_parameters.m_maxIterations > 0, TE_TR("The number of iterations must be at least 1."))
108  TERP_INSTANCE_TRUE_OR_RETURN_FALSE(m_parameters.m_maxInputPoints >= m_parameters.m_numberOfClusters, TE_TR("The maximum number of points must be at least higher than the number of clusters."))
109  TERP_INSTANCE_TRUE_OR_RETURN_FALSE(m_parameters.m_epsilon > 0, TE_TR("The stop criteria must be higher than 0."))
110 
111  m_isInitialized = true;
112 
113  return true;
114 }
115 
117 {
118  TERP_INSTANCE_TRUE_OR_RETURN_FALSE(m_isInitialized, TE_TR("Instance not initialized"))
119 
120  // Creating the output raster
121 
122  std::vector< int > dt;
123  dt.push_back( te::dt::UINT32_TYPE );
124 
125  std::vector< double > noDataValues;
126  noDataValues.push_back( (double)( m_parameters.m_numberOfClusters + 2 ) );
127 
129  "Output raster creation error" );
130 
132  "Output raster palette creation error" );
133 
134 // create a vector of points with random positions inside raster to obtain input data
135  std::vector<te::gm::Point*> randomPoints = te::rst::GetRandomPointsInRaster(*m_inputRasterPtr, m_parameters.m_maxInputPoints);
136 
137 // M is the number of clusters
138  const unsigned int M = m_parameters.m_numberOfClusters;
139 // N is the number of vectors used to estimate the probabilities
140  const unsigned int N = static_cast<unsigned int>(randomPoints.size());
141 // S is the number of elements inside each vector
142  const unsigned int S = static_cast<unsigned int>(m_inputRasterBands.size());
143 
144 // get the input data
145  boost::numeric::ublas::matrix<double> Xk = boost::numeric::ublas::matrix<double>(N, S);
146 
149  unsigned int k = 0;
150  double max_pixel_value = 0.0;
151  while (pit != pitend)
152  {
153  for (unsigned int l = 0; l < S; l++)
154  {
155  m_inputRasterPtr->getValue(pit.getColumn(), pit.getRow(), Xk(k, l), m_inputRasterBands[l]);
156  if (Xk(k, l) > max_pixel_value)
157  max_pixel_value = Xk(k, l);
158  }
159 
160  ++k;
161  ++pit;
162  }
163 
164  srand((unsigned) time(nullptr));
165 // the parameter vector of means for each cluster
166  boost::numeric::ublas::matrix<double> MUj = boost::numeric::ublas::matrix<double>(M, S);
167  boost::numeric::ublas::matrix<double> previous_MUj = boost::numeric::ublas::matrix<double>(M, S);
168  if (m_parameters.m_clustersMeans.size() > 0)
169  {
170  for (unsigned int j = 0; j < M; j++)
171  for (unsigned int l = 0; l < S; l++)
172  MUj(j, l) = m_parameters.m_clustersMeans[j][l];
173  }
174  else
175  {
176 // define vector of means randomly, in the interval [0, max_pixel_value].
177  for (unsigned int j = 0; j < M; j++)
178  for (unsigned int l = 0; l < S; l++)
179  MUj(j, l) = rand() % (int) ceil(max_pixel_value);
180  }
181  previous_MUj = MUj;
182 
183 // the parameter vector of covariance matrices for each cluster
184  std::vector<boost::numeric::ublas::matrix<double> > SIGMAj;
185  for (unsigned int j = 0; j < M; j++)
186  {
187  boost::numeric::ublas::matrix<double> tmp_sigma(S, S);
188  for (unsigned int l = 0; l < S; l++)
189  {
190  for (unsigned int m = 0; m < S; m++)
191  tmp_sigma(l, m) = 0.0;
192  tmp_sigma(l, l) = 10.0;
193  }
194  SIGMAj.push_back(tmp_sigma);
195  }
196 
197 // variables used to estimate the cluster's probabilities
198  boost::numeric::ublas::matrix<double> Pj = boost::numeric::ublas::matrix<double>(M, 1);
199  boost::numeric::ublas::matrix<double> PCj_Xk = boost::numeric::ublas::matrix<double>(M, N);
200  for (unsigned int j = 0; j < M; j++)
201  {
202  Pj(j, 0) = 1 / (double) M;
203  for (unsigned int k = 0; k < N; k++)
204  PCj_Xk(j, k) = 0.0;
205  }
206 
207 // estimating cluster's probabilities
208  double sum_PCj_Xk;
209  double numerator_PCj_Xk;
210  double denominator_PCj_Xk;
211  double det_SIGMAj;
212  double det_SIGMAj2;
213  double distance_MUj;
214 
215  boost::numeric::ublas::matrix<double> Xk_minus_MUj(S, 1);
216  boost::numeric::ublas::matrix<double> Xk_minus_MUj_T(1, S);
217  boost::numeric::ublas::matrix<double> product_NETAj(1, 1);
218  boost::numeric::ublas::matrix<double> product_NETAj2(1, 1);
219  boost::numeric::ublas::matrix<double> inverse_SIGMAj(S, S);
220  boost::numeric::ublas::matrix<double> inverse_SIGMAj2(S, S);
221  boost::numeric::ublas::matrix<double> product_Xk_minusMUj(S, S);
222  boost::numeric::ublas::matrix<double> sum_product_Xk_minusMUj(S, S);
223 
224  te::common::TaskProgress task(TE_TR("Expectation Maximization algorithm - estimating clusters"), te::common::TaskProgress::UNDEFINED, m_parameters.m_maxIterations);
225  for (unsigned int i = 0; i < m_parameters.m_maxIterations; i++)
226  {
227 // computing PCj_Xk
228  for (unsigned int j = 0; j < M; j++)
229  {
230  te::common::GetDeterminant(SIGMAj[j], det_SIGMAj);
231  if (det_SIGMAj >= 0.0)
232  det_SIGMAj = pow(det_SIGMAj, -0.5);
233  else
234  det_SIGMAj = 1.0;
235 
236  for (unsigned int k = 0; k < N; k++)
237  {
238 // computing numerator of equation for PCj_Xk
239  numerator_PCj_Xk = 0.0;
240  for (unsigned int l = 0; l < S; l++)
241  Xk_minus_MUj(l, 0) = Xk(k, l) - MUj(j, l);
242  Xk_minus_MUj_T = boost::numeric::ublas::trans(Xk_minus_MUj);
243 
244  te::common::GetInverseMatrix(SIGMAj[j], inverse_SIGMAj);
245 
246  product_NETAj = prod(Xk_minus_MUj_T, inverse_SIGMAj);
247  product_NETAj = prod(product_NETAj, Xk_minus_MUj);
248  product_NETAj *= -0.5;
249 
250  numerator_PCj_Xk = det_SIGMAj * exp(product_NETAj(0, 0)) * Pj(j, 0);
251 
252 // computing denominator of equation for PCj_Xk
253  denominator_PCj_Xk = 0.0;
254  for (unsigned int j2 = 0; j2 < M; j2++)
255  {
256  te::common::GetDeterminant(SIGMAj[j2], det_SIGMAj2);
257  if (det_SIGMAj2 >= 0.0)
258  det_SIGMAj2 = pow(det_SIGMAj2, -0.5);
259  else
260  det_SIGMAj2 = 1.0;
261 
262  for (unsigned int l = 0; l < S; l++)
263  Xk_minus_MUj(l, 0) = Xk(k, l) - MUj(j2, l);
264  Xk_minus_MUj_T = boost::numeric::ublas::trans(Xk_minus_MUj);
265 
266  te::common::GetInverseMatrix(SIGMAj[j2], inverse_SIGMAj2);
267 
268  product_NETAj2 = prod(Xk_minus_MUj_T, inverse_SIGMAj2);
269  product_NETAj2 = prod(product_NETAj2, Xk_minus_MUj);
270  product_NETAj2 *= -0.5;
271 
272  denominator_PCj_Xk += det_SIGMAj2 * exp(product_NETAj2(0, 0)) * Pj(j2, 0);
273  }
274  if (denominator_PCj_Xk == 0.0)
275  denominator_PCj_Xk = 0.0000000001;
276 
277 // computing PCj_Xk
278  PCj_Xk(j, k) = numerator_PCj_Xk / denominator_PCj_Xk;
279  }
280  }
281 
282 // computing SIGMAj for t + 1
283  for (unsigned int j = 0; j < M; j++)
284  {
285  sum_PCj_Xk = 0.0;
286  for (unsigned int l = 0; l < S; l++)
287  for (unsigned int l2 = 0; l2 < S; l2++)
288  sum_product_Xk_minusMUj(l, l2) = 0.0;
289  for (unsigned int k = 0; k < N; k++)
290  {
291  sum_PCj_Xk += PCj_Xk(j, k);
292 
293  for (unsigned int l = 0; l < S; l++)
294  Xk_minus_MUj(l, 0) = Xk(k, l) - MUj(j, l);
295  Xk_minus_MUj_T = boost::numeric::ublas::trans(Xk_minus_MUj);
296 
297  product_Xk_minusMUj = prod(Xk_minus_MUj, Xk_minus_MUj_T);
298  product_Xk_minusMUj *= PCj_Xk(j, k);
299 
300  sum_product_Xk_minusMUj += product_Xk_minusMUj;
301  }
302  if (sum_PCj_Xk == 0.0)
303  sum_PCj_Xk = 0.0000000001;
304  SIGMAj[j] = sum_product_Xk_minusMUj / sum_PCj_Xk;
305  }
306 
307 // computing MUj for t + 1
308  for (unsigned int j = 0; j < M; j++)
309  {
310  sum_PCj_Xk = 0.0;
311  for (unsigned int l = 0; l < S; l++)
312  MUj(j, l) = 0.0;
313  for (unsigned int k = 0; k < N; k++)
314  {
315  for (unsigned int l = 0; l < S; l++)
316  MUj(j, l) += PCj_Xk(j, k) * Xk(k, l);
317  sum_PCj_Xk += PCj_Xk(j, k);
318  }
319  if (sum_PCj_Xk == 0.0)
320  sum_PCj_Xk = 0.0000000001;
321  for (unsigned int l = 0; l < S; l++)
322  MUj(j, l) /= sum_PCj_Xk;
323  }
324 
325 // computing Pj for t + 1
326  for (unsigned int j = 0; j < M; j++)
327  {
328  Pj(j, 0) = 0.0;
329  for (unsigned int k = 0; k < N; k++)
330  Pj(j, 0) += PCj_Xk(j, k);
331  Pj(j, 0) /= N;
332  }
333 
334 // checking convergence
335  distance_MUj = 0.0;
336  double a_minus_b;
337  for (unsigned int j = 0; j < M; j++)
338  for (unsigned int l = 0; l < S; l++)
339  {
340  a_minus_b = MUj(j, l) - previous_MUj(j, l);
341  distance_MUj += a_minus_b * a_minus_b;
342  }
343  distance_MUj = sqrt(distance_MUj);
344  if (distance_MUj < m_parameters.m_epsilon)
345  break;
346  previous_MUj = MUj;
347 
348  task.pulse();
349  }
350 
351 // classifying image
352 
353  const double outNoDataValue = m_outputRasterPtr->getBand( 0 )->getProperty()->m_noDataValue;
354  const double inNoDataValue = m_inputRasterPtr->getBand( m_inputRasterBands[ 0 ] )->getProperty()->m_noDataValue;
355 
358 
359  boost::numeric::ublas::matrix<double> X = boost::numeric::ublas::matrix<double>(1, S);
360  boost::numeric::ublas::matrix<double> PCj_X = boost::numeric::ublas::matrix<double>(M, 1);
361 
362  double max_PCj_X;
363  unsigned int cluster;
364 
365  double numerator_PCj_X;
366  double denominator_PCj_X;
367 
368  boost::numeric::ublas::matrix<double> X_minus_MUj(S, 1);
369  boost::numeric::ublas::matrix<double> X_minus_MUj_T(1, S);
370 
372  task.setMessage(TE_TR("Expectation Maximization algorithm - classifying image"));
373  task.setCurrentStep(0);
374  while (it != itend)
375  {
376  for (unsigned int l = 0; l < S; l++)
377  X(0, l) = (*it)[ m_inputRasterBands[ l ]];
378 
379  if( X(0, 0) == inNoDataValue )
380  {
381  m_outputRasterPtr->setValue(it.getColumn(), it.getRow(), outNoDataValue, 0);
382  }
383  else
384  {
385  // computing PCj_X
386  for (unsigned int j = 0; j < M; j++)
387  {
388  // computing numerator of equation for PCj_X
389  te::common::GetDeterminant(SIGMAj[j], det_SIGMAj);
390  if (det_SIGMAj >= 0.0)
391  det_SIGMAj = pow(det_SIGMAj, -0.5);
392  else
393  det_SIGMAj = 1.0;
394 
395  numerator_PCj_X = 0.0;
396  for (unsigned int l = 0; l < S; l++)
397  X_minus_MUj(l, 0) = X(0, l) - MUj(j, l);
398  X_minus_MUj_T = boost::numeric::ublas::trans(X_minus_MUj);
399 
400  te::common::GetInverseMatrix(SIGMAj[j], inverse_SIGMAj);
401 
402  product_NETAj = prod(X_minus_MUj_T, inverse_SIGMAj);
403  product_NETAj = prod(product_NETAj, X_minus_MUj);
404  product_NETAj *= -0.5;
405 
406  numerator_PCj_X = det_SIGMAj * exp(product_NETAj(0, 0)) * Pj(j, 0);
407 
408  // computing denominator of equation for PCj_X
409  denominator_PCj_X = 0.0;
410  for (unsigned int j2 = 0; j2 < M; j2++)
411  {
412  te::common::GetDeterminant(SIGMAj[j2], det_SIGMAj2);
413  if (det_SIGMAj2 >= 0.0)
414  det_SIGMAj2 = pow(det_SIGMAj2, -0.5);
415  else
416  det_SIGMAj2 = 1.0;
417 
418  for (unsigned int l = 0; l < S; l++)
419  X_minus_MUj(l, 0) = X(0, l) - MUj(j2, l);
420  X_minus_MUj_T = boost::numeric::ublas::trans(X_minus_MUj);
421 
422  te::common::GetInverseMatrix(SIGMAj[j2], inverse_SIGMAj2);
423 
424  product_NETAj2 = prod(X_minus_MUj_T, inverse_SIGMAj2);
425  product_NETAj2 = prod(product_NETAj2, X_minus_MUj);
426  product_NETAj2 *= -0.5;
427 
428  denominator_PCj_X += det_SIGMAj2 * exp(product_NETAj2(0, 0)) * Pj(j2, 0);
429  }
430  if (denominator_PCj_X == 0.0)
431  denominator_PCj_X = 0.0000000001;
432 
433  PCj_X(j, 0) = numerator_PCj_X / denominator_PCj_X;
434  }
435 
436  max_PCj_X = 0.0;
437  cluster = 0;
438  for (unsigned int j = 0; j < M; j++)
439  if (PCj_X(j, 0) > max_PCj_X)
440  {
441  max_PCj_X = PCj_X(j, 0);
442  cluster = j + 1;
443  }
444 
445  // save cluster information in output raster
446  m_outputRasterPtr->setValue(it.getColumn(), it.getRow(), cluster, 0);
447  }
448 
449  ++it;
450  task.pulse();
451  }
452 
453  return true;
454 }
455 
457  : te::rp::ClassifierStrategyFactory("em")
458 {
459 }
460 
462 
464 {
465  return new te::rp::ClassifierEMStrategy();
466 }
bool initialize(ClassifierStrategyParameters const *const strategyParams)
Initialize the classification strategy.
void setMessage(const std::string &message)
Set the task message.
unsigned int m_numberOfClusters
The number of clusters (classes) to estimate in the image.
unsigned int getRow() const
Returns the current row in iterator.
Base exception class for plugin module.
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
bool createOutputRaster(const std::vector< int > &bandsDataTypes, const std::vector< double > &noDataValues)
Create the output raster using the EXPANSIBLE driver.
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state...
This class implements and iterator to "navigate" over a raster, with a predefined number of bands...
This class can be used to inform the progress of a task.
Definition: TaskProgress.h:53
static PointSetIterator end(const te::rst::Raster *r, const std::vector< te::gm::Point * > p)
Returns an iterator referring to after the end of the iterator.
EM (Expectation-Maximization) strategy for pixel-based classification.
const Parameters & operator=(const Parameters &params)
bool execute()
Executes the classification strategy.
double m_noDataValue
Value to indicate elements where there is no data, default is std::numeric_limits<double>::max().
Definition: BandProperty.h:136
#define TE_TR(message)
It marks a string in order to get translated.
Definition: Translator.h:242
This class implements the strategy to iterate with spatial restriction, the iteration occurs inside a...
std::vector< unsigned int > m_inputRasterBands
Input raster bands.
void setTotalSteps(int value)
Set the task total stepes.
Raster classifier strategy factory base class.
bool GetDeterminant(const boost::numeric::ublas::matrix< T > &inputMatrix, double &determinant)
Get the Matrix determinant value.
Definition: MatrixUtils.h:57
Raster EM Classifier strategy factory.
EM strategy for pixel-based classification. This is an unsupervised and pixel-based classification al...
An abstract class for raster data strucutures.
static RasterIterator begin(Raster *r, const std::vector< unsigned int > &bands)
Returns an iterator referring to the first value.
unsigned int getNumberOfRows() const
Returns the raster number of rows.
BandProperty * getProperty()
Returns the band property.
URI C++ Library.
Definition: Attributes.h:37
ClassifierEMStrategy::Parameters m_parameters
Internal execution parameters.
static te::dt::TimeDuration dt(20, 30, 50, 11)
bool m_isInitialized
True if this instance is initialized.
te::gm::LineString * l2
AbstractParameters * clone() const
Create a clone copy of this instance.
void pulse()
Calls setCurrentStep() function using getCurrentStep() + 1.
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
unsigned int m_maxInputPoints
The maximum number of points used to estimate the clusters (default = 1000).
virtual void getValue(unsigned int c, unsigned int r, double &value, std::size_t b=0) const
Returns the attribute value of a band of a cell.
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
A pointer to the output raster.
Abstract parameters base interface.
unsigned int m_maxIterations
The maximum of iterations (E/M steps) to perform if convergence is not achieved.
te::rst::Raster const * m_inputRasterPtr
A pointer to the input raster.
void setCurrentStep(int value)
Set the task current step.
Raster classifier strategy base class.
bool GetInverseMatrix(const boost::numeric::ublas::matrix< T > &inputMatrix, boost::numeric::ublas::matrix< T > &outputMatrix)
Matrix inversion.
Definition: MatrixUtils.h:143
TERASTEREXPORT std::vector< te::gm::Point * > GetRandomPointsInRaster(const te::rst::Raster &inputRaster, unsigned int numberOfPoints=1000)
Creates a vector of random positions (points) inside the raster.
static RasterIterator end(Raster *r, const std::vector< unsigned int > &bands)
Returns an iterator referring to after the end of the iterator.
unsigned int getColumn() const
Returns the current column in iterator.
Raster Processing functions.
ripng tcp ripng ripng udp ripng ulp tcp ULP ulp udp ULP ibm db2 tcp IBM DB2 ibm db2 udp IBM DB2 ncp tcp NCP ncp udp NCP timed tcp timeserver timed udp timeserver tempo tcp newdate tempo udp newdate stx tcp Stock IXChange stx udp Stock IXChange custix tcp Customer IXChange custix udp Customer IXChange irc serv tcp IRC SERV irc serv udp IRC SERV courier tcp rpc courier udp rpc conference tcp chat conference udp chat netnews tcp readnews netnews udp readnews netwall tcp for emergency broadcasts netwall udp for emergency broadcasts windream tcp windream Admin windream udp windream Admin iiop tcp iiop iiop udp iiop opalis rdv tcp opalis rdv opalis rdv udp opalis rdv nmsp tcp Networked Media Streaming Protocol nmsp udp Networked Media Streaming Protocol gdomap tcp gdomap gdomap udp gdomap apertus ldp tcp Apertus Technologies Load Determination apertus ldp udp Apertus Technologies Load Determination uucp tcp uucpd uucp udp uucpd uucp rlogin tcp uucp rlogin uucp rlogin udp uucp rlogin commerce tcp commerce commerce udp commerce klogin tcp klogin udp kshell tcp krcmd kshell udp krcmd appleqtcsrvr tcp appleqtcsrvr appleqtcsrvr udp appleqtcsrvr dhcpv6 client tcp DHCPv6 Client dhcpv6 client udp DHCPv6 Client dhcpv6 server tcp DHCPv6 Server dhcpv6 server udp DHCPv6 Server afpovertcp tcp AFP over TCP afpovertcp udp AFP over TCP idfp tcp IDFP idfp udp IDFP new rwho tcp new who new rwho udp new who cybercash tcp cybercash cybercash udp cybercash devshr nts tcp DeviceShare devshr nts udp DeviceShare pirp tcp pirp pirp udp pirp rtsp tcp Real Time Streaming Inc HTTP Inc HTTP Alternate(see Port 80) eudora-set 592/tcp Eudora Set eudora-set 592/udp Eudora Set http-rpc-epmap 593/tcp HTTP RPC Ep Map http-rpc-epmap 593/udp HTTP RPC Ep Map tpip 594/tcp TPIP tpip 594/udp TPIP cab-protocol 595/tcp CAB Protocol cab-protocol 595/udp CAB Protocol smsd 596/tcp SMSD smsd 596/udp SMSD ptcnameservice 597/tcp PTC Name Service ptcnameservice 597/udp PTC Name Service sco-websrvrmg3 598/tcp SCO Web Server Manager 3 sco-websrvrmg3 598/udp SCO Web Server Manager 3 acp 599/tcp Aeolon Core Protocol acp 599/udp Aeolon Core Protocol ipcserver 600/tcp Sun IPC server ipcserver 600/udp Sun IPC server syslog-conn 601/tcp Reliable Syslog Service syslog-conn 601/udp Reliable Syslog Service xmlrpc-beep 602/tcp XML-RPC over BEEP xmlrpc-beep 602/udp XML-RPC over BEEP idxp 603/tcp IDXP idxp 603/udp IDXP tunnel 604/tcp TUNNEL tunnel 604/udp TUNNEL soap-beep 605/tcp SOAP over BEEP soap-beep 605/udp SOAP over BEEP urm 606/tcp Cray Unified Resource Manager urm 606/udp Cray Unified Resource Manager nqs 607/tcp nqs nqs 607/udp nqs sift-uft 608/tcp Sender-Initiated/Unsolicited File Transfer sift-uft 608/udp Sender-Initiated/Unsolicited File Transfer npmp-trap 609/tcp npmp-trap npmp-trap 609/udp npmp-trap npmp-local 610/tcp npmp-local npmp-local 610/udp npmp-local npmp-gui 611/tcp npmp-gui npmp-gui 611/udp npmp-gui hmmp-ind 612/tcp HMMP Indication hmmp-ind 612/udp HMMP Indication hmmp-op 613/tcp HMMP Operation hmmp-op 613/udp HMMP Operation sshell 614/tcp SSLshell sshell 614/udp SSLshell sco-inetmgr 615/tcp Internet Configuration Manager sco-inetmgr 615/udp Internet Configuration Manager sco-sysmgr 616/tcp SCO System Administration Server sco-sysmgr 616/udp SCO System Administration Server sco-dtmgr 617/tcp SCO Desktop Administration Server sco-dtmgr 617/udp SCO Desktop Administration Server dei-icda 618/tcp DEI-ICDA dei-icda 618/udp DEI-ICDA compaq-evm 619/tcp Compaq EVM compaq-evm 619/udp Compaq EVM sco-websrvrmgr 620/tcp SCO WebServer Manager sco-websrvrmgr 620/udp SCO WebServer Manager escp-ip 621/tcp ESCP escp-ip 621/udp ESCP collaborator 622/tcp Collaborator collaborator 622/udp Collaborator oob-ws-http 623/tcp DMTF out-of-band web services management protocol asf-rmcp 623/udp ASF Remote Management and Control Protocol cryptoadmin 624/tcp Crypto Admin cryptoadmin 624/udp Crypto Admin dec_dlm 625/tcp DEC DLM dec_dlm 625/udp DEC DLM asia 626/tcp ASIA asia 626/udp ASIA passgo-tivoli 627/tcp PassGo Tivoli passgo-tivoli 627/udp PassGo Tivoli qmqp 628/tcp QMQP qmqp 628/udp QMQP 3com-amp3 629/tcp 3Com AMP3 3com-amp3 629/udp 3Com AMP3 rda 630/tcp RDA rda 630/udp RDA ipp 631/tcp IPP(Internet Printing Protocol) ipp 631/udp IPP(Internet Printing Protocol) bmpp 632/tcp bmpp bmpp 632/udp bmpp servstat 633/tcp Service Status update(Sterling Software) servstat 633/udp Service Status update(Sterling Software) ginad 634/tcp ginad ginad 634/udp ginad rlzdbase 635/tcp RLZ DBase rlzdbase 635/udp RLZ DBase ldaps 636/tcp ldap protocol over TLS/SSL(was sldap) ldaps 636/udp ldap protocol over TLS/SSL(was sldap) lanserver 637/tcp lanserver lanserver 637/udp lanserver mcns-sec 638/tcp mcns-sec mcns-sec 638/udp mcns-sec msdp 639/tcp MSDP msdp 639/udp MSDP entrust-sps 640/tcp entrust-sps entrust-sps 640/udp entrust-sps repcmd 641/tcp repcmd repcmd 641/udp repcmd esro-emsdp 642/tcp ESRO-EMSDP V1.3 esro-emsdp 642/udp ESRO-EMSDP V1.3 sanity 643/tcp SANity sanity 643/udp SANity dwr 644/tcp dwr dwr 644/udp dwr pssc 645/tcp PSSC pssc 645/udp PSSC ldp 646/tcp LDP ldp 646/udp LDP dhcp-failover 647/tcp DHCP Failover dhcp-failover 647/udp DHCP Failover rrp 648/tcp Registry Registrar Protocol(RRP) rrp 648/udp Registry Registrar Protocol(RRP) cadview-3d 649/tcp Cadview-3d-streaming 3d models over the internet cadview-3d 649/udp Cadview-3d-streaming 3d models over the internet obex 650/tcp OBEX obex 650/udp OBEX ieee-mms 651/tcp IEEE MMS ieee-mms 651/udp IEEE MMS hello-port 652/tcp HELLO_PORT hello-port 652/udp HELLO_PORT repscmd 653/tcp RepCmd repscmd 653/udp RepCmd aodv 654/tcp AODV aodv 654/udp AODV tinc 655/tcp TINC tinc 655/udp TINC spmp 656/tcp SPMP spmp 656/udp SPMP rmc 657/tcp RMC rmc 657/udp RMC tenfold 658/tcp TenFold tenfold 658/udp TenFold mac-srvr-admin 660/tcp MacOS Server Admin mac-srvr-admin 660/udp MacOS Server Admin hap 661/tcp HAP hap 661/udp HAP pftp 662/tcp PFTP pftp 662/udp PFTP purenoise 663/tcp PureNoise purenoise 663/udp PureNoise oob-ws-https 664/tcp DMTF out-of-band secure web services management protocol asf-secure-rmcp 664/udp ASF Secure Remote Management and Control Protocol sun-dr 665/tcp Sun DR sun-dr 665/udp Sun DR mdqs 666/tcp mdqs 666/udp doom 666/tcp doom Id Software doom 666/udp doom Id Software disclose 667/tcp campaign contribution disclosures-SDR Technologies disclose 667/udp campaign contribution disclosures-SDR Technologies mecomm 668/tcp MeComm mecomm 668/udp MeComm meregister 669/tcp MeRegister meregister 669/udp MeRegister vacdsm-sws 670/tcp VACDSM-SWS vacdsm-sws 670/udp VACDSM-SWS vacdsm-app 671/tcp VACDSM-APP vacdsm-app 671/udp VACDSM-APP vpps-qua 672/tcp VPPS-QUA vpps-qua 672/udp VPPS-QUA cimplex 673/tcp CIMPLEX cimplex 673/udp CIMPLEX acap 674/tcp ACAP acap 674/udp ACAP dctp 675/tcp DCTP dctp 675/udp DCTP vpps-via 676/tcp VPPS Via vpps-via 676/udp VPPS Via vpp 677/tcp Virtual Presence Protocol vpp 677/udp Virtual Presence Protocol ggf-ncp 678/tcp GNU Generation Foundation NCP ggf-ncp 678/udp GNU Generation Foundation NCP mrm 679/tcp MRM mrm 679/udp MRM entrust-aaas 680/tcp entrust-aaas entrust-aaas 680/udp entrust-aaas entrust-aams 681/tcp entrust-aams entrust-aams 681/udp entrust-aams xfr 682/tcp XFR xfr 682/udp XFR corba-iiop 683/tcp CORBA IIOP corba-iiop 683/udp CORBA IIOP corba-iiop-ssl 684/tcp CORBA IIOP SSL corba-iiop-ssl 684/udp CORBA IIOP SSL mdc-portmapper 685/tcp MDC Port Mapper mdc-portmapper 685/udp MDC Port Mapper hcp-wismar 686/tcp Hardware Control Protocol Wismar hcp-wismar 686/udp Hardware Control Protocol Wismar asipregistry 687/tcp asipregistry asipregistry 687/udp asipregistry realm-rusd 688/tcp ApplianceWare managment protocol realm-rusd 688/udp ApplianceWare managment protocol nmap 689/tcp NMAP nmap 689/udp NMAP vatp 690/tcp Velazquez Application Transfer Protocol vatp 690/udp Velazquez Application Transfer Protocol msexch-routing 691/tcp MS Exchange Routing msexch-routing 691/udp MS Exchange Routing hyperwave-isp 692/tcp Hyperwave-ISP hyperwave-isp 692/udp Hyperwave-ISP connendp 693/tcp almanid Connection Endpoint connendp 693/udp almanid Connection Endpoint ha-cluster 694/tcp ha-cluster ha-cluster 694/udp ha-cluster ieee-mms-ssl 695/tcp IEEE-MMS-SSL ieee-mms-ssl 695/udp IEEE-MMS-SSL rushd 696/tcp RUSHD rushd 696/udp RUSHD uuidgen 697/tcp UUIDGEN uuidgen 697/udp UUIDGEN olsr 698/tcp OLSR olsr 698/udp OLSR accessnetwork 699/tcp Access Network accessnetwork 699/udp Access Network epp 700/tcp Extensible Provisioning Protocol epp 700/udp Extensible Provisioning Protocol lmp 701/tcp Link Management Protocol(LMP) lmp 701/udp Link Management Protocol(LMP) iris-beep 702/tcp IRIS over BEEP iris-beep 702/udp IRIS over BEEP elcsd 704/tcp errlog copy/server daemon elcsd 704/udp errlog copy/server daemon agentx 705/tcp AgentX agentx 705/udp AgentX silc 706/tcp SILC silc 706/udp SILC borland-dsj 707/tcp Borland DSJ borland-dsj 707/udp Borland DSJ entrust-kmsh 709/tcp Entrust Key Management Service Handler entrust-kmsh 709/udp Entrust Key Management Service Handler entrust-ash 710/tcp Entrust Administration Service Handler entrust-ash 710/udp Entrust Administration Service Handler cisco-tdp 711/tcp Cisco TDP cisco-tdp 711/udp Cisco TDP tbrpf 712/tcp TBRPF tbrpf 712/udp TBRPF iris-xpc 713/tcp IRIS over XPC iris-xpc 713/udp IRIS over XPC iris-xpcs 714/tcp IRIS over XPCS iris-xpcs 714/udp IRIS over XPCS iris-lwz 715/tcp IRIS-LWZ iris-lwz 715/udp IRIS-LWZ pana 716/udp PANA Messages netviewdm1 729/tcp IBM NetView DM/6000 Server/Client netviewdm1 729/udp IBM NetView DM/6000 Server/Client netviewdm2 730/tcp IBM NetView DM/6000 send/tcp netviewdm2 730/udp IBM NetView DM/6000 send/tcp netviewdm3 731/tcp IBM NetView DM/6000 receive/tcp netviewdm3 731/udp IBM NetView DM/6000 receive/tcp netgw 741/tcp netGW netgw 741/udp netGW netrcs 742/tcp Network based Rev.Cont.Sys.netrcs 742/udp Network based Rev.Cont.Sys.flexlm 744/tcp Flexible License Manager flexlm 744/udp Flexible License Manager fujitsu-dev 747/tcp Fujitsu Device Control fujitsu-dev 747/udp Fujitsu Device Control ris-cm 748/tcp Russell Info Sci Calendar Manager ris-cm 748/udp Russell Info Sci Calendar Manager kerberos-adm 749/tcp kerberos administration kerberos-adm 749/udp kerberos administration rfile 750/tcp loadav 750/udp kerberos-iv 750/udp kerberos version iv pump 751/tcp pump 751/udp qrh 752/tcp qrh 752/udp rrh 753/tcp rrh 753/udp tell 754/tcp send tell 754/udp send nlogin 758/tcp nlogin 758/udp con 759/tcp con 759/udp ns 760/tcp ns 760/udp rxe 761/tcp rxe 761/udp quotad 762/tcp quotad 762/udp cycleserv 763/tcp cycleserv 763/udp omserv 764/tcp omserv 764/udp webster 765/tcp webster 765/udp phonebook 767/tcp phone phonebook 767/udp phone vid 769/tcp vid 769/udp cadlock 770/tcp cadlock 770/udp rtip 771/tcp rtip 771/udp cycleserv2 772/tcp cycleserv2 772/udp submit 773/tcp notify 773/udp rpasswd 774/tcp acmaint_dbd 774/udp entomb 775/tcp acmaint_transd 775/udp wpages 776/tcp wpages 776/udp multiling-http 777/tcp Multiling HTTP multiling-http 777/udp Multiling HTTP wpgs 780/tcp wpgs 780/udp mdbs_daemon 800/tcp mdbs_daemon 800/udp device 801/tcp device 801/udp fcp-udp 810/tcp FCP fcp-udp 810/udp FCP Datagram itm-mcell-s 828/tcp itm-mcell-s itm-mcell-s 828/udp itm-mcell-s pkix-3-ca-ra 829/tcp PKIX-3 CA/RA pkix-3-ca-ra 829/udp PKIX-3 CA/RA netconf-ssh 830/tcp NETCONF over SSH netconf-ssh 830/udp NETCONF over SSH netconf-beep 831/tcp NETCONF over BEEP netconf-beep 831/udp NETCONF over BEEP netconfsoaphttp 832/tcp NETCONF for SOAP over HTTPS netconfsoaphttp 832/udp NETCONF for SOAP over HTTPS netconfsoapbeep 833/tcp NETCONF for SOAP over BEEP netconfsoapbeep 833/udp NETCONF for SOAP over BEEP dhcp-failover2 847/tcp dhcp-failover 2 dhcp-failover2 847/udp dhcp-failover 2 gdoi 848/tcp GDOI gdoi 848/udp GDOI iscsi 860/tcp iSCSI iscsi 860/udp iSCSI owamp-control 861/tcp OWAMP-Control owamp-control 861/udp OWAMP-Control twamp-control 862/tcp Two-way Active Measurement Protocol(TWAMP) Control twamp-control 862/udp Two-way Active Measurement Protocol(TWAMP) Control rsync 873/tcp rsync rsync 873/udp rsync iclcnet-locate 886/tcp ICL coNETion locate server iclcnet-locate 886/udp ICL coNETion locate server iclcnet_svinfo 887/tcp ICL coNETion server info iclcnet_svinfo 887/udp ICL coNETion server info accessbuilder 888/tcp AccessBuilder accessbuilder 888/udp AccessBuilder cddbp 888/tcp CD Database Protocol omginitialrefs 900/tcp OMG Initial Refs omginitialrefs 900/udp OMG Initial Refs smpnameres 901/tcp SMPNAMERES smpnameres 901/udp SMPNAMERES ideafarm-door 902/tcp self documenting Telnet Door ideafarm-door 902/udp self documenting Door they MUST NOT be shipped as defaults in implementations See RFC for details REGISTERED PORT NUMBERS The Registered Ports are listed by the IANA and on most systems can be used by ordinary user processes or programs executed by ordinary users Ports are used in the TCP[RFC793] to name the ends of logical connections which carry long term conversations For the purpose of providing services to unknown a service contact port is defined This list specifies the port used by the server process as its contact port The IANA registers uses of these ports as a convenience to the community To the extent these same port assignments are used with the UDP[RFC768] The Registered Ports are in the range Port Event Listener Service els udp E L S
#define TERP_INSTANCE_TRUE_OR_RETURN_FALSE(value, message)
Checks if value is true. For false values a warning message will be logged, the current instance erro...
Definition: Macros.h:200
bool setOutputRasterPalette(const unsigned int size)
Create and set the output raster palette folowing the current internal settings.
std::vector< std::vector< double > > m_clustersMeans
The previously estimated means of the clusters (optional).
te::rp::ClassifierStrategy * build()
Concrete factories (derived from this one) must implement this method in order to create objects...
static PointSetIterator begin(const te::rst::Raster *r, const std::vector< te::gm::Point * > p)
Returns an iterator referring to the first value of the band.
double m_epsilon
The stop criteria. When the clusters change in a value smaller then epsilon, the convergence is achie...