Open heckflosse opened 5 years ago
First version is available for test in cacorrect
branch.
At the moment there is no checkbox for ca correction. It's just called.
Gui control will follow later.
You also need to install librtprocess
I just added a checkbox for ca correction.
The results can be fantastic!
@heckflosse I noticed in the library set that CA correction can introduce artifacts where it looks like data is taken from the wrong image, hard to describe in words. Here is a set where this problem is very clear: https://filebin.net/nxpkpqjlkv3mynw5
@Beep6581 Please show a screenshot of the region in the image where the artifacts appear
The same problem in the library shots around the light bulb:
https://filebin.net/il7pzq83ly4miuru/karin_library_2_1-4_noca_crop.jpg?t=031xtx6b https://filebin.net/il7pzq83ly4miuru/karin_library_2_1-4_autocaall_crop.jpg?t=031xtx6b
@Beep6581 I found the reason for the artifacts. Looking for a fix now...
@heckflosse @Beep6581 Any news on this? Looking forward to CA correction in master
. :+1:
@Floessie I will continue after holidays
W10 errors when compiling cacorrect branch with gcc 8.2.0
D:/PROGRAMMES/HDRsource/hdr/src/Image.cpp: In member function 'void hdrmerge::Image::caCorrect(hdrmerge::RawParameters&, CaFitParams&, bool)':
D:/PROGRAMMES/HDRsource/hdr/src/Image.cpp:279:5: error: 'array2D' was not declared in this scope
array2D<float> temp(width, height);
^~~~~~~
D:/PROGRAMMES/HDRsource/hdr/src/Image.cpp:279:5: note: suggested alternative: 'Array2D'
array2D<float> temp(width, height);
^~~~~~~
Array2D
D:/PROGRAMMES/HDRsource/hdr/src/Image.cpp:279:13: error: expected primary-expression before 'float'
array2D<float> temp(width, height);
^~~~~
D:/PROGRAMMES/HDRsource/hdr/src/Image.cpp:282:13: error: 'temp' was not declared in this scope
temp[i][j] = (*this)(j, i) * scale[FCX(i,j)];
^~~~
D:/PROGRAMMES/HDRsource/hdr/src/Image.cpp:282:13: note: suggested alternative: 'time'
temp[i][j] = (*this)(j, i) * scale[FCX(i,j)];
^~~~
time
D:/PROGRAMMES/HDRsource/hdr/src/Image.cpp:291:51: error: 'temp' was not declared in this scope
if (CA_correct(width, height, true, 0.0, 0.0, temp, {{{FCX(0,0), FCX(0,1)},{FCX(1,0),FCX(1,1)}}}, setProgCancel, fitParams, fitParamsIn)) {
^~~~
D:/PROGRAMMES/HDRsource/hdr/src/Image.cpp:291:51: note: suggested alternative: 'time'
if (CA_correct(width, height, true, 0.0, 0.0, temp, {{{FCX(0,0), FCX(0,1)},{FCX(1,0),FCX(1,1)}}}, setProgCancel, fitParams, fitParamsIn)) {
^~~~
time
D:/PROGRAMMES/HDRsource/hdr/src/Image.cpp:291:9: error: 'CA_correct' was not declared in this scope
if (CA_correct(width, height, true, 0.0, 0.0, temp, {{{FCX(0,0), FCX(0,1)},{FCX(1,0),FCX(1,1)}}}, setProgCancel, fitParams, fitParamsIn)) {
^~~~~~~~~~
D:/PROGRAMMES/HDRsource/hdr/src/Image.cpp:291:9: note: suggested alternative:
In file included from D:/PROGRAMMES/HDRsource/hdr/src/Image.hpp:31,
from D:/PROGRAMMES/HDRsource/hdr/src/Image.cpp:23:
C:/msys64/mingw64/include/rtprocess/librtprocess.h:34:10: note: 'librtprocess::CA_correct'
bool CA_correct(int winx, int winy, int winw, int winh, const bool autoCA,size_t autoIterations, const double cared, const double cablue, bool avoidColourshift, const float * const *rawDataIn, float **rawDataOut, const ColorFilterArray &cfarray, const std::function<bool(double)> &setProgCancel, CaFitParams &fitParams, bool fitParamsIn, float inputScale = 65535.f, float outputScale = 65535.f);
^~~~~~~~~~
and a lot of warnings if you are interested
I will fix that after holidays
@heckflosse could you have a look please?
This looks pretty amazing. Any word on it?
@Beep6581 I found the reason for the artifacts. Looking for a fix now...
@heckflosse could you direct me to what you think the reason behind the artefacts is? I want to help and would love a hint :)
@fanckush I think the reason is, that the raw data is not white balanced. In RawTherapee we apply an auto whitebalance to the raw data before raw ca correction and demosaic and revert this scale after demosaic. Iirc this gave better raw ca correction and demosaic results and afaik that's the only difference atm between raw ca correction in RawTherapee and this hdrmerge branch.
I just want to mention that there is some work by @CarVac and me in project https://github.com/CarVac/librtprocess This work will also lead to allow usage of raw ca correction before merging the files in hdmerge....
Stay tuned...