Borrar filtros
Borrar filtros

How can I convert my image to a red image

3 visualizaciones (últimos 30 días)
rama
rama el 13 de Dic. de 2022
Respondida: DGM el 13 de Dic. de 2022
this is my code:
function redImage(app, event)
a=getappdata(0,'a');
red=a;
red(:,:,2:3)=0;
setappdata(0,'filename',red);
imshow(red,'Parent',app.UIAxes2);
end

Respuesta aceptada

DGM
DGM el 13 de Dic. de 2022
That would work if you wanted a red image. It would even work if your input image were single-channel.
inpict = imread('cameraman.tif'); % MxNx1
inpict(:,:,2:3) = 0; % create red image by implicit expansion
imshow(inpict)
... but it wouldn't work if you wanted to do a green or blue image using the same method.
inpict(:,:,[1 3]) = 0; % create green image the same way?
imshow(inpict) % it's black because we just zeroed channel 1
See this thread:

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by