Clear Filters
Clear Filters

Removing background in a image and keeping only region of interest

3 views (last 30 days)
Hi,
I need some help in removing the background of this image and keeping only the region of interest, in this case it is the root. Everything else in the background just has to be black, pixel value = 0.
I have already tried grayscale, imadjust, thresholding, trying to extract certain colors. Since the lighting in the picture is uneven, thresholding does not work as it removes most of the root as well.
Any help is greatly appreciated, maybe there are more complex functions that I am unaware of. I will respond to any questions for further clarification.

Answers (1)

Image Analyst
Image Analyst on 7 Jul 2016
You might try some kind of region growing method. I attach my Photoshop-like magic wand demo to get you started.
Also, how many of these do you have? Thousands? Or just a few dozen? If only a few dozen, you might be able to help it out some with some freehand masking.
  2 Comments
Shawn Castelino
Shawn Castelino on 7 Jul 2016
There are approximately 1000 images now, maybe more in the future, that is why I'm trying to automate the process because if i have to do each picture by hand, thats gonna take a while to crop each root out.
I worked on it a bit since I posted this. I converted rgb -> cmyk, noticed that the k(black) component had a decent difference in contrast between the root and the background noise. Using that I managed to create a "somewhat" decent binary image. Still working on it.
I'll take a look at the magic wand software, but anything more automated will be better.
Image Analyst
Image Analyst on 7 Jul 2016
OK, what do you really want to find out? Is it the length of all the branches? The area of everything? The area of the white root only?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!