Face Detection - Objects detected but no metadata

Answered

Comments

1 comment

  • Avatar
    Roman Inflianskas

    I'm not sure if that solves your problem, but you have to convert the rectangle you are getting from OpenCV to the nx::sdk::analytics::Rect so that the coordinates are in [0, 1]. You can use this snippet (width and height are the frame dimensions):

    nx::sdk::analytics::Rect convertCvRectToNxRect(cv::Rect rect, int width, int height)
    {
    return {
    /*x*/ (float) rect.x / width,
    /*y*/ (float) rect.y / height,
    /*width*/ (float) rect.width / width,
    /*height*/ (float) rect.height / height,
    };
    }
    0
    Comment actions Permalink

Please sign in to leave a comment.