MCPcopy Create free account
hub / github.com/daniel-e/rustml / test_mask_image

Function test_mask_image

src/opencv/mod.rs:1016–1030  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1014
1015 #[test]
1016 fn test_mask_image() {
1017
1018 let mask = GrayImage::from_file("datasets/testing/10x10colors_mask.png").unwrap();
1019 let gray = GrayImage::from_file("datasets/testing/10x10gray.png").unwrap();
1020
1021 let v = gray.pixels_from_mask_as_u8(&mask);
1022 assert_eq!(v.unwrap(),
1023 vec![0x36, 0x36, 0xed, 0x12, 0x12, 0x36, 0x36, 0xff, 0x36, 0x49, 0x00, 0xff]
1024 );
1025
1026 let x: Vec<u8> = gray.mask_iter(&mask).collect();
1027 assert_eq!(x,
1028 vec![0x36, 0x36, 0xed, 0x12, 0x12, 0x36, 0x36, 0xff, 0x36, 0x49, 0x00, 0xff]
1029 );
1030 }
1031
1032 #[test]
1033 fn test_mask_video() {

Callers

nothing calls this directly

Calls 3

from_fileFunction · 0.85
mask_iterMethod · 0.80

Tested by

no test coverage detected