1 | initial version |
Please, let's stick to the new interface. Then it's just a simple Mat. Create your mat like this
Mat mat = Mat::ones(7, 7, CV_8U);
Then use
mat.at<uchar>(y, x) = 0
to set the 0 values at the 12 positions in the matrix. The anchor point is of course the middle 3,3 (if you don't want it another position, which I doubt). You can also set it to -1,-1 then the middle is internally computed. Use morphologyEx for the morphological operation(s).