
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
I suppose you better use the following formula: pixOut = 255 * (pixIn - min) / (max - min) This should work and give you a positive image. Egon Dorrer Vexed Puppy schrieb: > I'm trying to perform normalization /contrast stretching on a gray > scale image. > However when applied I get a negative of the image. As i understand to > normalize an image i process each pixell using this formula: > > pixOut = ((pixIn - max)*((255-0)/(min-max))+0); > > where max is the maximum pixell density (say 235) and min is the > minimum (say 25) and the 255 and 0 are representing the complete range > of values. > > I'm going wrong somewhere but not sure where that is :/
| <-- __Chronological__ --> | <-- __Thread__ --> |