Igv and LMMSE demosaicing for noisy images see issue1741
This commit is contained in:
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
|
||||
#include "rtengine.h"
|
||||
|
||||
#include "rtengine.h"
|
||||
#include "rawimagesource.h"
|
||||
#include "rawimagesource_i.h"
|
||||
#include "median.h"
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "../rtgui/options.h"
|
||||
#include "dcp.h"
|
||||
#include "rt_math.h"
|
||||
#include "improcfun.h"
|
||||
#include "improcfun.h"
|
||||
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
@@ -1102,6 +1102,10 @@ void RawImageSource::demosaic(const RAWParams &raw)
|
||||
dcb_demosaic(raw.dcb_iterations, raw.dcb_enhance);
|
||||
else if (raw.dmethod == RAWParams::methodstring[RAWParams::eahd])
|
||||
eahd_demosaic ();
|
||||
else if (raw.dmethod == RAWParams::methodstring[RAWParams::igv])
|
||||
igv_interpolate();
|
||||
else if (raw.dmethod == RAWParams::methodstring[RAWParams::lmmse])
|
||||
lmmse_interpolate_omp(W,H);
|
||||
else if (raw.dmethod == RAWParams::methodstring[RAWParams::fast] )
|
||||
fast_demosaic (0,0,W,H);
|
||||
//nodemosaic();//for testing
|
||||
@@ -1368,7 +1372,7 @@ void RawImageSource::scaleColors(int winx,int winy,int winw,int winh, const RAWP
|
||||
black_lev[2]=raw.blacktwo;//B
|
||||
black_lev[3]=raw.blackthree;//G2 (only used with a Bayer filter)
|
||||
|
||||
for(int i=0; i<4 ;i++) cblacksom[i] = max( c_black[i]+black_lev[i], 0.0f ); // adjust black level
|
||||
for(int i=0; i<4 ;i++) cblacksom[i] = max( c_black[i]+black_lev[i], 0.0f ); // adjust black level
|
||||
// this seems strange, but it works
|
||||
|
||||
// scale image colors
|
||||
@@ -2368,7 +2372,7 @@ void RawImageSource::getRowStartEnd (int x, int &start, int &end) {
|
||||
if (!ri->isBayer()) {
|
||||
int xmin, xmax, ymin, ymax;
|
||||
int xr, xg, xb, yr, yg, yb;
|
||||
for (size_t i=0; i<red.size(); i++) {
|
||||
for (size_t i=0; i<red.size(); i++) {
|
||||
transformPosition (red[i].x, red[i].y, tran, xr, yr);
|
||||
transformPosition (green[i].x, green[i].y, tran, xg, yg);
|
||||
transformPosition (blue[i].x, blue[i].y, tran, xb, yb);
|
||||
@@ -2391,7 +2395,7 @@ void RawImageSource::getRowStartEnd (int x, int &start, int &end) {
|
||||
|
||||
int d[9][2] = {{0,0}, {-1,-1}, {-1,0}, {-1,1}, {0,-1}, {0,1}, {1,-1}, {1,0}, {1,1}};
|
||||
int rloc, gloc, bloc, rnbrs, gnbrs, bnbrs;
|
||||
for (size_t i=0; i<red.size(); i++) {
|
||||
for (size_t i=0; i<red.size(); i++) {
|
||||
transformPosition (red[i].x, red[i].y, tran, x, y);
|
||||
rloc=gloc=bloc=rnbrs=gnbrs=bnbrs=0;
|
||||
for (int k=0; k<9; k++) {
|
||||
@@ -2524,6 +2528,9 @@ void RawImageSource::inverse33 (const double (*rgb_cam)[3], double (*cam_rgb)[3]
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//Emil's code
|
||||
/*
|
||||
* Now compiled separately
|
||||
*
|
||||
#include "fast_demo.cc"//fast demosaic
|
||||
#include "amaze_demosaic_RT.cc"//AMaZE demosaic
|
||||
#include "CA_correct_RT.cc"//Emil's CA auto correction
|
||||
@@ -2532,6 +2539,7 @@ void RawImageSource::inverse33 (const double (*rgb_cam)[3], double (*cam_rgb)[3]
|
||||
#include "hilite_recon.cc"//Emil's highlight reconstruction
|
||||
|
||||
#include "expo_before_b.cc"//Jacques's exposure before interpolation
|
||||
*/
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
#undef PIX_SORT
|
||||
|
Reference in New Issue
Block a user