Background removal in matlab
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi people.please help me with the following question: "using an input colour image and the provided ROI mask, remove the background from the image. Retain only the approximate ROI. treat the mask as ground truth. The ROI mask is only an approximation and not meant to be taken as being exact.
1 comentario
Image Analyst
el 12 de Dic. de 2021
Please tell us what you mean by "remove the background". You in general cannot remove pixels from an image, though you can set them to some color, like black or white. For example if you had a donut, you can make the background black or white, and you could crop out a rectangular sub-image of the bounding box of the donut, but you can't have the center of the donut or the pixels outside of it be "removed" or "missing" since arrays cannot have missing elements. You can set those locations to some certain color, or even NaN or 0 or inf or whatever but you can't just get rid of them.
% 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));
Respuestas (1)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!