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.

test_pipeline.cpp 1.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // Created by 庾金科 on 23/10/2017.
  3. //
  4. #include "../include/Pipeline.h"
  5. using namespace pr;
  6. void TEST_PIPELINE(){
  7. pr::PipelinePR prc("../lpr/model/cascade.xml",
  8. "../lpr/model/HorizonalFinemapping.prototxt","../lpr/model/HorizonalFinemapping.caffemodel",
  9. "../lpr/model/Segmentation.prototxt","../lpr/model/Segmentation.caffemodel",
  10. "../lpr/model/CharacterRecognization.prototxt","../lpr/model/CharacterRecognization.caffemodel"
  11. );
  12. cv::Mat image = cv::imread("../6.jpg");
  13. cv::imshow("image",image);
  14. cv::waitKey(0);
  15. std::vector<pr::PlateInfo> res = prc.RunPiplineAsImage(image);
  16. float conf = 0 ;
  17. for(auto st:res) {
  18. if(st.confidence>0.1) {
  19. std::cout << st.getPlateName() << " " << st.confidence << std::endl;
  20. conf += st.confidence;
  21. }
  22. }
  23. std::cout<<conf<<std::endl;
  24. system("pause");
  25. }
  26. int main()
  27. {
  28. TEST_PIPELINE();
  29. return 0 ;
  30. }