You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

testPipeLine.cpp 905 B

12345678910111213141516171819202122232425262728
  1. #include"../include/Pipeline.h"
  2. void TEST_PIPELINE()
  3. {
  4. pr::PipelinePR prc("../lpr/model/mininet_ssd_v1.prototxt", "../lpr/model/mininet_ssd_v1.caffemodel",
  5. "../lpr/model/refinenet.prototxt", "../lpr/model/refinenet.caffemodel",
  6. "../lpr/model/SegmenationFree-Inception.prototxt", "../lpr/model/SegmenationFree-Inception.caffemodel",
  7. "../lpr/model/cascade_double.xml");
  8. cv::Mat img = cv::imread("../lpr//res//test.jpg");
  9. std::vector<pr::PlateInfo> res = prc.RunPiplineAsImage(img,0);
  10. for (auto st : res) {
  11. if (st.confidence > 0.75) {
  12. std::cout << st.getPlateName() << " " << st.confidence << std::endl;
  13. cv::Rect region = st.getPlateRect();
  14. cv::rectangle(img, cv::Point(region.x, region.y), cv::Point(region.x + region.width, region.y + region.height), cv::Scalar(255, 255, 0), 2);
  15. }
  16. }
  17. //cv::imshow("image", img);
  18. //cv::waitKey(0);
  19. }
  20. int main()
  21. {
  22. TEST_PIPELINE();
  23. return 0;
  24. }