这里有人处理过libanpr吗?它是一个用于自动车牌识别的库。我试图编译它,但我有很多错误无法解决。我甚至找不到一页文档!有人可以帮忙吗?
编辑:
溶液。
我无法在Linux下编译它,但在Windows下我做到了。现在我的问题是既没有关于这个库的文档也没有讨论!我尝试了下一个代码,但在执行时它崩溃了,当我调试(逐步)时,代码可以工作,但我无法使用这种方式来获得结果。我无法操纵代码,因为我们对任何类或任何函数一无所知!!
有人有兴趣分享我以找到解决方案吗?
#include "../source/AvcodecImgSrc.h"
#include "../locate/CarLocate.h"
#include "../plate/PlateCut.h"
#include "../ocr/PlateOcr.h"
#include "../exception/Exception.h"
static void show(const std::vector<OcrData>& plates) {
for (int i=0;i<plates.size();i++)
printf("%sn", plates[i].getPlate().c_str());
}
int main(int argc, const char* argv[]) {
try {
AvcodecImgSrc src(argv[1], 400, 3450);
CarLocate car(2048/4, 1536/4, 8, 5);
PlateCut plate;
PlateOcr ocr;
while (src.hasNext()) {
NTCImg img = src.next();
int w = img.dimx();
int h = img.dimy();
int w2 = w/2;
int h2 = h/2;
NTCImg img2 = img.getScale(w2, h2);
int w4 = w/4;
int h4 = h/4;
NTCImg img4g = img.getScaleG(w4, h4);
std::vector<CarData> cars = car.locate(img4g);
for (int i=0;i<cars.size();i++) {
printf("CAR[%dx%d]!n", cars[i].getRect().getWidth(), cars[i].getRect().getHeight());
}
std::vector<PlateData> plates = plate.cut(img2, CarData::scale2(cars));
for (int i=0;i<plates.size();i++) {
printf("PLATE[%dx%d]!n", plates[i].getRect().getWidth(), plates[i].getRect().getHeight());
}
//show(ocr.run(plate.cut(cars)));
}
} catch (const Exception& ex) {
printf("Exception: %sn", ex.getMsg().c_str());
} catch (const Err& err) {
printf("Err!n");
}
}
真是浪费时间!这个库不完整,我可以编译它,经过艰难的调试,OCR,非常重要的部分,被删除了!!我不建议任何人用它来释放他的精力。
查看 OpenALPR (http://www.openalpr.com)。 它是一个完整的开源车牌识别库,用C++编写。 编译也相当简单。