/*********************************************************************
 * This file is part of the PRAPI library.
 *
 * Copyright (C) 2001 Topi Mäenpää and Jaakko Viertola
 * All rights reserved.
 *
 * This program is free software. You can redistribute and/or modify
 * it under the terms of the free software licence found in the
 * accompanying file "COPYING". The licence terms must always be
 * redistributed with this source file. The above copyright notice
 * must be reproduced in all modified and unmodified copies of this
 * source file.
 *
 * $Revision: 1.7 $
 *********************************************************************/

#ifndef _JAINANDHEALEYFEATUREEXTRACTOR_H
#define _JAINANDHEALEYFEATUREEXTRACTOR_H

#include "../FeatureExtractor.h"
#include "../RGBColorImage.h"
#include <Matrix.h>
#include <Exception.h>

namespace prapi {	namespace extras {
	/**
	 * JHExtarctor.
	 **/
	class JHExtractor : public FeatureExtractor<double,RGBColorImage<> >
	{
	public:
		/**
		 * Calculates the FeatureVector.
		 **/
		util::List<double> getFeatureVector(const RGBColorImage<>& img) throw (FeatureExtractionException&);
		/**
		 * Calculates the feature from the image.
		 **/
		double calculateFeature(util::Matrix<double>& mat);
		/**
		 * Calculate the opponent feature.
		 **/
		double calculateOpponentFeature(util::Matrix<double>& mat1, double val1, util::Matrix<double>& mat2, double val2);
		/**
		 * Filters the image.
		 **/
		util::Matrix<double> getFilteredImage(const util::Matrix<double>& mat, int orientation, int scale) throw (InvalidArgumentException&);
		/**
		 * Get the Gabor mask.
		 *
		 * @param orientation The orientation of mask (0->3 means 0, pi/4, pi/2, 3pi/4)
		 * @param scale The scale of mask (0->2 [35,17,9])
		 **/
		static util::Matrix<double> getGaborMask(int orientation, int scale) throw (InvalidArgumentException&);
	};
}}

#endif
