| | |
| | | int gpu_id = 0; |
| | | ReID_Feature R_Feater; |
| | | bool n_flog = R_Feater.ReID_init(0); |
| | | ReID_Utils r_util; |
| | | // ReID_Feature R_Feater(gpu_id); |
| | | |
| | | /*opencv加载图片信息*/ |
| | |
| | | try { |
| | | float pFeature1[2048]; |
| | | /*转义图片信息格式*/ |
| | | cv::cvtColor(human_img, human_img, cv::COLOR_RGB2BGR); |
| | | human_img.convertTo(human_img, CV_32FC3, 1.0f / 255.0f); |
| | | bool ex_flag1 = R_Feater.ReID_extractor(human_img.data, pFeature1); |
| | | // cv::cvtColor(human_img, human_img, cv::COLOR_RGB2BGR); |
| | | // human_img.convertTo(human_img, CV_32FC3, 1.0f / 255.0f); |
| | | float *my_img_data = r_util.normalize(human_img.data, human_img.cols, human_img.rows, 3); |
| | | bool ex_flag1 = R_Feater.ReID_extractor(my_img_data, pFeature1); |
| | | // for (int k = 0; k < 20; ++k) { |
| | | // cout << "-----11111111111------" <<pFeature1[k+2000]<< endl; |
| | | // } |
| | | |
| | | float pFeature2[2048]; |
| | | cv::cvtColor(human_img2, human_img2, cv::COLOR_RGB2BGR); |
| | | human_img2.convertTo(human_img2, CV_32FC3, 1.0f / 255.0f); |
| | | bool ex_flag2 = R_Feater.ReID_extractor(human_img2.data, pFeature2); |
| | | // cv::cvtColor(human_img2, human_img2, cv::COLOR_RGB2BGR); |
| | | // human_img2.convertTo(human_img2, CV_32FC3, 1.0f / 255.0f); |
| | | float *my_img_data2 = r_util.normalize(human_img.data, human_img.cols, human_img.rows, 3); |
| | | bool ex_flag2 = R_Feater.ReID_extractor(my_img_data2, pFeature2); |
| | | // for (int k = 0; k < 20; ++k) { |
| | | // cout << "-----2222222222------" <<pFeature2[k+2000]<< endl; |
| | | // } |