Background and Foreground separation.
Show older comments
I try to separate the foreground and background picture. The picture is two people are standing by the sea. How to separate the back ground and foreground. I use the color threshold but I got confused.Please help me out.
4 Comments
Image Analyst
on 13 Jun 2020
You could use image processing or computer vision. Like the foreground detector in the Computer Vision toolbox. Given what information you've provided, that's about all I can say.
Mahesh Taparia
on 15 Jun 2020
Hi
Can you share a sample image which you want to segment?
Image Analyst
on 15 Jun 2020
And what is background and what is foreground? The beach, the sea, the people, the sky?

Sandeep parajuli
on 28 Jun 2020
Edited: Sandeep parajuli
on 28 Jun 2020
Answers (1)
Image Analyst
on 28 Jun 2020
Try this to mask your image
% Mask the image using bsxfun() function to multiply the mask by each channel individually. Works for gray scale as well as RGB Color images.
maskedRgbImage = bsxfun(@times, rgbImage, cast(mask, 'like', rgbImage));
1 Comment
Sandeep parajuli
on 29 Jun 2020
Categories
Find more on Image Processing and Computer Vision in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!