Realm

oa::image::random_flip

Randomly mirror input horizontally and/or vertically. p_horizontal and p_vertical are independent probabilities in [0, 1]. Both coin draws are derived from seed, so the same recipe flips the same way on every run. Errors Returns an error when either probability is outside [0, 1] or non-finite, or the flip fails.

FnRust public API

Function Documentation

pub fn random_flip( input: &Image, p_horizontal: f32, p_vertical: f32, seed: u64 ) -> Result<Image>
Randomly mirror input horizontally and/or vertically. p_horizontal and p_vertical are independent probabilities in [0, 1]. Both coin draws are derived from seed, so the same recipe flips the same way on every run. Errors Returns an error when either probability is outside [0, 1] or non-finite, or the flip fails.