Ask Your Question
2

disk shaped structuring element using cvcreatestructruingelementEx

asked 2013-06-22 09:10:33 -0600

Muhammet Ali gravatar image

updated 2020-11-15 02:06:57 -0600

Hi all I want to create a disk shaped SE similar to this in Matlab

sel=strel('disk',4);

but How can I decide to value of anchor points coordinates of SE.

This is 4 radius,sel in matlab : image description

how this Se is made using cvcreateStructuringElementEx.Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2013-06-22 11:24:51 -0600

Notas gravatar image

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).

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-06-22 09:10:33 -0600

Seen: 2,427 times

Last updated: Jun 22 '13