diff --git a/Applications/FeatureExtraction/otbHaralickTextureExtraction.cxx b/Applications/FeatureExtraction/otbHaralickTextureExtraction.cxx index 44f856c3d0cd5df1c7638231feaa0518fd7646ec..32b3863cd33b6ba6c5a3f004096e954d4d34948e 100644 --- a/Applications/FeatureExtraction/otbHaralickTextureExtraction.cxx +++ b/Applications/FeatureExtraction/otbHaralickTextureExtraction.cxx @@ -162,8 +162,9 @@ void DoExecute() { FloatVectorImageType::Pointer inImage = GetParameterImage("in"); inImage->UpdateOutputInformation(); + int nBComp = inImage->GetNumberOfComponentsPerPixel(); - if( GetParameterInt("channel") > inImage->GetNumberOfComponentsPerPixel() ) + if( GetParameterInt("channel") > nBComp ) { otbAppLogCRITICAL("Selected band is not available..."); return; diff --git a/Applications/FeatureExtraction/otbSFSTextureExtraction.cxx b/Applications/FeatureExtraction/otbSFSTextureExtraction.cxx index 7f6aec1f5fab6dd105173aa53c0d7c1ee5b4243e..b8d800372b52217c9491ee0761a6c9d9fc60b14c 100644 --- a/Applications/FeatureExtraction/otbSFSTextureExtraction.cxx +++ b/Applications/FeatureExtraction/otbSFSTextureExtraction.cxx @@ -125,8 +125,10 @@ void DoExecute() { FloatVectorImageType::Pointer inImage = GetParameterImage("in"); inImage->UpdateOutputInformation(); + int nBComp = inImage->GetNumberOfComponentsPerPixel(); - if( GetParameterInt("channel") > inImage->GetNumberOfComponentsPerPixel() ) + + if( GetParameterInt("channel") > nBComp ) { otbAppLogCRITICAL("Selected band is not available..."); return; diff --git a/Applications/RadiometricIndices/otbRadiometricIndices.cxx b/Applications/RadiometricIndices/otbRadiometricIndices.cxx index c86f021b91d527f7d97c1323c32acca0a516b6f2..a0b1f209f9f30331137ad97b9514a78a9619bf5b 100644 --- a/Applications/RadiometricIndices/otbRadiometricIndices.cxx +++ b/Applications/RadiometricIndices/otbRadiometricIndices.cxx @@ -483,7 +483,7 @@ private: void DoExecute() { - unsigned int nbChan = GetParameterImage("in")->GetNumberOfComponentsPerPixel(); + int nbChan = GetParameterImage("in")->GetNumberOfComponentsPerPixel(); if ( (this->GetParameterInt("channels.blue") <= nbChan) && (this->GetParameterInt("channels.green") <= nbChan)