我想从大图像中搜索小图像,我的算法是:
- 搜索第一行
- 如果第一行匹配,则比较其余的
我想使用 boost::algorithm::boyer_moore 进行行搜索,它适用于 std::string:
#include <string>
using namespace std;
#include "boost/algorithm/searching/boyer_moore.hpp"
using namespace boost::algorithm;
int main() {
string s;
boyer_moore<string::iterator> bm(s.begin(), s.end()); // it compiles
}
代码编译,但这个不是:
#include "boost/mpl/vector.hpp"
using namespace boost;
#include "boost/gil/gil_all.hpp"
using namespace boost::gil;
#include "boost/algorithm/searching/boyer_moore.hpp"
using namespace boost::algorithm;
int main() {
typedef rgba8_image_t image_t;
typedef image_t::view_t view_t;
view_t vw;
boyer_moore<view_t::x_iterator> bm(vw.row_begin(0), vw.row_end(0)); // compile error
}
他们都是迭代器,第二个有什么问题?
谢谢。