Commit 3981da8c authored by Gaëlle USSEGLIO's avatar Gaëlle USSEGLIO

Merge branch 'develop' of https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb into CosmoSpotLight

parents a514b3c0 3fc1725a
PROJCS["RGF93_Lambert_93",GEOGCS["GCS_RGF93",DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["Meter",1]]
\ No newline at end of file
......@@ -83,9 +83,12 @@ def GetApplicationExamplePythonSnippet(app,idx,expand = False, inputpath="",outp
paramtype = app.GetParameterType(param)
paramrole = app.GetParameterRole(param)
if paramtype == ParameterType_ListView:
break # TODO
if app.GetListViewSingleSelectionMode(param):
output += "\t" + appname + ".SetParameterString("+EncloseString(param)+", "+EncloseString(value)+")"
else:
output += "\t" + appname + ".SetParameterStringList("+EncloseString(param)+", "+EncloseString(value)+")"
if paramtype == ParameterType_Group:
break # TODO
pass
if paramtype == ParameterType_Choice:
#app.SetParameterString(param,value)
output+= "\t" + appname + ".SetParameterString(" + EncloseString(param) + "," + EncloseString(value) + ")"
......
......@@ -389,43 +389,10 @@ happens, this documentation will report the OTB version that fixes the issue.
Calling UpdateParameters()
^^^^^^^^^^^^^^^^^^^^^^^^^^
These wrappers are made as a mirror of the C++ API, so there is a function
``UpdateParameters()``. Its role is to update parameters that depend on others.
It is called at least once at the beginning of ``Execute()``.
In command line and GUI launchers, this functions gets called each time a
parameter of the application is modified. In Python, this mechanism is not
automated: there are cases where you may have to call it yourself.
Let's take an example with the application ``PolygonClassStatictics``. In this
application, the choices available in the parameter ``field`` depend on the list
of fields actually present in the vector file ``vec``. If you try to set the
parameters ``vec`` and ``field``, you will get an error:
.. code-block:: python
import otbApplication as otb
app = otb.Registry.CreateApplication("PolygonClassStatistics")
app.SetParameterString("vec","../../src/OTB-Data/Input/Classification/variousVectors.sqlite")
app.SetParameterString("field", "label")
::
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/gpasero/Projet_OTB/build/OTB/lib/otb/python/otbApplication.py", line 897, in SetParameterString
def SetParameterString(self, *args): return _otbApplication.Application_SetParameterString(self, *args)
RuntimeError: Exception thrown in otbApplication Application_SetParameterString: /home/gpasero/Projet_OTB/src/OTB/Modules/Wrappers/ApplicationEngine/src/otbWrapperListViewParameter.cxx:141:
itk::ERROR: ListViewParameter(0x149da10): Cannot find label
The error says that the choice ``label`` is not recognized, because ``UpdateParameters()``
was not called after setting the vector file. The solution is to call it before
setting the ``field`` parameter:
.. code-block:: python
app.UpdateParameters()
app.SetParameterString("field", "label")
``UpdateParameters()`` is available to the Python API. But in normal use, it
does not need to be called manually. From OTB 7.0.0 and later, it is called
automatically after each call to ``SetParameter*()`` methods. With previous versions
of OTB you may need to call it after setting a parameter.
No metadata in NumPy arrays
^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
......@@ -185,7 +185,7 @@ public:
}
protected:
CurlFileDescriptorResource(){}
CurlFileDescriptorResource(): m_File(nullptr) {}
~CurlFileDescriptorResource() override
{
......@@ -195,9 +195,9 @@ protected:
private:
FILE * m_File;
// prevent copying and assignment; not implemented
CurlFileDescriptorResource (const CurlFileDescriptorResource &);
CurlFileDescriptorResource & operator= (const CurlFileDescriptorResource &);
// prevent copying and assignment
CurlFileDescriptorResource (const CurlFileDescriptorResource &) = delete;
CurlFileDescriptorResource & operator= (const CurlFileDescriptorResource &) = delete;
}; //end of class FileResource
#endif // OTB_USE_CURL
......
......@@ -215,8 +215,22 @@ private:
// Beware that itemIndex differs from ogr layer field index
unsigned int itemIndex = GetSelectedItems("feat")[idx];
std::string fieldName = GetChoiceNames( "feat" )[itemIndex];
switch ((*it)[fieldName].GetType())
{
case OFTInteger:
mv[idx] = static_cast<ValueType>((*it)[fieldName].GetValue<int>());
break;
case OFTInteger64:
mv[idx] = static_cast<ValueType>((*it)[fieldName].GetValue<int>());
break;
case OFTReal:
mv[idx] = static_cast<ValueType>((*it)[fieldName].GetValue<double>());
break;
default:
itkExceptionMacro(<< "incorrect field type: " << (*it)[fieldName].GetType() << ".");
}
mv[idx] = static_cast<ValueType>((*it)[fieldName].GetValue<double>());
}
input->PushBack(mv);
}
......@@ -369,7 +383,23 @@ private:
ogr::Feature dstFeature(outLayer.GetLayerDefn());
dstFeature.SetFrom( *it , TRUE);
dstFeature.SetFID(it->GetFID());
dstFeature[classfieldname].SetValue<int>(target->GetMeasurementVector(count)[0]);
switch (dstFeature[classfieldname].GetType())
{
case OFTInteger:
dstFeature[classfieldname].SetValue<int>(target->GetMeasurementVector(count)[0]);
break;
case OFTInteger64:
dstFeature[classfieldname].SetValue<int>(target->GetMeasurementVector(count)[0]);
break;
case OFTReal:
dstFeature[classfieldname].SetValue<double>(target->GetMeasurementVector(count)[0]);
break;
case OFTString:
dstFeature[classfieldname].SetValue<std::string>(std::to_string(target->GetMeasurementVector(count)[0]));
break;
default:
itkExceptionMacro(<< "incorrect field type: " << dstFeature[classfieldname].GetType() << ".");
}
if (computeConfidenceMap)
dstFeature[confFieldName].SetValue<double>(quality->GetMeasurementVector(count)[0]);
if (updateMode)
......
......@@ -65,7 +65,7 @@ public:
typedef typename Superclass::SampleType SampleType;
typedef typename Superclass::ListSampleType ListSampleType;
typedef typename Superclass::TargetListSampleType TargetListSampleType;
typedef double ValueType;
typedef itk::VariableLengthVector <ValueType> MeasurementType;
......@@ -127,7 +127,10 @@ protected:
{
m_SelectedCFieldIdx = selectedCFieldIdx;
// Handle only one class field name, if several are provided only the first one is used.
m_SelectedCFieldName = selectedCFieldIdx.empty() ? cFieldNames.front() : cFieldNames[selectedCFieldIdx.front()];
if (selectedCFieldIdx.empty())
m_SelectedCFieldName.clear();
else
m_SelectedCFieldName = cFieldNames[selectedCFieldIdx.front()];
}
};
......@@ -185,12 +188,6 @@ protected:
void DoInit() override;
void DoUpdateParameters() override;
void DoExecute() override;
private:
/**
* Get the field of the input feature corresponding to the input field
*/
inline TOutputValue GetFeatureField(const ogr::Feature& feature, int field);
};
}
......
......@@ -237,23 +237,6 @@ TrainVectorBase<TInputValue, TOutputValue>
return measurement;
}
// Template specialization for the integer case (i.e.classification), to avoid a cast from double to integer
template <>
inline int
TrainVectorBase<float, int>
::GetFeatureField(const ogr::Feature & feature, int fieldIndex)
{
return(feature[fieldIndex].GetValue<int>());
}
template <class TInputValue, class TOutputValue>
inline TOutputValue
TrainVectorBase<TInputValue, TOutputValue>
::GetFeatureField(const ogr::Feature & feature, int fieldIndex)
{
return(feature[fieldIndex].GetValue<double>());
}
template <class TInputValue, class TOutputValue>
typename TrainVectorBase<TInputValue, TOutputValue>::SamplesWithLabel
TrainVectorBase<TInputValue, TOutputValue>
......@@ -310,12 +293,45 @@ TrainVectorBase<TInputValue, TOutputValue>
MeasurementType mv;
mv.SetSize( m_FeaturesInfo.m_NbFeatures );
for( unsigned int idx = 0; idx < m_FeaturesInfo.m_NbFeatures; ++idx )
mv[idx] = feature[featureFieldIndex[idx]].GetValue<double>();
{
switch (feature[featureFieldIndex[idx]].GetType())
{
case OFTInteger:
mv[idx] = static_cast<ValueType>(feature[featureFieldIndex[idx]].GetValue<int>());
break;
case OFTInteger64:
mv[idx] = static_cast<ValueType>(feature[featureFieldIndex[idx]].GetValue<int>());
break;
case OFTReal:
mv[idx] = static_cast<ValueType>(feature[featureFieldIndex[idx]].GetValue<double>());
break;
default:
itkExceptionMacro(<< "incorrect field type: " << feature[featureFieldIndex[idx]].GetType() << ".");
}
}
input->PushBack( mv );
if(cFieldIndex>=0 && ogr::Field(feature,cFieldIndex).HasBeenSet())
target->PushBack(GetFeatureField(feature,cFieldIndex));
{
switch (feature[cFieldIndex].GetType())
{
case OFTInteger:
target->PushBack(static_cast<ValueType>(feature[cFieldIndex].GetValue<int>()));
break;
case OFTInteger64:
target->PushBack(static_cast<ValueType>(feature[cFieldIndex].GetValue<int>()));
break;
case OFTReal:
target->PushBack(static_cast<ValueType>(feature[cFieldIndex].GetValue<double>()));
break;
case OFTString:
target->PushBack(static_cast<ValueType>(std::stod(feature[cFieldIndex].GetValue<std::string>())));
break;
default:
itkExceptionMacro(<< "incorrect field type: " << feature[featureFieldIndex[cFieldIndex]].GetType() << ".");
}
}
else
target->PushBack( 0. );
......
......@@ -129,7 +129,9 @@ private:
otb::ogr::DataSource::New(shapefile, otb::ogr::DataSource::Modes::Read);
otb::ogr::Layer layer = source->GetLayer(0);
ListSampleType::Pointer input = ListSampleType::New();
const int nbFeatures = GetParameterStringList("feat").size();
const auto inputIndexes = GetParameterStringList("feat");
const int nbFeatures = inputIndexes.size();
input->SetMeasurementVectorSize(nbFeatures);
otb::ogr::Layer::const_iterator it = layer.cbegin();
......@@ -140,7 +142,20 @@ private:
mv.SetSize(nbFeatures);
for(int idx=0; idx < nbFeatures; ++idx)
{
mv[idx] = (*it)[GetParameterStringList("feat")[idx]].GetValue<double>();
switch ((*it)[inputIndexes[idx]].GetType())
{
case OFTInteger:
mv[idx] = static_cast<ValueType>((*it)[inputIndexes[idx]].GetValue<int>());
break;
case OFTInteger64:
mv[idx] = static_cast<ValueType>((*it)[inputIndexes[idx]].GetValue<int>());
break;
case OFTReal:
mv[idx] = static_cast<ValueType>((*it)[inputIndexes[idx]].GetValue<double>());
break;
default:
itkExceptionMacro(<< "incorrect field type: " << (*it)[inputIndexes[idx]].GetType() << ".");
}
}
input->PushBack(mv);
}
......
......@@ -221,7 +221,20 @@ private:
for(int idx=0; idx < nbFeatures; ++idx)
{
mv[idx] = static_cast<float>( (*it)[inputIndexes[idx]].GetValue<double>() );
switch ((*it)[inputIndexes[idx]].GetType())
{
case OFTInteger:
mv[idx] = static_cast<ValueType>((*it)[inputIndexes[idx]].GetValue<int>());
break;
case OFTInteger64:
mv[idx] = static_cast<ValueType>((*it)[inputIndexes[idx]].GetValue<int>());
break;
case OFTReal:
mv[idx] = static_cast<ValueType>((*it)[inputIndexes[idx]].GetValue<double>());
break;
default:
itkExceptionMacro(<< "incorrect field type: " << (*it)[inputIndexes[idx]].GetType() << ".");
}
}
input->PushBack(mv);
}
......@@ -399,7 +412,23 @@ private:
for (std::size_t i=0; i<outFields.size(); ++i)
{
dstFeature[outFields[i]].SetValue<double>(target->GetMeasurementVector(count)[i]);
switch (dstFeature[outFields[i]].GetType())
{
case OFTInteger:
dstFeature[outFields[i]].SetValue<int>(target->GetMeasurementVector(count)[0]);
break;
case OFTInteger64:
dstFeature[outFields[i]].SetValue<int>(target->GetMeasurementVector(count)[0]);
break;
case OFTReal:
dstFeature[outFields[i]].SetValue<double>(target->GetMeasurementVector(count)[0]);
break;
case OFTString:
dstFeature[outFields[i]].SetValue<std::string>(std::to_string(target->GetMeasurementVector(count)[0]));
break;
default:
itkExceptionMacro(<< "incorrect field type: " << dstFeature[outFields[i]].GetType() << ".");
}
}
if (updateMode)
{
......
......@@ -374,18 +374,7 @@ private:
bool CropRegionOfInterest()
{
FloatVectorImageType::RegionType region;
if ( !HasUserValue("sizex") )
SetParameterInt( "sizex" ,
GetDefaultParameterInt( "sizex" ) );
if ( !HasUserValue("sizey") )
SetParameterInt( "sizey" ,
GetDefaultParameterInt( "sizey" ) );
if ( !HasUserValue("startx") )
SetParameterInt( "startx" ,
GetDefaultParameterInt( "startx" ) );
if ( !HasUserValue("starty") )
SetParameterInt( "starty" ,
GetDefaultParameterInt( "starty" ) );
region.SetSize(0, GetParameterInt("sizex"));
region.SetSize(1, GetParameterInt("sizey"));
region.SetIndex(0, GetParameterInt("startx"));
......
......@@ -123,7 +123,7 @@ public:
const RegionType& region) override;
protected:
ImageRegionTileMapSplitter() : m_AlignStep(256){}
ImageRegionTileMapSplitter() : m_SplitsPerDimension{0}, m_AlignStep(256) {}
~ImageRegionTileMapSplitter() override {}
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
......
......@@ -41,6 +41,7 @@ template<class TInput = double, class TOutput = double>
class BlackmanWindowFunction
{
public:
BlackmanWindowFunction(): m_Radius(1), m_Factor1(CONST_PI), m_Factor2(2.0 * CONST_PI) {} // default radius is 1 at construction
void SetRadius(unsigned int radius)
{
m_Radius = radius;
......@@ -95,8 +96,7 @@ template<class TInputImage, class TBoundaryCondition = itk::ConstantBoundaryCond
double, class TInputInterpolator = double, class TOutputInterpolator = double>
class ITK_EXPORT WindowedSincInterpolateImageBlackmanFunction :
public WindowedSincInterpolateImageFunctionBase<TInputImage,
typename Function::BlackmanWindowFunction<TInputInterpolator,
TOutputInterpolator>,
typename Function::BlackmanWindowFunction<TInputInterpolator, TOutputInterpolator>,
TBoundaryCondition,
TCoordRep>
{
......
......@@ -41,6 +41,7 @@ template<class TInput = double, class TOutput = double>
class CosineWindowFunction
{
public:
CosineWindowFunction(): m_Radius(1), m_Factor(CONST_PI / 2.0) {} // default radius is 1 at construction
void SetRadius(unsigned int radius)
{
m_Radius = radius;
......@@ -63,9 +64,9 @@ public:
return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * std::sin(px) / px);
}
private:
unsigned int m_Radius;
// Equal to \f$ \frac{\pi}{2 m} \f$
double m_Factor;
unsigned int m_Radius;
};
} //namespace Function
......
......@@ -41,6 +41,7 @@ template<class TInput = double, class TOutput = double>
class GaussianWindowFunction
{
public:
GaussianWindowFunction(): m_Radius(1), m_Factor(-2.0 / CONST_PI) {} // default radius is 1 at construction
void SetRadius(unsigned int radius)
{
m_Radius = radius;
......@@ -63,8 +64,8 @@ public:
return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * std::sin(px) / px);
}
private:
double m_Factor;
unsigned int m_Radius;
double m_Factor;
};
} //namespace Function
......
......@@ -41,6 +41,7 @@ template<class TInput = double, class TOutput = double>
class HammingWindowFunction
{
public:
HammingWindowFunction(): m_Radius(1), m_Factor(CONST_PI) {} // default radius is 1 at construction
void SetRadius(unsigned int radius)
{
m_Radius = radius;
......@@ -63,9 +64,9 @@ public:
return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * std::sin(px) / px);
}
private:
unsigned int m_Radius;
// Equal to \f$ \frac{\pi}{m} \f$
double m_Factor;
unsigned int m_Radius;
};
} //namespace Function
......
......@@ -43,6 +43,7 @@ template<class TInput = double, class TOutput = double>
class LanczosWindowFunction
{
public:
LanczosWindowFunction(): m_Radius(1), m_Factor(CONST_PI) {} // default factor is 1 at construction
void SetRadius(unsigned int radius)
{
m_Radius = radius;
......@@ -74,9 +75,9 @@ public:
return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * std::sin(px) / px);
}
private:
unsigned int m_Radius;
// Equal to \f$ \frac{\pi}{m} \f$
double m_Factor;
unsigned int m_Radius;
};
} //namespace Function
......
......@@ -41,6 +41,7 @@ template<class TInput = double, class TOutput = double>
class WelchWindowFunction
{
public:
WelchWindowFunction() : m_Radius(1), m_Factor(1) {} // default radius is 1 at construction
void SetRadius(unsigned int radius)
{
m_Radius = radius;
......@@ -63,9 +64,9 @@ public:
return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * std::sin(px) / px);
}
private:
unsigned int m_Radius;
// Equal to \f$ \frac{1}{m^2} \f$
double m_Factor;
unsigned int m_Radius;
};
} //namespace Function
......
......@@ -32,7 +32,7 @@ namespace otb
*/
template <class TInputPointSet, class TOutputPointSet>
PointSetExtractROI<TInputPointSet, TOutputPointSet>
::PointSetExtractROI()
::PointSetExtractROI() : m_StartX(0), m_StartY(0), m_SizeX(0), m_SizeY(0)
{
}
......
......@@ -34,9 +34,8 @@ namespace otb
*/
template <class TInputImage, class TOutputImage>
EstimateInnerProductPCAImageFilter<TInputImage, TOutputImage>
::EstimateInnerProductPCAImageFilter()
::EstimateInnerProductPCAImageFilter(): m_NumberOfPrincipalComponentsRequired(1), m_CenterData(true)
{
m_NumberOfPrincipalComponentsRequired = 1;
}
/**
......
......@@ -36,6 +36,7 @@ InnerProductPCAImageFilter<TInputImage, TOutputImage>
this->SetNthOutput(0, OutputImageType::New());
m_EstimatePCAFilter = EstimatePCAFilterType::New();
m_NormalizePCAFilter = NormalizePCAFilterType::New();
m_NumberOfPrincipalComponentsRequired = 1;
m_CenterData = true;
m_GenerateMeanComponent = false;
m_MeanFilter = MeanFilterType::New();
......
......@@ -36,14 +36,18 @@ namespace otb
*/
template <class TInputImage, class TOutputImage, class TFunction>
MultiChannelsPolarimetricSynthesisFilter<TInputImage, TOutputImage, TFunction>
::MultiChannelsPolarimetricSynthesisFilter()
::MultiChannelsPolarimetricSynthesisFilter():
m_PsiI(0.0),
m_KhiI(0.0),
m_PsiR(0.0),
m_KhiR(0.0),
m_Gain(1.0),
m_Mode(0),
m_EmissionH(false),
m_EmissionV(false)
{
this->SetNumberOfRequiredInputs(1);
this->InPlaceOff();
SetEmissionH(false);
SetEmissionV(false);
SetGain(1);
SetMode(0);
m_ArchitectureType = PolarimetricData::New();
}
......
......@@ -59,10 +59,12 @@ class SpatialRangeJointDomainTransform
public:
typedef double RealType;
SpatialRangeJointDomainTransform()
SpatialRangeJointDomainTransform():
m_ImageDimension(0),
m_NumberOfComponentsPerPixel(0),
m_OutputSize(0)
{
}
// ~SpatialRangeJointDomainTransform() {}
typename TOutputJointImage::PixelType operator()(const typename TInputImage::PixelType & inputPixel,
const typename TInputImage::IndexType & index) const
......
......@@ -155,11 +155,6 @@ GDALOverviewsBuilder
if( factor<=1 )
return 0;
assert( minSize>0 );
if( minSize<=0 )
return 0;
assert( !m_GDALDataset.IsNull() );
// unsigned int minSize = static_cast< unsigned int >( pow( factor, n ) );
......
......@@ -43,7 +43,7 @@ void
ScalarBufferToImageFileWriter<TBufferType, TOutputPixelType>::GenerateData()
{
// Check image parameters
if( (m_ImageSize[0]==0) || (m_ImageSize[0]==0) )
if( (m_ImageSize[0]==0) || (m_ImageSize[1]==0) )
{
itkExceptionMacro("Invalid output image size, Size can't be null.");
}
......
......@@ -188,9 +188,8 @@ int main(int ac, char* av[])
}
// This is a dummy main to be registered as a test for the otbTestMain
int Execute(int argc, char * argv[])
int Execute(int, char * argv[])
{
argc -= 1;
argv += 1;
// Create the appropriate itk process
itksysProcess * process = itksysProcess_New();
......
......@@ -243,11 +243,6 @@ void
MarkovRandomFieldFilter<TInputImage, TClassifiedImage>
::Allocate()
{
if (m_NumberOfClasses <= 0)
{
throw itk::ExceptionObject(__FILE__, __LINE__, "NumberOfClasses <= 0.", ITK_LOCATION);
}
//Set the output labelled and allocate the memory
LabelledImagePointer outputPtr = this->GetOutput();
......
......@@ -260,7 +260,7 @@ DisparityMapMedianFilter< TInputImage, TOutputImage, TMask>
InputIt.SetLocation(outputIt.GetIndex());
for (unsigned int i=0; i<InputIt.Size(); i++)
{
if (!inputmaskPtr || (inputmaskPtr && MaskInputIt.GetPixel(i) != 0))
if (!inputmaskPtr || (MaskInputIt.GetPixel(i) != 0))
{
p++;
pixels.push_back(InputIt.GetPixel(i));
......@@ -347,7 +347,7 @@ DisparityMapMedianFilter< TInputImage, TOutputImage, TMask>
MaskInputIt.SetLocation(outputIt.GetIndex());
}
if ((!inputmaskPtr || (inputmaskPtr && MaskInputIt.GetCenterPixel() != 0)) &&
if ((!inputmaskPtr || (MaskInputIt.GetCenterPixel() != 0)) &&
std::fabs(InputIt.GetCenterPixel() - MedianIt.Get())>m_IncoherenceThreshold)
{
outputDisparityMapIt.Set(0.0); //Remove pixel from disparity map//
......
......@@ -670,9 +670,9 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor>
((tmpIndex[1] - this->m_GridIndex[1] + this->m_Step) % this->m_Step == 0))
{
// If the mask is present and valid
if(!inLeftMaskPtr || (inLeftMaskPtr && inLeftMaskIt.Get() > 0) )
if(!inLeftMaskPtr || (inLeftMaskIt.Get() > 0) )
{
if(!inRightMaskPtr || (inRightMaskPtr && inRightMaskIt.Get() > 0) )
if(!inRightMaskPtr || (inRightMaskIt.Get() > 0) )
{
int estimatedMinHDisp = m_MinimumHorizontalDisparity;
int estimatedMinVDisp = m_MinimumVerticalDisparity;
......
......@@ -762,9 +762,9 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor>
inRightMaskIt.SetIndex(curRightPos);
}
// check that the current positions are not masked
if(!inLeftMaskPtr || (inLeftMaskPtr && inLeftMaskIt.Get() > 0) )
if(!inLeftMaskPtr || (inLeftMaskIt.Get() > 0) )
{
if(!inRightMaskPtr || (inRightMaskPtr && inRightMaskIt.Get() > 0) )
if(!inRightMaskPtr || (inRightMaskIt.Get() > 0) )
{
RegionType smallRightRegion;
smallRightRegion.SetIndex(0,curRightPos[0]-1);
......@@ -1195,9 +1195,9 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor>
inRightMaskIt.SetIndex(curRightPos);
}
// check that the current positions are not masked
if(!inLeftMaskPtr || (inLeftMaskPtr && inLeftMaskIt.Get() > 0) )
if(!inLeftMaskPtr || (inLeftMaskIt.Get() > 0) )
{
if(!inRightMaskPtr || (inRightMaskPtr && inRightMaskIt.Get() > 0) )
if(!inRightMaskPtr || (inRightMaskIt.Get() > 0) )
{
RegionType smallRightRegion;
smallRightRegion.SetIndex(0,curRightPos[0]-1);
......@@ -1696,9 +1696,9 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor>
inRightMaskIt.SetIndex(curRightPos);
}
// check that the current positions are not masked
if(!inLeftMaskPtr || (inLeftMaskPtr && inLeftMaskIt.Get() > 0) )
if(!inLeftMaskPtr || (inLeftMaskIt.Get() > 0) )
{
if(!inRightMaskPtr || (inRightMaskPtr && inRightMaskIt.Get() > 0) )
if(!inRightMaskPtr || (inRightMaskIt.Get() > 0) )
{
RegionType smallRightRegion;
smallRightRegion.SetIndex(0,curRightPos[0]-1);
......
......@@ -203,6 +203,35 @@ public:
#endif
#if SWIGPYTHON
// We want all SetParameterXXX functions to call UpdateParameters automaticaly