I am trying to create a linear structuring element in EmguCv and rotate it based on an agle for use in morphological operations. I am familiar with morphological operations and I have tried using the GetStructuringElement function which lets me create a square, ellipse or cross kernel and specify its size.
Mat kernelTest = CvInvoke.GetStructuringElement(Emgu.CV.CvEnum.ElementShape.Custom, new Size(6, 6), new Point(-1, -1));
I can also choose custom, but the problem is that I have no idea how to create a matrix of a certain size containing a line of ones and use that as a structuring element.
Example: [0 0 0 0]
[1 1 1 1]
[0 0 0 0]
[0 0 0 0]
I would be very grateful if anyone knows how to do this in EmguCv or opencv.