Add flat field correction for monochrome raw files

This commit is contained in:
heckflosse
2018-03-09 14:51:28 +01:00
parent 9e05e18c8f
commit 84f46eaab6
9 changed files with 61 additions and 25 deletions

View File

@@ -138,7 +138,7 @@ void ffInfo::updateRawImage()
int H = ri->get_height();
int W = ri->get_width();
ri->compress_image(0);
int rSize = W * ((ri->getSensorType() == ST_BAYER || ri->getSensorType() == ST_FUJI_XTRANS) ? 1 : 3);
int rSize = W * ((ri->getSensorType() == ST_BAYER || ri->getSensorType() == ST_FUJI_XTRANS || ri->get_colors() == 1) ? 1 : 3);
acc_t **acc = new acc_t*[H];
for( int row = 0; row < H; row++) {
@@ -160,7 +160,7 @@ void ffInfo::updateRawImage()
temp->compress_image(0); //\ TODO would be better working on original, because is temporary
nFiles++;
if( ri->getSensorType() == ST_BAYER || ri->getSensorType() == ST_FUJI_XTRANS ) {
if( ri->getSensorType() == ST_BAYER || ri->getSensorType() == ST_FUJI_XTRANS || ri->get_colors() == 1 ) {
for( int row = 0; row < H; row++) {
for( int col = 0; col < W; col++) {
acc[row][col] += temp->data[row][col];