fix calculation of dilated mask area