Changes to defringe tool.

This commit is contained in:
Emil Martinec
2010-11-27 07:43:12 -06:00
parent 617562c8ea
commit 1e613bd602
2 changed files with 10 additions and 4 deletions

View File

@@ -423,6 +423,8 @@ PREFERENCES_CACHESTRAT;Cache Strategy
PREFERENCES_CACHETHUMBFORM;Cache Thumbnail Format
PREFERENCES_CACHETHUMBHEIGHT;Maximal Thumbnail Height
PREFERENCES_CACORRECTION;Apply CA auto correction
PREFERENCES_CARED;Red CA manual correction
PREFERENCES_CABLUE;Blue CA manual correction
PREFERENCES_CLIPPINGIND;Clipping indication
PREFERENCES_CMETRICINTENT;Colorimetric Intent
PREFERENCES_DARKFRAME;Dark frame
@@ -600,6 +602,9 @@ TP_CROP_SELECTCROP; Select Crop
TP_CROP_W;W
TP_CROP_X;x
TP_CROP_Y;y
TP_DEFRINGE_LABEL;Defringe
TP_DEFRINGE_RADIUS;Radius
TP_DEFRINGE_THRESHOLD;Threshold
TP_DETAIL_AMOUNT;Amount
TP_DIRPYRDENOISE_CHROMA;Chrominance
TP_DIRPYRDENOISE_GAMMA;Gamma

View File

@@ -27,7 +27,6 @@
//#include <rtengine.h>
//#include <math.h>
//#include <colorclip.h>
#include <gauss.h>
//#include <bilateral2.h>
#include <improcfun.h>
@@ -49,7 +48,7 @@ void ImProcFunctions::PF_correct_RT(LabImage * src, LabImage * dst, double radiu
// local variables
int width=src->W, height=src->H;
//temporary array to store simple interpolation of G
//temporary array to store chromaticity
int (*fringe);
fringe = (int (*)) calloc ((height)*(width), sizeof *fringe);
@@ -93,8 +92,10 @@ void ImProcFunctions::PF_correct_RT(LabImage * src, LabImage * dst, double radiu
for(int j = 0; j < width; j++) {
tmp1->a[i][j] = src->a[i][j];
tmp1->b[i][j] = src->b[i][j];
//test for pixel darker than some fraction of neighborhood ave, and near an edge
if (100*tmp1->L[i][j]>thresh*src->L[i][j] && 100*abs(tmp1->L[i][j]-src->L[i][j])>0.1*(tmp1->L[i][j]+src->L[i][j])) {
//test for pixel darker than some fraction of neighborhood ave, near an edge, more saturated than average
/*if (100*tmp1->L[i][j]>50*src->L[i][j] && \*/
/*1000*abs(tmp1->L[i][j]-src->L[i][j])>thresh*(tmp1->L[i][j]+src->L[i][j]) && \*/
if (33*fringe[i*width+j]>thresh*chromave) {
float atot=0;
float btot=0;
float norm=0;