This tool will show the lines in your image file.
- Try different settings to get better results.
- Processing happens on your own device; the image is not sent anywhere.
- Note that the high contrast areas in images will give the best results.
- Larger files will take more time.
- The output can be saved like a file from the internet: use right-click and "save image" on a computer or a long press and "save image" on a mobile device.
- Click or tap an image to zoom in.
- This will work best on a computer. Mobile devices don't like it when a page uses many resources, and may throw away your results.
Working...
This tool is a work in progress.
TODOs
I have mostly been following the Canny edge detector Wikipedia page and trying to remember this topic from my university studies. The following are some possible additions or areas open to improvement:
- Gradient magnitude thresholding, using the gradient direction. This is to make the edges thinner. This has already been implemented but the effect does not seem to be good enough yet.
- Add both double thresholding and hysteresis thresholding. The Canny edge detector wiki page mentions this, and alternative explanations can be found here and here.
- Maybe it is nice if the previous settings are remembered the next time the tool is opened. But perhaps it doesn't make much sense; the sensitivity settings will usually need to be adjusted for each image.
- Add a button to the introduction to show an example image with settings that I have optimized beforehand. Or just show the before and after image.
References
The following pages were informative for implementing this:
- https://en.wikipedia.org/wiki/Canny_edge_detector
- https://en.wikipedia.org/wiki/Sobel_operator
- https://en.wikipedia.org/wiki/Edge_detection#Edge_thinning
- https://en.wikipedia.org/wiki/Hough_transform#Detecting_lines
- https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas
- https://docs.opencv.org/3.4/da/d22/tutorial_py_canny.html
- https://github.com/adl1995/edge-detectors/blob/master/canny-edge.py