Hi all, I am having a bit of a problem understanding Hugin's vignetting compensation. The background is that I am currently writing a software library for image transformation (among others, but most importantly, lens correction). However, while replicating the PTLens distortion seems to be largely working (although Hugin does seem to do things a little bit 'differently' there, too), the vignetting stuff is giving me headaches.
Basically, as far as I understood it, the correction is supposed to be done as a multiplicative factor c=1/(ar^6+br^4+c+1), and the corrected channel value should be given as I = I0*c. So what I am currently doing is the following, e.g. for the red channel: c=1.0/(((a*r*r+b)*r*r+c)*r*r+1.0); value_red = gamma(value_red); value_red = value_red * c; value_red = inv_gamma(value_red); with the appropriate gamma correction functions, e.g. gamma(v)=v^2.2 and inv_gamma(v)=v^(1/2.2), or the equivalent sRGB gamma functions. When I choose extreme values (e.g. c=-1), the values clip in the image corners, which happens both in Hugin and in my implementation at the same pixel position; so the coordinate system looks ok. Values near the center are untouched, as they should be. However, the 'middle' values do not quite match, no matter what I do. First I thought I was not properly compensating for gamma, but after checking and re- checking and double-checking I am pretty positive now that's not it... Hopefully I am overlooking something obvious... or does Hugin apply some additional correction curves, even if no photometric parameter except the 'a' coefficient above is set? Thanks and regards, Robert -- You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group. A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ To post to this group, send email to hugin-ptx@googlegroups.com To unsubscribe from this group, send email to hugin-ptx+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/hugin-ptx