Ask Your Question

Revision history [back]

Ellipse as structuring element

Hello, I was trying to learn object tracking by looking at an existing code. I understand what erosion and dilation. From the following piece of code, I understand that an ellipse is used as structuring element: erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5)));

    //morphological closing (removes small holes from the foreground)

dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5)));

In this case, we are tracking a circular object. Is it because of that an ellipse is used as structuring element? How do you choose the right structuring element?

Ellipse as structuring element

Hello, I was trying to learn object tracking by looking at an existing code. I understand what erosion and dilation. From the following piece of code, I understand that an ellipse is used as structuring element: element:

erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5)));
dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5)));

5)));
 //morphological closing (removes small holes from the foreground)

dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5)));

5)));

In this case, we are tracking a circular object. Is it because of that an ellipse is used as structuring element? How do you choose the right structuring element?