>> >> On 2/4/12, Randolph Bentson <bent...@holmsjoen.com> wrote: >> > Oh, I guess the lambda function should be generalized by >> > >> > (lo,hi) = outI.getextrema() >> > x = 256.0/(hi-lo) >> > y = (0-lo)/256.0 >> > outJ = outI.point(lambda i:i*x+y) > > I have no experience with these type images, so I don't know if > constant values are appropriate. The performance of the generalized > mapping seems quick enough, so that may be safer. BUT, there's > one questionable issue with this function: it turns the darkest > source pixel to black and the lightest pixel to white. I hope > others can provide some comments on that.
I'm not an expert in image processing. I just want to learn more about this since we are talking about the mapping function here. I don't quite completely understand how this generalized mapping function work with im.point(). Given the hi and lo from getextema(), I understand that x = 256.0/(hi-lo) is a way to to adjust the scale parameter to the have a range of values from 0 to 256. but where does the offset of (y= (0-lo) /256 ) comes from ? is there any reference anyone can recommend as a tutorial about this kind of mapping function? > > -- > Randolph Bentson > bent...@holmsjoen.com > _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig