Just posting if anyone is interested this is a canny edge detector. Please note it is not fast will take a few seconds for large images. I will try and implement it using different data structure and then using shaders to see what speed improvements I can make, however this was a proof of concept as I could not understand the traditional canny algorithm or how to implement it even after lengthy reading.
Here are some example pictures
without preprocessing
;
with preprocessing
still a few improvements such as trimming short lines and adding vertex calculations