| | |
| | | return p_img_search(p_f);
|
| | | }
|
| | |
|
| | | //@brief 注册功能,未完成
|
| | | //@brief 注册功能
|
| | | //@param 图片
|
| | | //@return 人脸id
|
| | | int faceAPI::do_register(cv::Mat image)
|
| | | {
|
| | | p_f = fdb->extract_feature(image);
|
| | | //db add
|
| | | int indx = 1;
|
| | | return indx;
|
| | | int indx = fdb->db_add(p_f);
|
| | | if(fdb->db_save())
|
| | | return indx;
|
| | | return -2;
|
| | | }
|
| | |
|
| | |
|
| | | //@brief 在数据库中搜索人脸id
|
| | | //@param 特征值
|
| | |
| | | } else {
|
| | | 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) {
|
| | | indx=top_idxs[0];
|
| | | std::cout<<"indx="<<indx<<std::endl;
|
| | | }
|
| | | if (top_idxs) {
|
| | | delete[]top_idxs;
|
| | |
| | | delete[]top_scores;
|
| | | }
|
| | | cv_verify_release_feature(p_feature);
|
| | | std::cout<<"return indx"<<std::endl;
|
| | | return indx;
|
| | | }
|
| | |
|