Effacer les filtres
Effacer les filtres

Normalise an Uint16 image between specified limits

4 vues (au cours des 30 derniers jours)
Kavitha Srinivasan
Kavitha Srinivasan le 28 Juin 2013
Hi all
I have a gray-scale image in double precision that has to be converted to uint16 and normalise the image between the limits, say, 0-4000. I could convert the image to uint16. But when I do the normalisation by dividing with the maximum intensity of the image and then multiplying it with the maximum (say 4000)that i want to have, all the pixel values are saturated. I think this operation does the rounding thing as it is an integer. could anyone let me know how the normalisation within specified limits could be done for image matrix of uint16.
Your help is much appreciated. Regards

Réponse acceptée

Walter Roberson
Walter Roberson le 28 Juin 2013
uint16( YourImage ./ (ExistingImageMaximum .* (1+eps)) .* NewImageMaximum )
Note: with this particular formulation, 0 and the new maximum will only have 1/2 of the probability of the other bins, which has to do with uint16() rounding. If you change to multiplying by (NewImageMaximum+1) and you floor() before you uint16() then the bins should equalize.
  3 commentaires
Kavitha Srinivasan
Kavitha Srinivasan le 28 Juin 2013
Hi
It worked. Thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by