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 970 B

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