Added some debug info (with Verbose=true)
Load/Save Verbose in General section
This commit is contained in:
parent
e681354973
commit
18d6799cbe
@ -189,9 +189,7 @@ void dfInfo::updateBadPixelList( RawImage *df )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( settings->verbose ){
|
if( settings->verbose ){
|
||||||
for (std::list<badPix>::iterator iter = badPixels.begin(); iter !=badPixels.end(); iter ++)
|
printf( "Extracted %u pixels from darkframe %s\n", badPixels.size(),df->fname.c_str() );
|
||||||
printf( "(%d,%d) ",iter->x, iter->y);
|
|
||||||
printf( "Tot: %d\n", badPixels.size() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,8 +209,9 @@ void DFManager::init( Glib::ustring pathname )
|
|||||||
for (int i=0; i<names.size(); i++) {
|
for (int i=0; i<names.size(); i++) {
|
||||||
int lastdot = names[i].find_last_of ('.');
|
int lastdot = names[i].find_last_of ('.');
|
||||||
if (lastdot != Glib::ustring::npos && names[i].substr(lastdot) == ".badpixels" ){
|
if (lastdot != Glib::ustring::npos && names[i].substr(lastdot) == ".badpixels" ){
|
||||||
if( scanBadPixelsFile( names[i] ) && settings->verbose)
|
int n = scanBadPixelsFile( names[i] );
|
||||||
printf("Loaded badpixels file %s\n",names[i].c_str());
|
if( n>0 && settings->verbose)
|
||||||
|
printf("Loaded %s: %d pixels\n",names[i].c_str(),n);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try{
|
try{
|
||||||
@ -359,13 +358,18 @@ std::list<badPix> *DFManager::getHotPixels ( const Glib::ustring filename )
|
|||||||
std::list<badPix> *DFManager::getHotPixels ( const std::string &mak, const std::string &mod, int iso, double shut, time_t t )
|
std::list<badPix> *DFManager::getHotPixels ( const std::string &mak, const std::string &mod, int iso, double shut, time_t t )
|
||||||
{
|
{
|
||||||
dfInfo *df = find( mak, mod, iso, shut, t );
|
dfInfo *df = find( mak, mod, iso, shut, t );
|
||||||
if( df )
|
if( df ){
|
||||||
|
if( settings->verbose )
|
||||||
|
if( df->pathname.size() >0 )
|
||||||
|
printf( "Searched hotpixels from %s\n",df->pathname.c_str());
|
||||||
|
else if( df->pathNames.size() >0 )
|
||||||
|
printf( "Searched hotpixels from template (first %s)\n",df->pathNames.begin()->c_str());
|
||||||
return &df->getHotPixels();
|
return &df->getHotPixels();
|
||||||
else
|
}else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DFManager::scanBadPixelsFile( Glib::ustring filename )
|
int DFManager::scanBadPixelsFile( Glib::ustring filename )
|
||||||
{
|
{
|
||||||
FILE *file = fopen( filename.c_str(),"r" );
|
FILE *file = fopen( filename.c_str(),"r" );
|
||||||
if( !file ) return false;
|
if( !file ) return false;
|
||||||
@ -384,11 +388,10 @@ bool DFManager::scanBadPixelsFile( Glib::ustring filename )
|
|||||||
if( sscanf(line,"%d %d",&x,&y) == 2 )
|
if( sscanf(line,"%d %d",&x,&y) == 2 )
|
||||||
bp.push_back( badPix(x,y) );
|
bp.push_back( badPix(x,y) );
|
||||||
}
|
}
|
||||||
if( bp.size()>0 ){
|
int numPixels = bp.size();
|
||||||
|
if( numPixels >0 )
|
||||||
bpList[ makmodel ] = bp;
|
bpList[ makmodel ] = bp;
|
||||||
return true;
|
return numPixels;
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<badPix> *DFManager::getBadPixels ( const std::string &mak, const std::string &mod, const std::string &serial)
|
std::list<badPix> *DFManager::getBadPixels ( const std::string &mak, const std::string &mod, const std::string &serial)
|
||||||
@ -398,8 +401,13 @@ std::list<badPix> *DFManager::getBadPixels ( const std::string &mak, const std::
|
|||||||
if( serial.size()>0)
|
if( serial.size()>0)
|
||||||
s << " " << serial;
|
s << " " << serial;
|
||||||
bpList_t::iterator iter = bpList.find( s.str() );
|
bpList_t::iterator iter = bpList.find( s.str() );
|
||||||
if( iter != bpList.end() )
|
if( iter != bpList.end() ){
|
||||||
|
if( settings->verbose )
|
||||||
|
printf("Found:%s.badpixels in list\n",s.str().c_str());
|
||||||
return &(iter->second);
|
return &(iter->second);
|
||||||
|
}
|
||||||
|
if( settings->verbose )
|
||||||
|
printf("%s.badpixels not found\n",s.str().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ protected:
|
|||||||
Glib::ustring currentPath;
|
Glib::ustring currentPath;
|
||||||
dfInfo *addFileInfo(const Glib::ustring &filename );
|
dfInfo *addFileInfo(const Glib::ustring &filename );
|
||||||
dfInfo *find( const std::string &mak, const std::string &mod, int isospeed, double shut, time_t t );
|
dfInfo *find( const std::string &mak, const std::string &mod, int isospeed, double shut, time_t t );
|
||||||
bool scanBadPixelsFile( Glib::ustring filename );
|
int scanBadPixelsFile( Glib::ustring filename );
|
||||||
};
|
};
|
||||||
|
|
||||||
extern DFManager dfm;
|
extern DFManager dfm;
|
||||||
|
@ -777,6 +777,9 @@ void RawImageSource::preprocess (const RAWParams &raw)
|
|||||||
}else{
|
}else{
|
||||||
rid = dfm.searchDarkFrame( ri->make, ri->model, ri->iso_speed, ri->shutter, ri->timestamp);
|
rid = dfm.searchDarkFrame( ri->make, ri->model, ri->iso_speed, ri->shutter, ri->timestamp);
|
||||||
}
|
}
|
||||||
|
if( rid && settings->verbose){
|
||||||
|
printf( "Subtracting Darkframe:%s\n",rid->fname.c_str());
|
||||||
|
}
|
||||||
copyOriginalPixels(ri, rid);
|
copyOriginalPixels(ri, rid);
|
||||||
size_t widthBitmap = (ri->width/8+ (ri->width%8?1:0));
|
size_t widthBitmap = (ri->width/8+ (ri->width%8?1:0));
|
||||||
size_t dimBitmap = widthBitmap*ri->height;
|
size_t dimBitmap = widthBitmap*ri->height;
|
||||||
@ -786,17 +789,22 @@ void RawImageSource::preprocess (const RAWParams &raw)
|
|||||||
if( bp ){
|
if( bp ){
|
||||||
for(std::list<badPix>::iterator iter = bp->begin(); iter != bp->end(); iter++)
|
for(std::list<badPix>::iterator iter = bp->begin(); iter != bp->end(); iter++)
|
||||||
bitmapBads[ widthBitmap * (iter->y) + (iter->x)/8] |= 1<<(iter->x%8);
|
bitmapBads[ widthBitmap * (iter->y) + (iter->x)/8] |= 1<<(iter->x%8);
|
||||||
|
if( settings->verbose ){
|
||||||
|
printf( "Correcting %u pixels from .badpixels\n",bp->size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
bp = 0;
|
bp = 0;
|
||||||
if( raw.df_autoselect )
|
if( raw.df_autoselect ){
|
||||||
bp = dfm.getHotPixels( ri->make, ri->model, ri->iso_speed, ri->shutter, ri->timestamp);
|
bp = dfm.getHotPixels( ri->make, ri->model, ri->iso_speed, ri->shutter, ri->timestamp);
|
||||||
else if( raw.dark_frame.size()>0 )
|
}else if( raw.dark_frame.size()>0 )
|
||||||
bp = dfm.getHotPixels( raw.dark_frame );
|
bp = dfm.getHotPixels( raw.dark_frame );
|
||||||
if(bp)
|
if(bp){
|
||||||
for(std::list<badPix>::iterator iter = bp->begin(); iter != bp->end(); iter++)
|
for(std::list<badPix>::iterator iter = bp->begin(); iter != bp->end(); iter++)
|
||||||
bitmapBads[ widthBitmap *iter->y + iter->x/8] |= 1<<(iter->x%8);
|
bitmapBads[ widthBitmap *iter->y + iter->x/8] |= 1<<(iter->x%8);
|
||||||
|
if( settings->verbose && bp->size()>0){
|
||||||
|
printf( "Correcting %u hotpixels from darkframe\n",bp->size());
|
||||||
|
}
|
||||||
|
}
|
||||||
preInterpolate(false);
|
preInterpolate(false);
|
||||||
scaleColors( false,true);
|
scaleColors( false,true);
|
||||||
|
|
||||||
@ -850,7 +858,10 @@ void RawImageSource::preprocess (const RAWParams &raw)
|
|||||||
plistener->setProgressStr ("Hot/Dead Pixel Filter...");
|
plistener->setProgressStr ("Hot/Dead Pixel Filter...");
|
||||||
plistener->setProgress (0.0);
|
plistener->setProgress (0.0);
|
||||||
}
|
}
|
||||||
findHotDeadPixel( bitmapBads,0.1 );
|
int nFound =findHotDeadPixel( bitmapBads,0.1 );
|
||||||
|
if( settings->verbose && nFound>0){
|
||||||
|
printf( "Correcting %d hot/dead pixels found inside image\n",nFound );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cfaCleanFromMap( bitmapBads );
|
cfaCleanFromMap( bitmapBads );
|
||||||
delete [] bitmapBads;
|
delete [] bitmapBads;
|
||||||
|
@ -297,6 +297,7 @@ int Options::saveToFile (Glib::ustring fname) {
|
|||||||
keyFile.set_integer ("General", "Version", 290);
|
keyFile.set_integer ("General", "Version", 290);
|
||||||
keyFile.set_boolean ("General", "FirstRun", firstRun);
|
keyFile.set_boolean ("General", "FirstRun", firstRun);
|
||||||
keyFile.set_string ("General", "DarkFramesPath", rtSettings.darkFramesPath);
|
keyFile.set_string ("General", "DarkFramesPath", rtSettings.darkFramesPath);
|
||||||
|
keyFile.set_boolean ("General", "Verbose", rtSettings.verbose);
|
||||||
|
|
||||||
keyFile.set_integer ("External Editor", "EditorKind", editorToSendTo);
|
keyFile.set_integer ("External Editor", "EditorKind", editorToSendTo);
|
||||||
keyFile.set_string ("External Editor", "GimpDir", gimpDir);
|
keyFile.set_string ("External Editor", "GimpDir", gimpDir);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user