BinaryMorphologicalOperation : different behaviour between CLI dans Python interface
Description
I'm using BinaryMorphologicalOperation to clean a water mask. I've observed different results whether I was using it in a Python script or with the command line.
My code is very simple :
app = otbApplication.Registry.CreateApplication("BinaryMorphologicalOperation")
app.SetParameterInputImage("in",thresholdNDWI.GetParameterOutputImage("out"))
app.SetParameterString("out",outputfilename)
app.SetParameterString("structype","ball")
app.SetParameterFloat("structype.ball.xradius", radius)
app.SetParameterFloat("structype.ball.yradius", radius)
app.SetParameterString("filter","closing")
app.ExecuteAndWriteOutput()
Here is the input image : This is the result with the CLI and radius 2.0 This is the result with the CLI and radius 5.0
This is the result with Python interface and radius 2.0 This is the result with Python interface and radius 5.0
=> the result obtained with Python script and a radius of 2.0 seems similar to the one obtaind with CLI and default radius (5.0). The one with Python script and radius of 5.0 looks like a kind of erosion...
I don't know how to fix the parameters in my Python script so my result looks like the one with CLI and radius of 2.0
Steps to reproduce
The full size input image is attached below. input_image.zip
Configuration information
OTB 6.6.1-python3 on Linux Redhat 7.