 # Vignetting Correction Calibration File

Hello,

I’m trying to apply vignetting correction to my HDR images but I’m unsure whether it’s actually being done. I’ve calculated the coefficients for a sixth-order polynomial, but I’m unsure how to practically write them into the .cal file. The code executes without errors, but I’m not sure that it’s actually carrying out the correction… I even tried using fictitious coefficients to make the centre of the image darker to check if the code was working, but nothing seemed to change.

My .cal file is written as follows:

a=-17.66934113;
b=52.23829714;
c=-58.4338573;
d=29.73823987;
e=-6.765442523;
f=0.558903182

The line of code I’m using is pcomb -f vignetting.cal hdrsmall.hdr > hdrsmall_vigcorr.hdr Can someone confirm whether the .cal file is correctly written and if the line of code is correct? How can I be sure that the vignetting correcting is actually being applied? I copied exactly what’s written on pg. 22 of Pierson et al.’s paper (2020).

Many thanks,
Joe

Hi Joe,

Does your .cal file only contain the parameters of your vignetting function (as written in your post), or does it also contain the equations to apply the vignetting correction? pcomb needs the equations to know what modification to apply to the pixels of your image.
Your .cal file should look something like this:

sq(x)=x*x;
r=sqrt(sq(x-XC)+sq(y-YC))/R;
sf=1/((a*r^6)+(b*r^5)+(c*r^4)+(d*r^3)+(e*r^2)+(f*r)+1);
ro=sf*ri(1);
go=sf*gi(1);
bo=sf*bi(1);

with XC, YC, R, a, b, c, d, e, f replaced with your own predetermined values.
If that is what you are doing, then I can have a look at your HDR image if you send it over.

I hope that helps!
Clotilde

Hi Clotilde,

Many thanks for your reply, it’s working now!! I thought the .cal file only had to provide the coefficients.

Best regards,
Joe