Image Extraction From Another one
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Rasho
el 12 de Oct. de 2021
Comentada: Rasho
el 12 de Oct. de 2021
Hello,
How can I get the color image from the color and gray image?
Thank you.
0 comentarios
Respuesta aceptada
Image Analyst
el 12 de Oct. de 2021
Convert to HSV color space and take where the saturation > 0
hsvImage = rgb2hsv(rgbImage);
mask = hsvImage(:, :, 2) > 0;
% 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));
%maskedRgbImage = pagemtimes(rgbImage, cast(mask, 'like', rgbImage)); % R2020b and later.
Más respuestas (0)
Ver también
Categorías
Más información sobre Modify Image Colors en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!