Otsus method

I reached the point has mentioned via this post in the last few days,

I found that unfortunately there’s still no method via SNAP, to calculate the intensity threshold of VH, VV,

That’s why I edited and created the Otsu’s method via skimage library to be compatible with GRDHR images, and full preparing the intensity VH, VV, and also getting the threshold is available within my github repository.

1 Like

sounds cool - I would love to see an example for its use.

Dear Andy,
An example is already mentioned via the repository,

dirpath = ‘D://WATER_MAP_TEST/’
vv = dirpath + VV/S1A_IW_GRDH_1SDV_20210324T191554_VV_NR_Orb_TC_res.tif’
vh = dirpath + ‘VH/S1A_IW_GRDH_1SDV_20210324T191554_VH_NR_Orb_TC_res.tif’
Otsus_VH_VV_thr(vv)
layer_count : 1 layer_shape : (21494, 25689)
layer_type : (‘float32’,)
Lyer_NAN : (None,)
Layer_shape_after_converted_to_unit8 (1, 21494, 25689)
The layer threshold is : 21
Total time is: 00:07:01.82

image

sorry, I meant the result.

Yes, you’re right I miss-interpreted your previous comments, the results of thr. are required in order to create water extent mapping as it’s explained here, make_water_map

This is an example,

import asf_tools
from asf_tools.water_map import make_water_map

dirpath = ‘D:/WATER_MAP_TEST/’

vh = dirpath + ‘VH/S1A_IW_GRDH_1SDV_20210324T191554_VH_NR_Orb_TC_res_Ltodb.tif’

vv = dirpath + ‘VV/S1A_IW_GRDH_1SDV_20210324T191554_VV_NR_Orb_TC_res_Ltodb.tif’

out_raster = dirpath + ‘water_map_20210324T191554.tif’

make_water_map(
out_raster,
vv,
vh,
hand_raster=None,
tile_shape=(200, 200),
max_vv_threshold=21,
max_vh_threshold=18,
hand_threshold=15.0,
hand_fraction=0.8,
membership_threshold=0.45
)

I hope now the foregoing answers your comment!

1 Like

I faced similar kind of issue last time, I am still searching for some proper solution.

Hi Orland,

Seemingly you just joined the step_forum, I’d like to welcome you in the world of Space and Remote sensing,

Would you please to clarify which kind of problem do you face up?, your comment is vague to me!