# Flood detection Operator - Binarization threshold as a parameter

Hello!

I ran into the FloodDetection graph and understood that the flood detection is a binarization expression.
This post is about asking why the threshold cannot be defined as a parameter in the expression (example):

`!(Sigma0_VV_mst_27May2021 < 0.05 && Sigma0_VV_mst_27May2021 > 0) && (Sigma0_VV_slv1_08Jun2021 < 0.05 && Sigma0_VV_slv1_08Jun2021 > 0) && Terrain_Mask == 0`

1 Like

Iâ€™m not sure if I understood your question.

But you donâ€™t need to apply the â€śFlood-Detectionâ€ť operator to identify the differences in two coregistered images. You can als use logical statements (as in your example) in the Mask Manager or the Band Maths to identify pixels where backscatter intensity has decreased by a cretain degree.

Thanks @ABraun, sure but if thereâ€™s a FloodDetection operator it maybe the way to go as as it is I donâ€™t see how it can be used for flood detection (the threshold may change according to the area or other factors).
The Operator code is here: s1tbx/FloodDetectionOp.java at master Â· senbox-org/s1tbx Â· GitHub, itâ€™s a pity not to expose the threshold as a parameter.

Iâ€™m not sure if it is really based on a variable threshold. Maybe @jun_lu can comment here.

The operator was not maintained. But if your SNAP is built from source code, you can add threshold as a parameter with code like the following two lines:

@Parameter(description = â€śThreshold for flood detectionâ€ť, interval = â€ś(0, 1]â€ť, defaultValue = â€ś0.05â€ť,
label = â€śThreshold in (0,1]â€ť)
private double threshold = 0.05;

Thanks @jun_lu