简体   繁体   English

Javascript中的边缘检测

[英]Edge detection in Javascript

I have a matrix (here's the plot: http://i.imgur.com/GNIWp.png ) and I'd like find out, where the edges are. 我有一个矩阵(这里是情节: http//i.imgur.com/GNIWp.png ),我想找出边缘的位置。

Here's a picture of the same plot with lines which indicate the edges: http://i.imgur.com/yffGh.png 这是一张相同情节的图片,其中的线条表示边缘: 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 . 有许多相当简单的边缘检测算法并不难实现,例如Canny边缘检测器 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. 或者,如果您只想要功能并且对实际实现它不感兴趣,则可以使用Pixtastic图像处理库。

Also, possible duplicate question here (though that question is more to do with background removal). 此外,这里可能存在重复的问题 (虽然这个问题更多的是与背景删除有关)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM