timothybrooks / hdr-plus

HDR+ Implementation
MIT License
601 stars 203 forks source link

Process with GR/BG pattern. #26

Closed hiepgaf closed 5 years ago

hiepgaf commented 5 years ago

Hi @timothybrooks, I was compiled this project and run with raw images capture from my phone, but the result was bad. and I realized my input is in GRBG pattern and this project was developed for RGGB pattern when run finish function it seem to be not correct, how to run with GRBG?

brotherofken commented 5 years ago

As a fast hack you could try add something like this into the load_raw:

     for (int y = 0; y < height; y++) {
         for (int x = 0; x < width; x++) {
             if (x % 2 == 0 && y % 2 == 0) {
                 std::swap(data[y*width+x], data[y*width+x]); // make indices correct
             }
         }