grmFullLambdaScheduleSegmenter.h 1.57 KB
Newer Older
Pierre Lassalle's avatar
Pierre Lassalle committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*=========================================================================

  Program: Generic Region Merging Library
  Language: C++
  author: Lassalle Pierre
  contact: lassallepierre34@gmail.com



  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved


     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
Pierre Lassalle's avatar
Pierre Lassalle committed
18 19
#ifndef GRM_FULL_LAMBDA_SCHEDULE_SEGMENTER_H
#define GRM_FULL_LAMBDA_SCHEDULE_SEGMENTER_H
Pierre Lassalle's avatar
Pierre Lassalle committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
#include "grmSegmenter.h"

namespace grm
{
	struct FLSNode : Node<FLSNode>
	{
		std::vector<float> m_Means;
	};

	struct FLSParam{};

	template<class TImage>
	class FullLambdaScheduleSegmenter : public Segmenter< TImage, FLSNode, FLSParam>
	{
	public:
		/* Some convenient typedefs */
		typedef Segmenter<TImage, FLSNode, FLSParam> Superclass;
		typedef TImage ImageType;
38 39
        typedef typename ImageType::PixelType PixelType;

Pierre Lassalle's avatar
Pierre Lassalle committed
40 41 42 43 44 45 46
		typedef typename Superclass::GraphType GraphType;
		typedef typename Superclass::NodePointerType NodePointerType;
		typedef typename Superclass::GraphOperatorType GraphOperatorType;
		typedef GraphToOtbImage<GraphType> IOType;

		float ComputeMergingCost(NodePointerType n1, NodePointerType n2);
		void UpdateSpecificAttributes(NodePointerType n1, NodePointerType n2);
47
		void UpdateSpecificAttributes(NodePointerType n, PixelType p);
Pierre Lassalle's avatar
Pierre Lassalle committed
48 49 50
	};
} // end of namespace grm
#include "grmFullLambdaScheduleSegmenter.txx"
51
#endif