Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edge detection in Javascript

I have a matrix (here's the plot: https://i.sstatic.net/eofSm.png) and I'd like find out, where the edges are.

Here's a picture of the same plot with lines which indicate the edges: https://i.sstatic.net/EIR2G.png

Is there any algorithm to detect these edges?

like image 498
sebslomski Avatar asked Sep 20 '26 05:09

sebslomski


1 Answers

There are plenty of fairly simple edge detection algorithms that aren't too hard to implement, such as the Canny edge detector. Bear in mind that a lot of these algorithms have different strengths and weaknesses, so I'd suggest you read up on the different approaches and decide based on what you're trying to do.

Alternatively, if you only want the functionality and aren't interested in actually implementing it, you can use the Pixtastic image processing library.

Also, possible duplicate question here (though that question is more to do with background removal).

like image 138
Alex Avatar answered Sep 21 '26 17:09

Alex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!