Fixes chromatic aberration in an HDR input file, in EXR format, and saves the result to a new HDR file, also in EXR format. The algorithm is somewhat different from, but strongly inspired by: Sing Bing Kang. "Automatic Removal of Chromatic Aberration from a Single Image". Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Pages 1-8. 2007. The cited paper corrects for a number of different causes of chromatic aberration, but this implementation only attempts to scale the color channels, in proportion to a polynomial (in the radius from the center of the image), where the degree parameter is the degree of this polynomial. The coefficients are chosen to minimize the L2 distance between locally-normalized Canny edge strengths in each channel. Following Kang, green is the reference channel, and the Nelder-Mead simplex algorithm is used for optimization. The problem which we are attmpeting to minimize is highly non-convex, with a large number of local minima. Hence, this program can often take an extremely long time to converge, and is not guaranteed to find a good solution. As usual, the epsilon parameter is the termination threshold, and it may be increased to improve runtime, or decreased to improve quality. In practice, the default value consistently improves the chromatic aberration in the image, although perhaps not quite as much as would be desired. This program is extremely slow! Be patient. Usage: hdr_fix_ca.exe [OPTION...] -h, --help show help -i, --input=INPUT input file (EXR) -o, --output=OUTPUT output file (EXR) -d, --degree=INT(=1) polynomial degree -e, --epsilon=FLOAT(=0.0001) epsilon parameter