[][src]Function imageproc::local_binary_patterns::local_binary_pattern

pub fn local_binary_pattern<I>(image: &I, x: u32, y: u32) -> Option<u8> where
    I: GenericImage<Pixel = Luma<u8>>, 

Computes the basic local binary pattern of a pixel, or None if it's too close to the image boundary.

The neighbors of a pixel p are enumerated in the following order:

7  0  1
6  p  2
5  4  3

The nth most significant bit of the local binary pattern at p is 1 if p is strictly brighter than the neighbor in position n.

Examples

use imageproc::local_binary_patterns::local_binary_pattern;

let image = gray_image!(
    06, 11, 14;
    09, 10, 10;
    19, 00, 22);

let expected = 0b11010000;
let pattern = local_binary_pattern(&image, 1, 1).unwrap();
assert_eq!(pattern, expected);