Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 AForge.net 从图像的背景中裁剪对象。我已经使用 cannyEegeDetector 检测到对象的边缘,但我不知道如何使用检测到的边缘来裁剪它。你有什么想法可以从背景中裁剪对象吗?
我对 CannyEdgeDetector 返回的数据结构一无所知,但您可能希望使用类似于选定区域中的轮廓填充的算法来处理它(有点像 MS Paint 中的填充桶)。在图像的每一行像素上,从图像的左侧开始向右扫描,每次越过边界时,切换是否在“填充区域”中。填充区域中的像素被保留,其外部的像素被裁剪。希望有帮助!