SAR Oil spills - Minimum cluster size

I am trying to apply a minimum cluster SIZE to my thresholding (in a similar way to how SNAP’s oil spill detection tool works) as I am trying to segment an oil spill from the surrounding sea clutter (there is no land in the SAR image) - normal thresholding either significantly over or under segments the data. By applying a minimum cluster size (above that of the backscatter from the local clean sea area) should improve this but I do not know how to do it.
Please note I am not able to use SNAP’s ‘black box’ oil spill detection tool as it does not see my data (which is not from S1) as SAR data. Equally if you are aware of a way that I need to modify my data so that SNAP sees it as a SAR product this would be useful too.

Many thanks

the cluster size tool is not in the menu but can be accessed separately in the graph builder

Maybe you can directly input your data in this operator. It only takes the minimum size as a variable, so it should be able to also use nonSAR data as an input:

Thanks for clear and prompt reply – much appreciated. I have tried this and it throws the following error:"[NodeId:Oil-Spill_Clustering]Metadata range_spacing has not been set"

I am able to run band maths for thresholding, K-means, EM cluster, apply low pass filters for reducing speckle etc but certain things not possible and I do not know how to rectify the base dataset hence why I am looking at work arounds.
Let me know if you have any other ideas of how to correct the error above.
Kind regard

Did you stick to the BEAM-DIMAP format while processing your data? Otherwise metadata about range spacing might have gone lost.

Geocoding can be done with the Ellipsoid correction (no topography)

Yes i did have BEAM-DIMAP format. The issue is the metadata is meaningless - the data has been converted from a proprietary format into .hdr file where the metadata looks like the image attached below.

I cannot apply any form of correction as there is no long/lat data in the file either and hence the ellipsoid correction is still not able to work. I have first and last pixel long/lat - do you know of a way I can apply this to the data so that each pixel has an associated long/lat?

I’m afraid, for the radar modules you need all the metadata.

There are some ways to attach geocoding to the pixels, maybe @marpet can tell if having the coordinates of the corners is sufficient.