用于车辆识别的libanpr非文档库

时间:2013-09-25 07:52:10

标签: image-processing anpr

这里有人处理过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("%s\n", 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: %s\n", ex.getMsg().c_str());
  } catch (const Err& err) {
    printf("Err!\n");
  }
}

2 个答案:

答案 0 :(得分:1)

多么浪费时间! 这个库不完整,我可以编译它,经过艰苦的调试,OCR,非常重要的部分,被删除!! 我不建议任何人用它来消耗能量。

答案 1 :(得分:1)

查看OpenALPR(http://www.openalpr.com)。它是一个用C ++编写的完整的开源车牌识别库。编译也很简单。

相关问题