Grayscale image and imshow

조회 수: 2 (최근 30일)
Brenden
Brenden 2011년 6월 7일
I have a grayscale jpg image. I have used a window function to bring the edges down to 0 however over the range that i have multiplied (coulombs and rows on the outer edges of the image) by the window function there is a light blue tint in the picture ???
imshow should only display in black and white should it not??

채택된 답변

Walter Roberson
Walter Roberson 2011년 6월 7일
If you have a "grayscale jpg image" then that could mean that you started with an RGB image in which the R, G, and B channels were all equal. Manipulating such an image could potentially end up with unequal channels.
The alternative is that you had an indexed (pseudocolor) image whose colormap consisted entirely of gray entries; if so then the color the image would show up would depend upon the colors available in the colormap you are using.
Please check the size() of the image: it would have 3 dimensions if it is a truecolor image whose R, G, and B were all equal.
  댓글 수: 4
Brenden
Brenden 2011년 6월 8일
So as you said above if there are 3 dimensions then it is a colour image that is only in use of black and white pigment however if i tamper with the image i can get other colours...
So then how do i alter the original image to make it gray scale and therefore any mathematical operations i do wont give unwanted colouring?
Brenden
Brenden 2011년 6월 8일
ok i tried to import the image a double but this does nothing. you have to use the command rgb2gray when importing the image...
ex: img=rgb2gray(imread('test.jpg')
thank you for your help Walter
BN

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Red에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by