开发者

Edge detection in Javascript

开发者 https://www.devze.com 2023-04-09 06:34 出处:网络
I have a matrix (here\'s the plot: http://i.imgur.com/GNIWp.png) and I\'d like find out, where the edges are.

I have a matrix (here's the plot: http://i.imgur.com/GNIWp.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: http://i.imgur.com/yffGh.png

Is there any algorithm to detect these edges?


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号