BinaryMorphologicalOperation : different behaviour between CLI dans Python interface
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()
=> 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
OTB 6.6.1-python3 on Linux Redhat 7.