image conversion

조회 수: 2 (최근 30일)
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2012년 4월 10일
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
Daniel Shub
Daniel Shub 2012년 4월 10일
Are you trying to convert a color image into a black and white image?
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2012년 4월 10일
Thanks for writing Daniel. Sometimes I will have gray image with the dimension i mentioned earlier. Some commands does not accept 3D.. So, i will be changing.

댓글을 달려면 로그인하십시오.

답변 (3개)

Junaid
Junaid 2012년 4월 10일
yes, you can convert color image to gray scale image, and gray scale image is 2-D image.
  댓글 수: 4
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2012년 4월 10일
thanks Baber. I will take your points.
Taler kk
Taler kk 2013년 5월 16일
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
Image Analyst 2012년 4월 10일
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
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2012년 4월 10일
Thanks Image Analyst. I know your profession well. Thatsy Sometimes I used to post my doubts mentioning your name itself.

댓글을 달려면 로그인하십시오.


Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2012년 4월 10일
Hi Friends, I Thank all for replying my doubt.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by