git-svn-id: http://192.168.1.226/svn/proxy@108 454eff88-639b-444f-9e54-f578c98de674
| | |
| | | p_f = fdb->extract_feature(image);
|
| | | int indx = fdb->db_add(p_f);
|
| | | if(fdb->finally())
|
| | | {
|
| | | fprintf(stderr, "fdb->finally()%d\n",indx);
|
| | | return indx;
|
| | | }
|
| | |
|
| | | return -2;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if(db_save())
|
| | | {
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | fprintf(stderr, "save done!\n");
|
| | | }
|
| | |
|
| | | cv_verify_destroy_db(handle_db);
|
| | | fprintf(stderr, "db_save end!\n");
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | fprintf(stderr, "cv_verify_search_face failed, error code %d\n", cv_result);
|
| | | }
|
| | | std::cout<<"this is hits"<<std::endl;
|
| | | if (top_scores[0] != 0)
|
| | | if (top_scores[0] >= 0.7)
|
| | | {
|
| | | indx=top_idxs[0];
|
| | | std::cout<<"indx="<<indx<<std::endl;
|
| | |
| | | char *image_list = "../test_image/imglist";
|
| | | my_db mydb= {"root","Basic@2017","localhost","demo",3306};
|
| | |
|
| | | person p={0,"axsdcc",1};
|
| | | person p= {0,"axsdcc",1};
|
| | |
|
| | | cv::Mat bgr_image = cv::imread(image_path);
|
| | | if(bgr_image.data != NULL)
|
| | |
| | | tools tool=tools();
|
| | | tool.init(mydb,db_path);
|
| | | cout<<"======tools init ==========="<<endl;
|
| | | //idx=tool.reg(bgr_image,&p);
|
| | | tool.search(bgr_image,&p);
|
| | | if(tool.search(bgr_image,&p))
|
| | | {
|
| | | idx=tool.reg(bgr_image,&p);
|
| | | }
|
| | | |
| | | cout<<"id="<<idx<<endl;
|
| | | cout<<"============================================"<<endl;
|
| | | cout<<"p_id="<<p.p_id<<endl;
|
| | |
| | | |
| | | int tools::do_register(cv::Mat image,person *p) |
| | | { |
| | | p= {}; |
| | | //p= {}; |
| | | p->f_id = f_api.do_register(image); |
| | | if(p->f_id > 0) |
| | | { |
| | | fprintf(stderr, " tools::do_register %d\n",p->f_id); |
| | | if(dbu.db_register(p)) |
| | | { |
| | | return 0; |