Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raw ca correction #162

Open
heckflosse opened this issue Sep 2, 2018 · 16 comments
Open

raw ca correction #162

heckflosse opened this issue Sep 2, 2018 · 16 comments
Assignees
Milestone

Comments

@heckflosse
Copy link
Collaborator

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...

@heckflosse heckflosse self-assigned this Sep 2, 2018
@heckflosse
Copy link
Collaborator Author

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

@heckflosse
Copy link
Collaborator Author

I just added a checkbox for ca correction.

@Beep6581
Copy link
Collaborator

Beep6581 commented Sep 3, 2018

The results can be fantastic!
screenshot_20180903_224202
screenshot_20180903_224210

@Beep6581 Beep6581 added this to the v1.0 milestone Sep 3, 2018
@Beep6581
Copy link
Collaborator

Beep6581 commented Sep 5, 2018

@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

@heckflosse
Copy link
Collaborator Author

@Beep6581 Please show a screenshot of the region in the image where the artifacts appear

@Beep6581
Copy link
Collaborator

Beep6581 commented Sep 5, 2018

screenshot_20180905_110502

@Beep6581
Copy link
Collaborator

Beep6581 commented Sep 5, 2018

@heckflosse
Copy link
Collaborator Author

@Beep6581 I found the reason for the artifacts. Looking for a fix now...

@Floessie
Copy link
Contributor

Floessie commented Oct 2, 2018

@heckflosse @Beep6581 Any news on this? Looking forward to CA correction in master. 👍

@heckflosse
Copy link
Collaborator Author

@Floessie I will continue after holidays

@gaaned92
Copy link

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

@heckflosse
Copy link
Collaborator Author

I will fix that after holidays

@gaaned92
Copy link

@heckflosse could you have a look please?

@olokobayusuf
Copy link

This looks pretty amazing. Any word on it?

@fanckush
Copy link
Contributor

@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 :)

@heckflosse
Copy link
Collaborator Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants