Bugfix for CA red/blue slider reading from keyFile. Improvements to CA autocorrect performance.
This commit is contained in:
parent
74e9b64fc7
commit
c65a22cc26
@ -153,9 +153,9 @@ void RawImageSource::CA_correct_RT(double cared, double cablue) {
|
||||
//temporary parameters for tile CA evaluation
|
||||
float gdiff, deltgrb;
|
||||
//interpolated G at edge of plaquette
|
||||
float Ginthfloor, Ginthceil, Gint, RBint, gradwt;
|
||||
float Ginthfloor, Ginthceil, Gint, gradwt;
|
||||
//interpolated color difference at edge of plaquette
|
||||
float grbdiffinthfloor, grbdiffinthceil, grbdiffint, grbdiffold;
|
||||
float grbdiffint, grbdiffold;
|
||||
//data for evaluation of block CA shift variance
|
||||
float blockave[2][3]={{0,0,0},{0,0,0}}, blocksqave[2][3]={{0,0,0},{0,0,0}}, blockdenom[2][3]={{0,0,0},{0,0,0}}, blockvar[2][3];
|
||||
//low and high pass 1D filters of G in vertical/horizontal directions
|
||||
@ -790,21 +790,6 @@ void RawImageSource::CA_correct_RT(double cared, double cablue) {
|
||||
|
||||
grbdiffold = rgb[indx][1]-rgb[indx][c];
|
||||
|
||||
//interpolate color difference from optical R/B locations to grid locations
|
||||
grbdiffinthfloor=(1-shifthfrac[c]/2)*grbdiff[indx]+(shifthfrac[c]/2)*grbdiff[indx-2*GRBdir[1][c]];
|
||||
grbdiffinthceil=(1-shifthfrac[c]/2)*grbdiff[(rr-2*GRBdir[0][c])*TS+cc]+(shifthfrac[c]/2)*grbdiff[(rr-2*GRBdir[0][c])*TS+cc-2*GRBdir[1][c]];
|
||||
//grbdiffint is bilinear interpolation of G-R/G-B at grid point
|
||||
grbdiffint=(1-shiftvfrac[c]/2)*grbdiffinthfloor+(shiftvfrac[c]/2)*grbdiffinthceil;
|
||||
|
||||
//now determine R/B at grid points using interpolated color differences and interpolated G value at grid point
|
||||
RBint=rgb[indx][1]-grbdiffint;
|
||||
|
||||
if (fabs(RBint-rgb[indx][c])<0.25*(RBint+rgb[indx][c])) {
|
||||
if (fabs(grbdiffold)>fabs(grbdiffint) ) {
|
||||
rgb[indx][c]=RBint;
|
||||
}
|
||||
} else {
|
||||
|
||||
//gradient weights using difference from G at CA shift points and G at grid points
|
||||
p[0]=1/(eps+fabs(rgb[indx][1]-gshift[indx]));
|
||||
p[1]=1/(eps+fabs(rgb[indx][1]-gshift[indx-2*GRBdir[1][c]]));
|
||||
@ -818,7 +803,7 @@ void RawImageSource::CA_correct_RT(double cared, double cablue) {
|
||||
if (fabs(grbdiffold)>fabs(grbdiffint) ) {
|
||||
rgb[indx][c]=rgb[indx][1]-grbdiffint;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//if color difference interpolation overshot the correction, just desaturate
|
||||
if (grbdiffold*grbdiffint<0) {
|
||||
|
@ -740,8 +740,8 @@ if (keyFile.has_group ("RAW")) {
|
||||
if (keyFile.has_key ("RAW", "DarkFrame")) raw.dark_frame = keyFile.get_string ("RAW", "DarkFrame" );
|
||||
if (keyFile.has_key ("RAW", "DarkFrameAuto")) raw.df_autoselect = keyFile.get_boolean ("RAW", "DarkFrameAuto" );
|
||||
if (keyFile.has_key ("RAW", "CA")) raw.ca_autocorrect = keyFile.get_boolean ("RAW", "CA" );
|
||||
if (keyFile.has_key ("RAW", "CARed")) raw.cared = keyFile.get_boolean ("RAW", "CARed" );
|
||||
if (keyFile.has_key ("RAW", "CABlue")) raw.cablue = keyFile.get_boolean ("RAW", "CABlue" );
|
||||
if (keyFile.has_key ("RAW", "CARed")) raw.cared = keyFile.get_double ("RAW", "CARed" );
|
||||
if (keyFile.has_key ("RAW", "CABlue")) raw.cablue = keyFile.get_double ("RAW", "CABlue" );
|
||||
if (keyFile.has_key ("RAW", "HotDeadPixels")) raw.hotdeadpix_filt = keyFile.get_boolean ("RAW", "HotDeadPixels" );
|
||||
if (keyFile.has_key ("RAW", "LineDenoise")) raw.linenoise = keyFile.get_integer ("RAW", "LineDenoise" );
|
||||
if (keyFile.has_key ("RAW", "GreenEqThreshold")) raw.greenthresh= keyFile.get_integer ("RAW", "GreenEqThreshold");
|
||||
|
Loading…
x
Reference in New Issue
Block a user