Add some profiling info
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
#include "imageinfo.h"
|
#include "imageinfo.h"
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QElapsedTimer>
|
||||||
|
#include <QDebug>
|
||||||
#include <libexif/exif-data.h>
|
#include <libexif/exif-data.h>
|
||||||
#include <fitsio2.h>
|
#include <fitsio2.h>
|
||||||
#include "rawimage.h"
|
#include "rawimage.h"
|
||||||
@@ -216,6 +218,7 @@ void LoadRunable::run()
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
QElapsedTimer timer;
|
||||||
ImageInfoData info;
|
ImageInfoData info;
|
||||||
QFileInfo finfo(m_file);
|
QFileInfo finfo(m_file);
|
||||||
info.append(StringPair(QObject::tr("Filename"), finfo.fileName()));
|
info.append(StringPair(QObject::tr("Filename"), finfo.fileName()));
|
||||||
@@ -225,8 +228,10 @@ void LoadRunable::run()
|
|||||||
bool raw = false;
|
bool raw = false;
|
||||||
if(m_file.endsWith(".CR2", Qt::CaseInsensitive))
|
if(m_file.endsWith(".CR2", Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
|
timer.start();
|
||||||
loadRAW(m_file, info, m_analyzeLevel != None ? &rawImage : nullptr, &img);
|
loadRAW(m_file, info, m_analyzeLevel != None ? &rawImage : nullptr, &img);
|
||||||
raw = true;
|
raw = true;
|
||||||
|
qDebug() << "LoadRaw" << timer.elapsed();
|
||||||
}
|
}
|
||||||
else if(m_file.endsWith(".FIT", Qt::CaseInsensitive))
|
else if(m_file.endsWith(".FIT", Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
@@ -250,7 +255,9 @@ void LoadRunable::run()
|
|||||||
{
|
{
|
||||||
uint64_t mean, median, min, max;
|
uint64_t mean, median, min, max;
|
||||||
double stdDev;
|
double stdDev;
|
||||||
|
timer.start();
|
||||||
rawImage->imageStats(&mean, &stdDev, &median, &min, &max);
|
rawImage->imageStats(&mean, &stdDev, &median, &min, &max);
|
||||||
|
qDebug() << "image stats" << timer.restart();
|
||||||
info.append(StringPair(QObject::tr("Mean"), QString::number(mean)));
|
info.append(StringPair(QObject::tr("Mean"), QString::number(mean)));
|
||||||
info.append(StringPair(QObject::tr("Standart deviation"), QString::number(stdDev)));
|
info.append(StringPair(QObject::tr("Standart deviation"), QString::number(stdDev)));
|
||||||
info.append(StringPair(QObject::tr("Median"), QString::number(median)));
|
info.append(StringPair(QObject::tr("Median"), QString::number(median)));
|
||||||
@@ -265,8 +272,11 @@ void LoadRunable::run()
|
|||||||
qDebug() << "quarter" << timer.restart();
|
qDebug() << "quarter" << timer.restart();
|
||||||
}
|
}
|
||||||
rawImage->medianFilter();
|
rawImage->medianFilter();
|
||||||
|
qDebug() << "median" << timer.restart();
|
||||||
int numPeaks = rawImage->findPeaks(median+stdDev, 20, peaks);
|
int numPeaks = rawImage->findPeaks(median+stdDev, 20, peaks);
|
||||||
|
qDebug() << "peaks" << timer.restart();
|
||||||
drawPeaks(img, peaks);
|
drawPeaks(img, peaks);
|
||||||
|
qDebug() << "draw peaks" << timer.restart();
|
||||||
info.append(StringPair(QObject::tr("Peaks"), QString::number(numPeaks)));
|
info.append(StringPair(QObject::tr("Peaks"), QString::number(numPeaks)));
|
||||||
info.append(StringPair(QObject::tr("Peaks draw"), QString::number(peaks.size())));
|
info.append(StringPair(QObject::tr("Peaks draw"), QString::number(peaks.size())));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user