imshow(uint8(imagematrix)) and imshow(int8(imagematrix)) gives different results although pixel values are between 0-255
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to understand effects of mean filter in zro mean gaussian noised image with different window size. image is read by imread and assigned to matrix.Although pixel values in the image matrix are between 0 and 255, imshow(uint8(imageMatrix)) and imshow(int8(imageMatrix)) gives different results-in int8 case the image is brighter for example.Why can be this happen, what is the reason and I am not sure which one is true while examining the effects of mean filter on zero-mean gaussian variance noised image? Thanks in advance friends.
1 commentaire
Réponse acceptée
Walter Roberson
le 8 Avr 2020
>> uint8(255)
ans =
uint8
255
>> int8(uint8(255))
ans =
int8
127
When you int8() data that is in the range 0 to 255, all values that are 128 or more are turned into 127, the maximum value for the range.
When you imshow() an int8 image, it notices that it is int8, and scales the colors to run from -128 to +127, with 0 being the middle color and 127 being the brightest color. But since you started with uint8 you do not have any values that are negative, and you will probably have a number of locations that int8() changed from being 128 or more into 127 which is maximum brightness for int8.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!