Image::Ptr Image::getGrayscale( void ) const { if ( !isGrayscale() ) { // TODO: Has the image, if not grayscale, really three channels then? return CvtColor( CV_RGB2GRAY, 1, depth); } else { return Clone(); } }
/** * Tests to see if the input image is not grayscale and has more than three * samples per pixel, implying RGBA. * * @return True if the image is RGBA, false otherwise */ bool TiffImporter::isArgb() const { return !isGrayscale() && samplesPerPixel() > 3; }
/** * This method converts the image to grayscale. * * @return true if the image was converted to grayscale, else false */ bool fipImage::convertToGrayscale(){ pImageData = FreeImage_ConvertToGreyscale( pImageData ); return isGrayscale(); }