1
$\begingroup$

I have a 8-bit greyscale 16x16 image where I want to extract coherent shapes with a more or less consistent pixel arrangement if possible (like: a rectangle, staircase, line). Currently, I'm doing this in two simple steps:

  1. Find all pixels which have a value above a fixed threshold.
  2. Group all pixels which share at least one edge with another pixel (find coherent areas by checking if pixels are neighbours).

Here, you can see an example image with the shape segmentation I would like to have and the one I get with the thresholding algorithm:

Example image with desired and current segmentation result.

The main problem is that there are sometimes small overlaps of different shapes, where my current algorithm will extract it as one shape (see third image). It could even be that there is an additional pixel which adjoins the red, the blue and the green shape, which would lead to having only one big shape extracted in this example image.

One solution I was thinking about was generating a convex hull around a found shape and try to split the shape if it contains a too high percentage of black (below-threshold) pixels, but I would need to find a way of where to split it. If possible, I would also like to get rid of thresholding and maybe use deformable image contours (snakes) or another gradient-based method. On the other hand, I want to keep the algorithm as simple/fast as possible as it is only a sub-step of a obstacle detection pipeline which runs at 90 Hz (the image represents a u-disparity which is a histogram of a disparity image).

Does anyone have a suggestion what I could try?

$\endgroup$
  • 1
    $\begingroup$ Welcome to DSP.SE! Interesting question. You could try thinning a binarized version of your "Current segmentation" image, segment the blobs so-removed, but remove them from the image for the next level of segmentation. $\endgroup$ – Peter K. Jun 30 '16 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.