Commit 368eff3fa6247984241c183f0d1c6cd83cd606a4
1 parent
77301888
恢复错误优化代码
Showing
1 changed file
with
25 additions
and
1 deletions
src/ai_engine_module/VehicleAnalysisDevice.cpp
@@ -828,6 +828,14 @@ int va_batch(void * handle, sy_img * img_data_array, int batch_size, va_result * | @@ -828,6 +828,14 @@ int va_batch(void * handle, sy_img * img_data_array, int batch_size, va_result * | ||
828 | LOG_DEBUG("1-2 vpd_process----- "); | 828 | LOG_DEBUG("1-2 vpd_process----- "); |
829 | vpd_result vpd_result_temp[car_body_num]; | 829 | vpd_result vpd_result_temp[car_body_num]; |
830 | vpd_result vpd_result_[car_body_num]; | 830 | vpd_result vpd_result_[car_body_num]; |
831 | + for(int b=0;b<car_body_num;b++) | ||
832 | + { | ||
833 | + vpd_result_temp[b].count = 0; | ||
834 | + vpd_result_temp[b].vpd_res=new vpd_info[OBJ_MAX_COUNT]; | ||
835 | + | ||
836 | + vpd_result_[b].count = 0; | ||
837 | + vpd_result_[b].vpd_res=new vpd_info[OBJ_MAX_COUNT]; | ||
838 | + } | ||
831 | 839 | ||
832 | int p_idx=0; | 840 | int p_idx=0; |
833 | for(int iter=0;iter<body_iter;iter++) | 841 | for(int iter=0;iter<body_iter;iter++) |
@@ -953,7 +961,23 @@ int va_batch(void * handle, sy_img * img_data_array, int batch_size, va_result * | @@ -953,7 +961,23 @@ int va_batch(void * handle, sy_img * img_data_array, int batch_size, va_result * | ||
953 | } | 961 | } |
954 | delete[] vpd_img_data; | 962 | delete[] vpd_img_data; |
955 | vpd_img_data = NULL; | 963 | vpd_img_data = NULL; |
956 | - } | 964 | + } |
965 | + | ||
966 | + //delete | ||
967 | + for(int b=0;b<car_body_num;b++) | ||
968 | + { | ||
969 | + if(vpd_result_temp[b].vpd_res !=NULL) | ||
970 | + { | ||
971 | + delete[] vpd_result_temp[b].vpd_res; | ||
972 | + vpd_result_temp[b].vpd_res = NULL; | ||
973 | + } | ||
974 | + | ||
975 | + if(vpd_result_[b].vpd_res !=NULL) | ||
976 | + { | ||
977 | + delete[] vpd_result_[b].vpd_res; | ||
978 | + vpd_result_[b].vpd_res = NULL; | ||
979 | + } | ||
980 | + } | ||
957 | 981 | ||
958 | LOG_DEBUG("1-2 vpd_process----- "); | 982 | LOG_DEBUG("1-2 vpd_process----- "); |
959 | } | 983 | } |