MTCNN
MTCNN copied to clipboard
在识别多人的图片时使用V2 Model会有异常
用下面的两张图。在识别多人的图片时使用V2 Model会有异常,根踪到这里应是矩型数据出现了问题,
cv::Mat tmp(rect.height, rect.width, CV_32F, cv::Scalar(0.0));
sample_norm_channels[k](cuted_rect).copyTo(tmp(inner_rect));
cv::resize(tmp, n_channels[i * 5 * num_channels_ + k * num_channels_ + j], cv::Size(24, 24));

]()
我加了
if (inner_rect.x > 0 && inner_rect.y>0 && inner_rect.width > 0 && inner_rect.height > 0) { for (int j = 0; j < num_channels_; j++) { cv::Mat tmp(rect.height, rect.width, CV_32F, cv::Scalar(0.0)); sample_norm_channels[k](cuted_rect).copyTo(tmp(inner_rect)); cv::resize(tmp, n_channels[i * 5 * num_channels_ + k * num_channels_ + j], cv::Size(24, 24)); } }
这样判断后就正常了,可能就是那个inner_rect 出现了负数