diff --git a/deploy/lite/src/keypoint_postprocess.cc b/deploy/lite/src/keypoint_postprocess.cc index f1a44bcc05590362604601fd66bda3a8a20920c3..5f28d2adcffaee6b2a3135eb828996c3b00488fa 100644 --- a/deploy/lite/src/keypoint_postprocess.cc +++ b/deploy/lite/src/keypoint_postprocess.cc @@ -125,12 +125,13 @@ void dark_parse(std::vector& heatmap, 5) hassian = Mat([[dxx, dxy], [dxy, dyy]]) */ std::vector::const_iterator first1 = heatmap.begin() + index; - std::vector::const_iterator last1 = heatmap.begin() + index + dim[2]*dim[3]; + std::vector::const_iterator last1 = heatmap.begin() + index + dim[2] * dim[3]; std::vector heatmap_ch(first1, last1); - cv::Mat heatmap_mat{heatmap_ch}; - heatmap_mat.resize(dim[2],dim[3]); - cv::GaussianBlur(heatmap_mat, heatmap_mat, cv::Size(3,3), 0, 0); - heatmap_ch.assign(heatmap_mat.datastart, heatmap_mat.dataend); + cv::Mat heatmap_mat = cv::Mat(heatmap_ch).reshape(0,dim[2]); + heatmap_mat.convertTo(heatmap_mat, CV_32FC1); + cv::GaussianBlur(heatmap_mat, heatmap_mat, cv::Size(3, 3), 0, 0); + heatmap_mat = heatmap_mat.reshape(1,1); + heatmap_ch = std::vector(heatmap_mat.reshape(1,1)); float epsilon = 1e-10; //sample heatmap to get values in around target location