1 | initial version |
you can use a mask with copyTo().
so, first make a black image:
Mat mask = new Mat(submat.size(), CvType.CV_8U, new Scalar(0));
// then draw a filled white star into that,
// e.g. with drawContours(), and linesize=-1
//
// now use that mask, to copy only where the mask is white:
dst.copyTo(submat, mask);