Ask Your Question

Revision history [back]

What you should do in my opinion

  • Apply on your binary mask some erosion and dilation until you only have pixels left that are part of the movement
  • Then you put all those points into a vector and calculate the convex hull on all those points
  • Now on top of your mask draw that convexHull with filled option on

This will include all the inner pixels also in your foreground mask!