ObjectsRadiometricStatistics - failure with extended filenames?

Hi everyone

I’m running into some trouble running otbcli_ObjectsRadiometricStatistics on a segmented vector dataset with statistical reference (-im) to a 4-band pca image through extended filenames.

The command running on mac os (7.2.0) is performed as follows and it errors out with a Killed 9 message. I was wondering if this might be the case because ObjectsRadiometricStatistics may not support extended filenames and thus perhaps it tries to read all the bands resulting in a machine resources might be at issue?

otbcli_ObjectsRadiometricStatistics -in sh12_vnir_mosaic_rd_elc_rectified_pca_sp15_10_ndvi_pca_stats.sqlite -im “sh12_vnir_mosaic_rd_elc_rectified_pca_all_nd.tif?bands=1:4” -field cat -background 0
2021-03-14 14:12:19 (INFO) ObjectsRadiometricStatistics: Default RAM limit for OTB is 256 MB
2021-03-14 14:12:19 (INFO) ObjectsRadiometricStatistics: GDAL maximum cache size is 3276 MB
2021-03-14 14:12:19 (INFO) ObjectsRadiometricStatistics: OTB will use at most 12 threads
/Applications/OTB-7.2.0-Darwin64/bin/otbcli: line 55: 28189 Killed: 9
OTB_CLI_LAUNCHER "@"

I can actually get the program to complete on a singe band NDVI image with the same sqlite segmented vector dataset on the same machine.

otbcli_ObjectsRadiometricStatistics -in sh12_vnir_mosaic_rd_elc_rectified_pca_sp15_10_ndvi_stats.sqlite -im “sh12_vnir_mosaic_rd_elc_rectified_otb_ndvi.tif” -field cat -background -9999
2021-03-14 17:06:01 (INFO) ObjectsRadiometricStatistics: Default RAM limit for OTB is 256 MB
2021-03-14 17:06:01 (INFO) ObjectsRadiometricStatistics: GDAL maximum cache size is 3276 MB
2021-03-14 17:06:01 (INFO) ObjectsRadiometricStatistics: OTB will use at most 12 threads

I thought this might be a resource issue so I ran the same command on anther machine with 2x the cores and 2x the RAM, however, it errors out again with the same Killed 9 message.

otbcli_ObjectsRadiometricStatistics -in Screen Shot 2021-03-15 at 11.03.41 AM sh12_vnir_mosaic_rd_elc_rectified_pca_sp15_10_ndvi_pca_stats.sqlite -im “sh12_vnir_mosaic_rd_elc_rectified_pca_all_nd.tif?bands=1:4” -field cat -background 0
2021-03-15 07:43:56 (INFO) ObjectsRadiometricStatistics: Default RAM limit for OTB is 256 MB
2021-03-15 07:43:56 (INFO) ObjectsRadiometricStatistics: GDAL maximum cache size is 6553 MB
2021-03-15 07:43:56 (INFO) ObjectsRadiometricStatistics: OTB will use at most 24 threads
/Applications/OTB-7.2.0-Darwin64/bin/otbcli: line 55: 47063 Killed: 9

In that case command does to appear to consume a large amount of RAM in the process as the activity monitor shows and overtime this just appears to continue to increase significantly.Screen Shot 2021-03-15 at 12.21.07 PM

I was curious if I could successfully complete the process by changing the number of bands on the input image to bands=1 (single band) and this also failed:

otbcli_ObjectsRadiometricStatistics -in sh12_vnir_mosaic_rd_elc_rectified_pca_sp15_10_ndvi_pca1_stats.sqlite -im “sh12_vnir_mosaic_rd_elc_rectified_pca_all_nd.tif?bands=1” -field cat -background 0
2021-03-15 11:01:29 (INFO) ObjectsRadiometricStatistics: Default RAM limit for OTB is 256 MB
2021-03-15 11:01:29 (INFO) ObjectsRadiometricStatistics: GDAL maximum cache size is 3276 MB
2021-03-15 11:01:29 (INFO) ObjectsRadiometricStatistics: OTB will use at most 12 threads
/Applications/OTB-7.2.0-Darwin64/bin/otbcli: line 55: 38322 Killed: 9 OTB_CLI_LAUNCHER "@"

So then I was thinking that perhaps the extended syntax on number of bands to process may be an issue and I stripped off the 1 principal component (pc) band into a separate file with gdal_translate and also did the same with the first 4 pc bands to another geotiff file. Tried the command again without the extended file name reference which was successful in both instances.

otbcli_ObjectsRadiometricStatistics -in sh12_vnir_mosaic_rd_elc_rectified_pca_sp15_10_ndvi_pca1_stats.sqlite -im “sh12_vnir_mosaic_rd_elc_rectified_pca1_all_nd.tif” -field cat -background 0
2021-03-15 14:51:21 (INFO) ObjectsRadiometricStatistics: Default RAM limit for OTB is 256 MB
2021-03-15 14:51:21 (INFO) ObjectsRadiometricStatistics: GDAL maximum cache size is 3276 MB
2021-03-15 14:51:21 (INFO) ObjectsRadiometricStatistics: OTB will use at most 12 threads

otbcli_ObjectsRadiometricStatistics -in sh12_vnir_mosaic_rd_elc_rectified_pca_sp15_10_ndvi_pca4_stats.sqlite -im “sh12_vnir_mosaic_rd_elc_rectified_pca4_all_nd.tif” -field cat -background 0
2021-03-15 14:51:58 (INFO) ObjectsRadiometricStatistics: Default RAM limit for OTB is 256 MB
2021-03-15 14:51:58 (INFO) ObjectsRadiometricStatistics: GDAL maximum cache size is 3276 MB
2021-03-15 14:51:58 (INFO) ObjectsRadiometricStatistics: OTB will use at most 12 threads

Based on my testing it appears that the issue may be that the extended filename reference is not recognized by ObjectsRadiometricStatistics and thus this becomes a machine resource issue in my particular case. It doesn’t appear that the command has the typical -ram flag. If anyone has any experience with this kind of issue with ObjectsRadiometricStatistics, I’d be very interested.

Thank you.

Rob

hello,
I think that you should add a & before each keyword when using the extended filename

“datapath?&band=1:4”

Thank you radouxju. I think you are correct about the missing & on the extended filename syntax. Inserting the &, however, has not resolved my issue with extended filenames and ObjectsRadiometricStatistics. I reran my test on a single band (1st pc) against the segmented vector file as follows and it’s still erroring out with Killed 9 message.

otbcli_ObjectsRadiometricStatistics -in sh12_vnir_mosaic_rd_elc_rectified_pca_sp15_10_ndvi_pca1_stats.sqlite -im “sh12_vnir_mosaic_rd_elc_rectified_pca_all_nd.tif?&bands=1” -field cat -background 0
2021-03-17 10:24:59 (INFO) ObjectsRadiometricStatistics: Default RAM limit for OTB is 256 MB
2021-03-17 10:24:59 (INFO) ObjectsRadiometricStatistics: GDAL maximum cache size is 3276 MB
2021-03-17 10:24:59 (INFO) ObjectsRadiometricStatistics: OTB will use at most 12 threads
/Applications/OTB-7.2.0-Darwin64/bin/otbcli: line 55: 51154 Killed: 9 OTB_CLI_LAUNCHER "@"

Regardless, thank you again for the second set of eyes on my command syntax.

Best,

Rob