Three channel image to one channel

27 visualizaciones (últimos 30 días)
Kat
Kat el 7 de Mayo de 2014
Comentada: Kat el 9 de Mayo de 2014
I'm trying to convert a 3-channel rgb raw image to a one channel image in Matlab. I've tried concatenating but that was still unsuccessful. Any other suggestions?
The raw image I found online and I personally don't care which format it's in (whether NEX/ARW/etc). Just need to get it to one channel.
Thanks

Respuestas (1)

Image Analyst
Image Analyst el 7 de Mayo de 2014
Then once the raw image is in MATLAB, you can use rgb2gray() to convert it into grayscale. Or you can simply take one of the color channels, depending on what you want to end up with.
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
  5 comentarios
Image Analyst
Image Analyst el 9 de Mayo de 2014
What did you mean by "The raw image I found online and I personally don't care which format it's in (whether NEX/ARW/etc)." Did you snap a photo from your camera and tell it to save in raw format? If so, then it should have a format and you'll need to read that. I don't understand the concept of finding some random raw image on the internet somewhere and not caring at all what format it is in. What's the point of that?
Kat
Kat el 9 de Mayo de 2014
I did take a picture with a sony camera in ARW format. I also found raw Canon/Nikon images online. So if I found a good method to convert those raw images to one band but it doesn't use ARW formats, I still have images. Since I'm testing the algorithm for demosaicking and not comparing camera formats, it really doesn't matter which type of raw image I have, just that I have a raw image to run through two algorithms and compare the outputs.

Iniciar sesión para comentar.

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by