Create mask problem (urgent)

Dear @ipodsky,

To answer your question 1, let’s have a look at the application’s parameters:

Parameters: 
    -in                    <string>         Input image  (mandatory)
    -out                   <string> [pixel] Output Image  [pixel=uint8/uint16/int16/uint32/int32/float/double/cint16/cint32/cfloat/cdouble] (default value is float) (mandatory)
    -usenan                <boolean>        Consider NaN as no-data  (mandatory, default value is false)
    -mode                  <string>         No-data handling mode [buildmask/changevalue/apply] (mandatory, default value is buildmask)
    -mode.buildmask.inv    <float>          Inside Value  (mandatory, default value is 1)
    -mode.buildmask.outv   <float>          Outside Value  (mandatory, default value is 0)
    -mode.changevalue.newv <float>          The new no-data value  (mandatory, default value is 0)
    -mode.apply.mask       <string>         Mask image  (mandatory)
    -mode.apply.ndval      <float>          Nodata value used  (mandatory, default value is 0)
    -ram                   <int32>          Available RAM (MB)  (optional, off by default, default value is 256)
    -progress              <boolean>        Report progress 
    -help                  <string list>    Display long help (empty list), or help for given parameters keys

We can see that the inside and outside values are set with respectively -mode.buildmask.inv and -mode.buildmask.outv. For example, I could run the application with this command:

otbcli_ManageNoData -in input_image.tiff -out output_image.tiff -mode buildmask -mode.buildmask.inv 42. -mode.buildmask.outv 3.14

The other parameter you are looking for is -mode.changevalue.newv to provide the new value for no_data. For example:

otbcli_ManageNoData -in input_image.tiff -out output_image.tiff -mode changevalue -mode.changevalue.newv 1.618

About question 2, you have to use the parameter -classifier.ann.sizes in order to specify the size (the number of neurons) of the intermediate layers for your network. For example, if my network has 3 intermediates layers with respectively 15, 10 and 5 neurons:

otbcli_TrainImagesClassifier -io.il input_image1.tif input_image2.tif -io.vd input_vector1 input_vector2 -io.out output_model.txt -classifier ann -classifier.ann.sizes 15 10 5

The error you describe in question 3 happens when someone sets a value with a bad format (for example, a string when expecting an integer). Your guess is probably right, try again with a correct -classifier.ann.sizes and this error should disappear.

Best regards.

1 Like