adding helper functions for detection and matching algorithms