diff options
author | Théo de la Hogue | 2023-06-07 14:34:14 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-06-07 14:34:14 +0200 |
commit | c4552e04e1271a9210a934233beae5be1943d034 (patch) | |
tree | a44041e544bc700976237bfea9058ec06f9a2904 /docs/user_guide/areas_of_interest/aoi_matching.md | |
parent | bd9cd27c9d44c072164f564ffffeb22e37106b89 (diff) | |
download | argaze-c4552e04e1271a9210a934233beae5be1943d034.zip argaze-c4552e04e1271a9210a934233beae5be1943d034.tar.gz argaze-c4552e04e1271a9210a934233beae5be1943d034.tar.bz2 argaze-c4552e04e1271a9210a934233beae5be1943d034.tar.xz |
Writing User guide and use cases section.
Diffstat (limited to 'docs/user_guide/areas_of_interest/aoi_matching.md')
-rw-r--r-- | docs/user_guide/areas_of_interest/aoi_matching.md | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/docs/user_guide/areas_of_interest/aoi_matching.md b/docs/user_guide/areas_of_interest/aoi_matching.md new file mode 100644 index 0000000..3bffeb9 --- /dev/null +++ b/docs/user_guide/areas_of_interest/aoi_matching.md @@ -0,0 +1,47 @@ +--- +title: AOI matching +--- + +AOI matching +============ + +Once AOI3D scene is projected into a frame as AOI2D scene, it could be needed to know which AOI2D is looked. +The AOI class in [AOIFeatures](/argaze/#argaze.AreaOfInterest.AOIFeatures) provides two ways to accomplish such task. + +## Pointer-based matching + +Test if 2D pointer is inside or not AOI using contains_point() method as illustrated below. + +![Contains point](../../img/contains_point.png) + +``` python +pointer = (x, y) + +for name, aoi in aoi2D_scene.items(): + + if aoi.contains_point(pointer): + + # Do something with looked aoi + ... + +``` + +It is also possible to get where a pointer is looking inside an AOI provided that AOI is a rectangular plane: + +``` python + +inner_x, inner_y = aoi.inner_axis(pointer) + +``` + +## Circle-based matching + +As positions have limited accuracy, it is possible to define a radius around a pointer to test circle intersection with AOI. + +![Circle intersection](../../img/circle_intersection.png) + +``` python + +intersection_shape, intersection_aoi_ratio, intersection_circle_ratio = aoi.circle_intersection(pointer, radius) + +``` |