Prep files for refactoring
Initial refactor
Access pixels with pointers
Remove maximum ambiguity
Separate helper functions
Update CMakeLists.txt for gcc
Inline wrapper for distance calculation

Thanks, Stack Overflow! :-)
Improve matching loop readability
Optimize memory access; acknowledge ambiguity

Execution time is under 1s now.
Finalize initial refactoring