Three channel image to one channel
Mostra commenti meno recenti
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
Risposte (1)
Image Analyst
il 7 Mag 2014
See Steve's blog: http://blogs.mathworks.com/steve/2011/03/08/tips-for-reading-a-camera-raw-file-into-matlab/#comments
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 Commenti
Kat
il 8 Mag 2014
Image Analyst
il 8 Mag 2014
I don't know because I don't work with raw images. If you do, then you're responsible for demosaicing your image. I don't want to hassle with that, and the images I get from the camera are good enough that I don't need to get raw images with all the dead pixels, etc. and then have to hassle with building an RGB image from it.
Kat
il 9 Mag 2014
Image Analyst
il 9 Mag 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
il 9 Mag 2014
Categorie
Scopri di più su Convert Image Type in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!