Ask Your Question

Revision history [back]

Extracting area of interest from image

I have a set of images with a colored border which is enclosing a grey area. only the grey area is relevant for my image analysis. But i have a hard time to extract the grey area.

My approach for getting the grey area is:

  1. Detecting contours
  2. Creating a convex hull around all contours (so one hull enclosing all, not one hull for each contour)
  3. Checking if pixel of source image is within convex hull and applying my analysis algorithm.

Current problem is that there are multiple contours which are noise/unwanted and i cant remove them. I have uploaded the results so you know what i mean.

Two questions regarding this:

  1. is this approach feasible or is there some better solution?
  2. how could i remove those contours which are outside of the circle so that i only have the area of interest in my convex hull?

Please also keep in mind that lighting may change and the color can vary betweeen blue and purple.

Source Image: source image After Threshold: after threshold Detected Contours: image description