Canny edge detector
I uploaded one of my student projects to GitHub: Canny algrithm implementation. This is popular method of finding edges in the image invented in 80’s: http://en.wikipedia.org/wiki/Canny_edge_detector. What you will find here is extremely naive approach, possibly with bugs and certainly not written with memory consumption issues in mind. But that’s just student project, it served well for its purpose:) Make sure to see README:
https://github.com/resset/CannyEdgeDetector
Below there is an exmple of each step of algorithm being performed: