为什么我在尝试铃木安倍边界以下方法时会得到不同的结果?

时间:2015-05-26 14:34:27

标签: algorithm notation

在铃木安倍的paper中,我尝试了他们的示例中的边界跟踪算法:Exampe in the paper

这里算法: Algorithm1 Algorithm2

我的算法结果为Result

与纸张结果不同,在纸张2中,当我处理步骤3.4部分a时,结果变为-2。它是(i 3 ,j 3 +1)从当前像素+ 1的平均坐标列?

1 个答案:

答案 0 :(得分:0)

Without seeing your implementation, it's hard to know for sure. But, my first guess is that, in your code, you're deciding to label a pixel as -LNBD only if is zero, instead of also confirming that this cell was examined your implementation of step (3.3). So, in your loop that implements (3.3), add a flag that flips to true when your counterclockwise search for a 1-pixel value hits , and then modify your implementation of step (3.4(a)) to also check this flag.

I encountered the same problem myself and didn't quite realize it until I read the proof of Lemma 2 on P 43.