Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can try in this way:

  1. Apply threholding because you need a binary image.
  2. Apply morphological operator: first Open, then Close. Try with different SE.
  3. Use findContours.
  4. Use drawContours() with the original image.

You can try to convert to grayscale before the first threholding. You can try to use Canny operator instead of threholding and morphogical operator before findContours(). Basicaly whay you need is a binary image as input for findContours. Suggestion: you can also extract boundary in this way: A - (A EROSION B), where A is your image and B is your SE.

You can try in this way:

  1. Apply threholding because you need a binary image.
  2. Apply morphological operator: first Open, then Close. Try with different SE.
  3. Use findContours.
  4. Use drawContours() with the original image.

You can try to convert to grayscale before the first threholding. threholding.

You can try to use Canny operator instead of threholding and morphogical operator before findContours(). Basicaly whay findContours().

Basically you need is a binary image as input for findContours. findContours.

Suggestion: you can also extract boundary in this way: A - (A EROSION B), where A is your image and B is your SE.