From 26d46c6b81c6936b89e1d3ab1e212417dbb23712 Mon Sep 17 00:00:00 2001 From: xuepengqiang <506321815@qq.com> Date: 星期四, 09 一月 2020 09:36:08 +0800 Subject: [PATCH] update --- test.cpp | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/test.cpp b/test.cpp index d3f2eda..72640b9 100644 --- a/test.cpp +++ b/test.cpp @@ -33,6 +33,7 @@ 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鍔犺浇鍥剧墖淇℃伅*/ @@ -48,17 +49,19 @@ 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; // } -- Gitblit v1.8.0