When i wrote these commands
out = ones(size(ben))
imshow(out)
the output is a white picture but i expect almost dark picture because the rgb values are 1,1,1. when i give 255,255,255 it also gives a white picture. Isn’t this a dilemma ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try
out = ones(size(ben), 'uint8');ones()by default creates an array of doubles. Whenimshow()gets an array of doubles it assumes that the pixel values range between 0 and 1, and assigns the white color to anything greater than 1. However, if you pass an array ofuint8toimshow()it will assume the range to be between 0 and 255.You can also try using
imagesc();instead ofimshow(), but you may need to docolormap grayafter wards to get a grayscale image.Another alternative is to rescale the image before display: