The image processing threshold methods are defined as traits for the ArrayBase and Image types that use the Otsu and Mean algorithms for calculating a threshold value and immediately applying the threshold. It could be useful to break out the one defined method into an "apply" and "calculate" methods, so that the threshold value could be calculated and obtained without immediately applying it to the image or array.
For example, the fn threshold_otsu would become:
...
fn threshold_calculate_otsu(&self) -> Result<f64, Error>;
fn threshold_apply_otsu(&self) -> Result<Self::Output, Error>;
...
The threshold_apply_otsu would be the same as the current threshold_otsu method, but the threshold_calculate_otsu method would simply return the threshold value, which could be used to do additional image processing or explicitly applied to an image using the new-ish threshold_apply method from PR #56.
The image processing threshold methods are defined as traits for the
ArrayBaseandImagetypes that use the Otsu and Mean algorithms for calculating a threshold value and immediately applying the threshold. It could be useful to break out the one defined method into an "apply" and "calculate" methods, so that the threshold value could be calculated and obtained without immediately applying it to the image or array.For example, the
fn threshold_otsuwould become:The
threshold_apply_otsuwould be the same as the currentthreshold_otsumethod, but thethreshold_calculate_otsumethod would simply return the threshold value, which could be used to do additional image processing or explicitly applied to an image using the new-ishthreshold_applymethod from PR #56.