I'm interested to learn more about these algorithms. Are there any sources you'd recommend?
OpenCV implementations of this stuff will be complex with lots of architecture specific optimizations. They will also have tons of branches for different image formats — you can keep things very simple by just using single channel uncompressed grayscale. The Huang histogram and Perrault/Hebert constant time papers are very approachable. They have pseudocode and visualizations. They’re not that tricky. You can sit down in a day and implement them without much headache.