我试图在具有一定曲率的图像中找到边缘:边缘较亮的一侧应该是凸面。
sobel或canny的边缘本身没有问题,但我不知道如何检查曲率。
一些例子:我想找到绿色边框,而不是红色边框
----->
----->
我试图在具有一定曲率的图像中找到边缘:边缘较亮的一侧应该是凸面。
sobel或canny的边缘本身没有问题,但我不知道如何检查曲率。
一些例子:我想找到绿色边框,而不是红色边框
----->
----->
If I understand your requirement correctly you want to find edges which are curved and which, on their convex side, 'enclose' a light region of the diagram ?
I translate your requirement into:
A curve is accepted if any straight line drawn between two points on the curve lies entirely within a light region of the diagram.
That should be fairly straightforward to implement. If the curves comprise many points checking every straight line between each pair of points will be extremely tedious, but you might be satisfied with checking enough straight lines.
But you'll have to define what enough is for yourself.
If, as OP has commented, a curve may include segments which meet the requirement and segments which don't and they are to be separated into a compliant curve and a non-compliant curve, this approach should be adaptable though I can see the processing becoming quite onerous as the number of lines used to check for convexity becomes large.
如果您将边缘的几何图形提取为有序的点序列,则可以通过考虑 3 个连续点 ABC 来确定您想要序列的哪些部分。如果 C与较亮区域位于 AB 线的同一侧,则 ABC 是所需曲线的一部分,您可以继续考虑 BCD,依此类推,直到您发现 C 位于 AB 的错误一侧或者你回到序列的开始。
这将避免 High Performance Mark 解决方案的假阴性问题,即测试线段遇到与当前曲线不相连的暗区。