/**
 * Chebyshev Coefficients are calculated by performing a Chebyshev transform,
 * and generating a histogram of pixel intensities.
 *
 */
std::vector<double> ChebyshevCoefficients::calculate( ImageMatrix * IN_matrix )
{
	std::vector<double> coeffs;
	std::cout << "calculating " << name << std::endl;
	if( IN_matrix == NULL ) {
		return coeffs;
	}
	coeffs.reserve(n_features-1);
	double temp_vec [32];

	ImageMatrix * temp = IN_matrix->duplicate();
	for( int i = 0; i < n_features; i++ ) temp_vec[i] = 0;
	temp->ChebyshevStatistics2D(temp_vec, 0, 32);
	delete temp;
	coeffs.assign( temp_vec, temp_vec + n_features);

	return coeffs;
}