Fix the issue of rga image processing for face detection

This commit is contained in:
Jingyu
2025-06-15 13:34:42 +08:00
parent 8f94f04eb6
commit df32ba94c9
2 changed files with 7 additions and 2 deletions

View File

@@ -22,7 +22,12 @@ FaceLocList FaceDetectAdapt::operator()(const inspirecv::Image &bgr) {
inspirecv::Image pad;
uint8_t *resized_data = nullptr;
m_processor_->ResizeAndPadding(bgr.Data(), bgr.Width(), bgr.Height(), bgr.Channels(), m_input_size_, m_input_size_, &resized_data, scale);
if (ori_w == m_input_size_ && ori_h == m_input_size_) {
scale = 1.0f;
resized_data = (uint8_t *)bgr.Data();
} else {
m_processor_->ResizeAndPadding(bgr.Data(), bgr.Width(), bgr.Height(), bgr.Channels(), m_input_size_, m_input_size_, &resized_data, scale);
}
pad = inspirecv::Image::Create(m_input_size_, m_input_size_, bgr.Channels(), resized_data, false);

View File

@@ -98,7 +98,7 @@ int main(int argc, char* argv[]) {
/* Maximum number of faces detected */
maxDetectNum = 20;
/* Face detection image input level */
detectPixelLevel = 160;
detectPixelLevel = 320;
/* Handle of the current face SDK algorithm context */
session = NULL;
ret = HFCreateInspireFaceSessionOptional(option, detMode, maxDetectNum, detectPixelLevel, -1, &session);