【发布时间】:2020-09-28 07:24:12
【问题描述】:
我正在尝试理解这里的代码:http://devernay.free.fr/vision/src/prosac.c
主要是我想把它翻译成python。
这是一个sn-p:
for(n_test = N, I_n_test = I_N; n_test > m; n_test--) {
// Loop invariants:
// - I_n_test is the number of inliers for the n_test first correspondences
// - n_best is the value between n_test+1 and N that maximizes the ratio
I_n_best/n_best
assert(n_test >= I_n_test);
...
...
// prepare for next loop iteration
I_n_test -= isInlier[n_test-1];
} // for(n_test ...
那么 I_n_test = I_N; 在循环语句中做了什么?
这是一个停止条件吗?那不应该是"=="吗?
【问题讨论】:
-
停止条件是
n_test > m不再成立。 -
语法不应该是 "==" 吗?
-
@als7 不,这是一项任务。
=是合适的。仔细阅读答案。