Commit 5f46b9cf95837369656c154be2a5d131fb308878

Authored by Hu Chunming
1 parent ac57c20b

添加StainVplateResultParam

Showing 1 changed file with 19 additions and 7 deletions
jni/VehicleNativeInterface.cpp
... ... @@ -341,7 +341,12 @@ JNIEXPORT jint JNICALL Java_com_objecteye_nativeinterface_vehicle_VehicleNativeI
341 341 //jclass cls_MucktruckcoverResult = env->FindClass("com/objecteye/pojo/vehicle/MucktruckcoverResultParam");
342 342 jclass cls_MtaResult = env->FindClass("com/objecteye/pojo/vehicle/MtaResultParam");
343 343 jclass cls_MtaDetailsParam = env->FindClass("com/objecteye/pojo/vehicle/MtaDetailsParam");
344   - //jclass cls_StainVplateResultParam = env->FindClass("com/objecteye/pojo/vehicle/StainVplateResultParam");
  344 + jclass cls_StainVplateResultParam = env->FindClass("com/objecteye/pojo/vehicle/StainVplateResultParam");
  345 + if (nullptr == cls_StainVplateResultParam)
  346 + {
  347 + cout << "cls_StainVplateResultParam find class error!" << endl;
  348 + }
  349 +
345 350 jclass cls_MannedResultParam = env->FindClass("com/objecteye/pojo/vehicle/MannedResultParam");
346 351  
347 352 //jclass cls_VehiclePoseResultParam = env->FindClass("com/objecteye/pojo/vehicle/VehiclePoseResultParam");//wh20210601������pose���
... ... @@ -358,7 +363,11 @@ JNIEXPORT jint JNICALL Java_com_objecteye_nativeinterface_vehicle_VehicleNativeI
358 363 jmethodID mid_VehicleColorResult = env->GetMethodID(cls_VehicleColorResult, "<init>", "(FI)V");
359 364 //jmethodID mid_VehicleRecgTopnResult = env->GetMethodID(cls_VehicleRecgTopnResult, "<init>", "([Lcom/objecteye/pojo/vehicle/VehicleRecognizeResultParam;I)V");//wh20210527������topn�ӿ�
360 365 jmethodID mid_VehicleRecgResult = env->GetMethodID(cls_VehicleRecgResult, "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;F)V");
361   - jmethodID mid_VplateResult = env->GetMethodID(cls_VplateResult, "<init>", "(Lcom/objecteye/pojo/common/SyRectParam;F[Lcom/objecteye/pojo/vehicle/VehiclePlateNumParam;FII)V");
  366 + jmethodID mid_VplateResult = env->GetMethodID(cls_VplateResult, "<init>", "(Lcom/objecteye/pojo/common/SyRectParam;F[Lcom/objecteye/pojo/vehicle/VehiclePlateNumParam;FIILcom/objecteye/pojo/vehicle/StainVplateResultParam;)V");
  367 + if (nullptr == mid_VplateResult)
  368 + {
  369 + cout << "mid_VplateResult GetMethodID error!" << endl;
  370 + }
362 371 jmethodID mid_VehiclePendantDetResult = env->GetMethodID(cls_VehiclePendantDetResult, "<init>", "([Lcom/objecteye/pojo/vehicle/VehiclePendantDetectInfoParam;I)V");
363 372 jmethodID mid_VehicleIllegalDetResult = env->GetMethodID(cls_VehicleIllegalDetResult, "<init>", "(Lcom/objecteye/pojo/vehicle/VehicleIllegalDetectInfoParam;Lcom/objecteye/pojo/vehicle/VehicleIllegalDetectInfoParam;)V");
364 373 jmethodID mid_VehicleFeaResult = env->GetMethodID(cls_VehicleFeaResult, "<init>", "([F)V");
... ... @@ -373,7 +382,7 @@ JNIEXPORT jint JNICALL Java_com_objecteye_nativeinterface_vehicle_VehicleNativeI
373 382 //jmethodID mid_VehicleSpecialResult = env->GetMethodID(cls_VehicleSpecialResult, "<init>", "([Lcom/objecteye/pojo/vehicle/VehicleSpecialInformationParam;I)V");
374 383 jmethodID mid_MtaResult = env->GetMethodID(cls_MtaResult, "<init>", "(Lcom/objecteye/pojo/vehicle/MtaDetailsParam;Lcom/objecteye/pojo/vehicle/MtaDetailsParam;Lcom/objecteye/pojo/vehicle/MtaDetailsParam;Lcom/objecteye/pojo/vehicle/VehicleDetectResultParam;)V");
375 384 jmethodID mid_MtaDetailsParam = env->GetMethodID(cls_MtaDetailsParam, "<init>", "(IF)V");
376   - //jmethodID mid_StainVplateResultParam = env->GetMethodID(cls_StainVplateResultParam, "<init>", "(FI)V");
  385 + jmethodID mid_StainVplateResultParam = env->GetMethodID(cls_StainVplateResultParam, "<init>", "(FI)V");
377 386 //jmethodID mid_MucktruckcoverResult = env->GetMethodID(cls_MucktruckcoverResult, "<init>", "(IF)V");
378 387 jmethodID mid_MannedResult = env->GetMethodID(cls_MannedResultParam, "<init>", "([Lcom/objecteye/pojo/vehicle/VehicleDetectResultParam;I)V");//wh20220222
379 388 jmethodID mid_SyPoint = env->GetMethodID(cls_SyPoint, "<init>", "(II)V");//wh20210601������pose���
... ... @@ -425,20 +434,23 @@ JNIEXPORT jint JNICALL Java_com_objecteye_nativeinterface_vehicle_VehicleNativeI
425 434 jobject vplateResult = NULL;
426 435 jobject vehicle_plate_det_recg_res_syRect_rect = NULL;
427 436 jobjectArray vplateNumArray = NULL;
  437 + auto vehicle_plate_res = vehicle_info.vehicle_plate_det_recg_res;
428 438 if (global_vehicle_plate_det_recg_config == SY_CONFIG_OPEN)
429 439 {
430 440 std::cout << "vehicle_plate_det_recg_res_syRect_rect" << std::endl;
431   - vehicle_plate_det_recg_res_syRect_rect = env->NewObject(cls_SyRect, mid_SyRect, vehicle_info.vehicle_plate_det_recg_res.rect.left_, vehicle_info.vehicle_plate_det_recg_res.rect.top_, vehicle_info.vehicle_plate_det_recg_res.rect.width_, vehicle_info.vehicle_plate_det_recg_res.rect.height_);
  441 + vehicle_plate_det_recg_res_syRect_rect = env->NewObject(cls_SyRect, mid_SyRect, vehicle_plate_res.rect.left_, vehicle_plate_res.rect.top_, vehicle_plate_res.rect.width_, vehicle_plate_res.rect.height_);
432 442 vplateNumArray = env->NewObjectArray(PLATENUM, cls_VplateNum, NULL);
433 443 for (size_t k = 0; k < PLATENUM; k++)
434 444 {
435   - jstring character = env->NewStringUTF(vehicle_info.vehicle_plate_det_recg_res.recg[k].character);
436   - jobject vplateNum = env->NewObject(cls_VplateNum, mid_VplateNum, character, vehicle_info.vehicle_plate_det_recg_res.recg[k].maxprob);
  445 + jstring character = env->NewStringUTF(vehicle_plate_res.recg[k].character);
  446 + jobject vplateNum = env->NewObject(cls_VplateNum, mid_VplateNum, character, vehicle_plate_res.recg[k].maxprob);
437 447 env->SetObjectArrayElement(vplateNumArray, k, vplateNum);
438 448 }
439 449 }
440 450  
441   - vplateResult = env->NewObject(cls_VplateResult, mid_VplateResult, vehicle_plate_det_recg_res_syRect_rect, vehicle_info.vehicle_plate_det_recg_res.detect_score, vplateNumArray, vehicle_info.vehicle_plate_det_recg_res.num_score, vehicle_info.vehicle_plate_det_recg_res.type, vehicle_info.vehicle_plate_det_recg_res.special_type);
  451 + jobject stain_v_plate = env->NewObject(cls_StainVplateResultParam, mid_StainVplateResultParam, vehicle_plate_res.stain_vp_result.score, vehicle_plate_res.stain_vp_result.type);
  452 + std::cout << "vplateResult" << std::endl;
  453 + vplateResult = env->NewObject(cls_VplateResult, mid_VplateResult, vehicle_plate_det_recg_res_syRect_rect, vehicle_plate_res.detect_score, vplateNumArray, vehicle_plate_res.num_score, vehicle_plate_res.type, vehicle_plate_res.special_type, NULL);
442 454  
443 455 std::cout << "vplateResult end" << std::endl;
444 456  
... ...