flydra_pt_detect_cfg/
lib.rs1use flydra_feature_detector_types::{ContrastPolarity, ImPtDetectCfg};
13use strand_http_video_streaming_types::Shape;
14
15fn my_default(polarity: ContrastPolarity, valid_region: Shape) -> ImPtDetectCfg {
16 ImPtDetectCfg {
17 do_update_background_model: true,
18 polarity,
19 alpha: 0.01,
20 n_sigma: 7.0,
21 bright_non_gaussian_cutoff: 255,
22 bright_non_gaussian_replacement: 5,
23 bg_update_interval: 200,
24 diff_threshold: 30,
25 use_cmp: true,
26 max_num_points: 1,
27 feature_window_size: 30,
28 clear_fraction: 0.3,
29 despeckle_threshold: 5,
30 valid_region,
31 }
32}
33
34pub fn default_absdiff() -> ImPtDetectCfg {
36 my_default(ContrastPolarity::DetectAbsDiff, Shape::Everything)
37}
38
39pub fn default_dark_circle() -> ImPtDetectCfg {
41 my_default(
42 ContrastPolarity::DetectDark,
43 Shape::Circle(strand_http_video_streaming_types::CircleParams {
44 center_x: 640,
45 center_y: 512,
46 radius: 512,
47 }),
48 )
49}