diff --git a/deploy/cpp_infer/include/postprocess_op.h b/deploy/cpp_infer/include/postprocess_op.h index 44ca35312ebc61b39a1f61e69c2cc5dd5e999da7..a600ea6d106706af2fbadb249c862fc764714f9e 100644 --- a/deploy/cpp_infer/include/postprocess_op.h +++ b/deploy/cpp_infer/include/postprocess_op.h @@ -51,6 +51,7 @@ public: float &ssid); float BoxScoreFast(std::vector> box_array, cv::Mat pred); + float PolygonScoreAcc(std::vector contour, cv::Mat pred); std::vector>> BoxesFromBitmap(const cv::Mat pred, const cv::Mat bitmap, diff --git a/deploy/cpp_infer/src/postprocess_op.cpp b/deploy/cpp_infer/src/postprocess_op.cpp index 8c44a54a40da43e22194589f2e759204eff368e7..1c13f8aa78dfcce7b9edd83a211e8b81e5c4b5e7 100644 --- a/deploy/cpp_infer/src/postprocess_op.cpp +++ b/deploy/cpp_infer/src/postprocess_op.cpp @@ -159,6 +159,39 @@ std::vector> PostProcessor::GetMiniBoxes(cv::RotatedRect box, return array; } +float PostProcessor::PolygonScoreAcc(std::vector contour, + cv::Mat pred){ + int width = pred.cols; + int height = pred.rows; + std::vector box_x; + std::vector box_y; + for(int i=0; i> box_array, cv::Mat pred) { auto array = box_array; @@ -235,6 +268,8 @@ PostProcessor::BoxesFromBitmap(const cv::Mat pred, const cv::Mat bitmap, float score; score = BoxScoreFast(array, pred); + /* compute using polygon*/ + // score = PolygonScoreAcc(contours[_i], pred); if (score < box_thresh) continue;