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