image conversion
Mostrar comentarios más antiguos
Hi,
When the input image is of dimension 256 256 3..... I will use the command rgb2gray to make it as 2D image to work it out. Whether this procedure is correct?
Regards,
Siva
2 comentarios
Daniel Shub
el 10 de Abr. de 2012
Are you trying to convert a color image into a black and white image?
Sivakumaran Chandrasekaran
el 10 de Abr. de 2012
Respuestas (3)
Junaid
el 10 de Abr. de 2012
2 votos
yes, you can convert color image to gray scale image, and gray scale image is 2-D image.
4 comentarios
Sivakumaran Chandrasekaran
el 10 de Abr. de 2012
Baber
el 10 de Abr. de 2012
many image processing algorithm work on gray scale image(2-D) image, in case you want to do it in loop then do it like this
if size(img,3) >1
img = rgb2gray(img);
end
Where size(img,3) will return you the number of channels ( 1 means 2-D image and more then values indicates higher channels.)
Sivakumaran Chandrasekaran
el 10 de Abr. de 2012
Taler kk
el 16 de Mayo de 2013
You may be interested in image conversion sdk in .NET,feature of Convert image among Binary (1-bit), Gray Scale, RGB etc.Automatically detect source image & document format .check it http://www.rasteredge.com/how-to/winforms-net-imaging/image-converting/
Image Analyst
el 10 de Abr. de 2012
Yes, you can do that, though it is often not the way to get the best possible gray scale image. You can do this:
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
grayImage = rgb2gray(rgbImage);
and use imshow on each of those to find out which gives you the best contrast, or whatever it is that you think would give you the best image. Or even better, use Principal Components Analysis (PCA) to find out the best combination of those color channels to give you the combination to get you a good signal along the optimal direction in the 3D color gamut space.
Or even better is to show us your image and tell us what you want to measure or enhance in the image. Perhaps you don't want to throw away all your color information at all. Maybe you can use the color information to your advantage. I can't tell unless I see your image. I do this stuff all day for a living, as you might guess from my icon.
1 comentario
Sivakumaran Chandrasekaran
el 10 de Abr. de 2012
Sivakumaran Chandrasekaran
el 10 de Abr. de 2012
0 votos
Categorías
Más información sobre Image Processing Toolbox en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!