Photoshop 的磁性套索如何工作?
看起来 GIMP 的 智能剪刀 是基于 SIGGRAPH '95 的一篇论文“用于图像合成的智能剪刀”,如其中所示来源中的评论。
然而,Photoshop 中的磁性套索有很大不同,而 GIMP 的工具为用户提供了单击顶点的选项另一方面,Photoshop 的磁性套索为用户提供了一种徒手运行的方式,并给出了介于计算机近似值和用户想要绘制的内容之间的东西。
从这种行为来看,很明显,磁性套索样式选择对于基于触摸的界面中的选择来说非常酷。关于磁性套索与 GIMP 工具有何不同的任何指示?有什么具体的论文/算法需要研究吗?
Seems like GIMP's intelligent scissor is based on a paper from SIGGRAPH '95 on "Intelligent Scissors for Image Composition", as seen in one of the comments in the source.
However Magnetic Lasso in Photoshop differs a lot, while GIMP's tool gives users an option to click vertices of desired figure and approximates along edges found in the image, photoshop's magnetic lasso on the other hand, gives users a way to run freehand and gives something between computerized approximation and what the user desired to draw.
Looking at this behavior its quite obvious that Magnetic Lasso style selection would quite cool for selection in touch based interfaces. Any pointers on how magnetic lasso differs from the GIMP's tool? Any specific papers/algorithms to look into?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
智能剪刀算法的文档是这里
关于算法之间的关系,这篇文章说
The document with the algorithm for Intelligent Scissors is here
Regarding the relation between algorithms, this article says
我已经使用您提到的文章成功实现了磁性套索 - 用于图像合成的智能剪刀。我还实现了搜索区域的迭代扩展和“路径冷却”。
您可以在 www.Photopea.com 查看我的实现(拖放您自己的图像,滚动套索,选择磁性套索)。所以这是可能的,而且实现起来并不难:)
I have successfully implemented Magnetic Lasso using the article that you mentioned - Intelligent Scissors for Image Composition. I also implemented iterative extending of searched area and "path cooling".
You can see my implementation at www.Photopea.com (drag and drop your own image, roll over lasso, choose Magnetic Lasso). So it is possible and not that hard to implement :)
您可以研究的一种算法是Marching Squares。
One algorithm you can look into is Marching Squares.
捕捉到最近的检测到的边缘并开始一条线段。
3A。跟踪鼠标移动,捕捉到检测到的边缘。
3B。如果单击鼠标左键,则从上一条线段的末尾开始一条线段或结束当前线段。
3C。如果创建了线段,则使线与区域中检测到的边缘一致。
3D。如果单击 ESC 键或鼠标右键,则通过创建从第一个点到最后一个点的线段来包围检测到的区域。
瞧,你有一个“磁性套索”。
Snap to the nearest detected edge and begin a line segment.
3A. Track mouse movement, snapping to detected edges.
3B. If the left mouse button is clicked begin a line segment from the end of the previous one or finish the current one.
3C. If a line segment was created, conform the line to the detected edges in the area.
3D. If the ESC key or right mouse button is clicked, enclose the detected area by creating a line segment from the first point to the last point.
Voilà, you have a 'magnetic lasso'.