Commit a991e359 authored by Manuel Grizonnet's avatar Manuel Grizonnet

BUG:correct channel setter in otbradiometricattributeslabelmapfilter

parent def4a80c
......@@ -37,8 +37,8 @@ RadiometricAttributesLabelMapFilter<TImage, TFeatureImage>
::GenerateData()
{
GEMIFilterPointerType gemi = GEMIFilterType::New();
gemi->SetRedIndex(m_RedChannelIndex);
gemi->SetNIRIndex(m_NIRChannelIndex);
gemi->SetRedIndex(m_RedChannelIndex+1);
gemi->SetNIRIndex(m_NIRChannelIndex+1);
gemi->SetInput(this->GetFeatureImage());
StatisticsLabelMapFilterPointerType stats1 = StatisticsLabelMapFilterType::New();
......@@ -48,8 +48,8 @@ RadiometricAttributesLabelMapFilter<TImage, TFeatureImage>
stats1->SetReducedAttributeSet(m_ReducedAttributeSet);
NDVIFilterPointerType ndvi = NDVIFilterType::New();
ndvi->SetRedIndex(m_RedChannelIndex);
ndvi->SetNIRIndex(m_NIRChannelIndex);
ndvi->SetRedIndex(m_RedChannelIndex+1);
ndvi->SetNIRIndex(m_NIRChannelIndex+1);
ndvi->SetInput(this->GetFeatureImage());
StatisticsLabelMapFilterPointerType stats2 = StatisticsLabelMapFilterType::New();
......@@ -59,8 +59,8 @@ RadiometricAttributesLabelMapFilter<TImage, TFeatureImage>
stats2->SetReducedAttributeSet(m_ReducedAttributeSet);
IRFilterPointerType ir = IRFilterType::New();
ir->SetGreenIndex(m_GreenChannelIndex);
ir->SetRedIndex(m_RedChannelIndex);
ir->SetGreenIndex(m_GreenChannelIndex+1);
ir->SetRedIndex(m_RedChannelIndex+1);
ir->SetInput(this->GetFeatureImage());
StatisticsLabelMapFilterPointerType stats3 = StatisticsLabelMapFilterType::New();
......@@ -70,8 +70,8 @@ RadiometricAttributesLabelMapFilter<TImage, TFeatureImage>
stats3->SetReducedAttributeSet(m_ReducedAttributeSet);
ICFilterPointerType ic = ICFilterType::New();
ic->SetGreenIndex(m_GreenChannelIndex);
ic->SetRedIndex(m_RedChannelIndex);
ic->SetGreenIndex(m_GreenChannelIndex+1);
ic->SetRedIndex(m_RedChannelIndex+1);
ic->SetInput(this->GetFeatureImage());
StatisticsLabelMapFilterPointerType stats4 = StatisticsLabelMapFilterType::New();
......@@ -81,8 +81,8 @@ RadiometricAttributesLabelMapFilter<TImage, TFeatureImage>
stats4->SetReducedAttributeSet(m_ReducedAttributeSet);
IBFilterPointerType ib = IBFilterType::New();
ib->SetGreenIndex(m_GreenChannelIndex);
ib->SetRedIndex(m_RedChannelIndex);
ib->SetGreenIndex(m_GreenChannelIndex+1);
ib->SetRedIndex(m_RedChannelIndex+1);
ib->SetInput(this->GetFeatureImage());
StatisticsLabelMapFilterPointerType stats5 = StatisticsLabelMapFilterType::New();
......@@ -92,8 +92,8 @@ RadiometricAttributesLabelMapFilter<TImage, TFeatureImage>
stats5->SetReducedAttributeSet(m_ReducedAttributeSet);
NDWI2FilterPointerType ndwi2 = NDWI2FilterType::New();
ndwi2->GetFunctor().SetGIndex(m_GreenChannelIndex);
ndwi2->GetFunctor().SetNIRIndex(m_NIRChannelIndex);
ndwi2->GetFunctor().SetGIndex(m_GreenChannelIndex+1);
ndwi2->GetFunctor().SetNIRIndex(m_NIRChannelIndex+1);
ndwi2->SetInput(this->GetFeatureImage());
StatisticsLabelMapFilterPointerType stats6 = StatisticsLabelMapFilterType::New();
......
......@@ -60,11 +60,11 @@ ADD_TEST(trTeOBIARadiometricAttributesLabelMapFilterTest ${EXE_TESTS}
${TEMP}/OBIARadiometricAttributes.tif
${TEMP}/qb_RoadExtract_Radiometry_pretty.png
STATS::Ndvi::Mean
1
-0.3
0
0.5
16
16
10
50
1.0
)
......
......@@ -19,7 +19,7 @@
// Software Guide : BeginCommandLineArgs
// INPUTS: {qb_RoadExtract.tif}
// OUTPUTS: {OBIARadiometricAttribute1.tif}, {qb_ExtractRoad_Radiometry_pretty.png}
// STATS::Ndvi::Mean 0 -0.3 16 16 10 1.0
// STATS::Ndvi::Mean 0 0.5 16 16 50 1.0
// Software Guide : EndCommandLineArgs
// Software Guide : BeginLatex
......@@ -167,11 +167,6 @@ int main(int argc, char * argv[])
ShapeLabelMapFilterType::Pointer shapeLabelMapFilter = ShapeLabelMapFilterType::New();
shapeLabelMapFilter->SetInput(labelMapFilter->GetOutput());
StatisticsLabelMapFilterType::Pointer statisticsLabelMapFilter = StatisticsLabelMapFilterType::New();
statisticsLabelMapFilter->SetInput1(shapeLabelMapFilter->GetOutput());
statisticsLabelMapFilter->SetInput2(reader->GetOutput());
statisticsLabelMapFilter->Update();
// Software Guide : BeginLatex
//
// Instantiate the \doxygen{otb}{RadiometricAttributesLabelMapFilter} to
......@@ -182,7 +177,8 @@ int main(int argc, char * argv[])
// Software Guide : BeginCodeSnippet
RadiometricLabelMapFilterType::Pointer radiometricLabelMapFilter
= RadiometricLabelMapFilterType::New();
radiometricLabelMapFilter->SetInput1(statisticsLabelMapFilter->GetOutput());
radiometricLabelMapFilter->SetInput1(shapeLabelMapFilter->GetOutput());
radiometricLabelMapFilter->SetInput2(vreader->GetOutput());
// Software Guide : EndCodeSnippet
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment