separating foreground from background and working on the masked image in matlab

6 views (last 30 days)
Hi,
This question is haunting me for a long time. first I was working in color so I have asked people here. now i am working on grey levels, but still this question is not resolved. I am reading an image using imread function then converting the whole image to grey levels, then I have to work only on the grey levels of the foreground, the code should not include the background, could anyone suggest a code to insert in my code please....i will attach a sample image as well ...
  18 Comments
Malini Bakthavatchalam
Malini Bakthavatchalam on 2 Oct 2020
Thank you for the reply. I understand the concept you explained for the background removal. its working in my code, but if I have images with background other than whites i cannot use this alogrithm right ?
like i am attaching a sample image
Sindar
Sindar on 2 Oct 2020
Edited: Sindar on 2 Oct 2020
This segmenter algorithm will likely fail, but you may be able to build a new algorithm in the Image Segmenter app (or Color Thresholder app). It really depends on the diversity of your images. For example, I'd expect 6.jpg to be almost trivial to segment, whereas 10.jpg and 25.jpg are probably doable but trickier, and creating a single algorithm that works on all three could be difficult.
(everything else in the code will function the same)

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!