QtestceplibQwtMainWindow::QtestceplibQwtMainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::QtestceplibQwtMainWindow), m_Mutex(QMutex::Recursive), m_IntProp(QcepSettingsSaverWPtr(), this, "intProp", 42, "Integer Property"), m_DblProp(QcepSettingsSaverWPtr(), this, "dblProp", 42.0, "Double Property"), m_StrProp(QcepSettingsSaverWPtr(), this, "strProp", "42", "String Property"), m_SListProp(QcepSettingsSaverWPtr(), this, "sListProp", QcepStringList(), "String List Property"), m_Vec3dPropA(QcepSettingsSaverWPtr(), this, "vec3dPropA", QcepVector3D(1,2,3), "Vector 3D Property A"), m_Vec3dPropB(QcepSettingsSaverWPtr(), this, "vec3dPropB", 1,2,3, "Vector 3D Property B"), m_Mat3x3PropA(QcepSettingsSaverWPtr(), this, "mat3x3PropA", QcepMatrix3x3(), "Matrix 3x3 Property A"), m_Mat3x3PropB(QcepSettingsSaverWPtr(), this, "mat3x3PropB", 1, 0, 0, 0, 1, 0, 0, 0, 1, "Matrix 3x3 Property B") { ui->setupUi(this); connect(ui->m_ActionReadSettings, SIGNAL(triggered()), this, SLOT(doReadSettings())); connect(ui->m_ActionWriteSettings, SIGNAL(triggered()), this, SLOT(doWriteSettings())); connect(ui->m_ActionLoadImage, SIGNAL(triggered()), this, SLOT(doLoadImage())); ui->m_FileMenu->addAction(tr("QCEPLIB Version %1").arg(STR(QCEPLIB_VERSION))); ui->m_FileMenu->addAction(tr("QWT Version %1").arg(STR(QCEPLIB_QWT_VERSION))); }
Detector::Status Detector::loadSpectacles(const string path) { spectaclesSrc = path; Status status = doLoadImage(spectaclesSrc, spectacles); if (status!=StatusOK) return status; //crop the specs doThreshold(spectacles, specMask, 150, 255, CV_THRESH_BINARY_INV ); if (debug) { namedWindow("Threshold"); imshow("Threshold",specMask); } int lowRow = -1, highRow = specMask.rows; while(sum(specMask.row(++lowRow))==Scalar::all(0)); while(sum(specMask.row(--highRow))==Scalar::all(0)); spectacles = spectacles.rowRange(lowRow, highRow); specMask = specMask.rowRange(lowRow, highRow); int lowCol = -1, highCol = specMask.cols; while(sum(specMask.col(++lowCol))==Scalar::all(0)); while(sum(specMask.col(--highCol))==Scalar::all(0)); spectacles = spectacles.colRange(lowCol, highCol); if (debug) { namedWindow("Spectacles"); imshow("Spectacles", spectacles); } return StatusOK; }
QtestceplibCombinedMainWindow::QtestceplibCombinedMainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::QtestceplibCombinedMainWindow), m_Mutex(QMutex::Recursive), m_IntProp(QcepSettingsSaverWPtr(), this, "intProp", 42, "Integer Property"), m_DblProp(QcepSettingsSaverWPtr(), this, "dblProp", 42.0, "Double Property"), m_StrProp(QcepSettingsSaverWPtr(), this, "strProp", "42", "String Property"), m_SListProp(QcepSettingsSaverWPtr(), this, "sListProp", QcepStringList(), "String List Property"), m_Vec3dPropA(QcepSettingsSaverWPtr(), this, "vec3dPropA", QcepVector3D(1,2,3), "Vector 3D Property A"), m_Vec3dPropB(QcepSettingsSaverWPtr(), this, "vec3dPropB", 1,2,3, "Vector 3D Property B"), m_Mat3x3PropA(QcepSettingsSaverWPtr(), this, "mat3x3PropA", QcepMatrix3x3(), "Matrix 3x3 Property A"), m_Mat3x3PropB(QcepSettingsSaverWPtr(), this, "mat3x3PropB", 1, 0, 0, 0, 1, 0, 0, 0, 1, "Matrix 3x3 Property B") { ui->setupUi(this); connect(ui->m_ActionReadSettings, SIGNAL(triggered()), this, SLOT(doReadSettings())); connect(ui->m_ActionWriteSettings, SIGNAL(triggered()), this, SLOT(doWriteSettings())); connect(ui->m_ActionLoadImage, SIGNAL(triggered()), this, SLOT(doLoadImage())); connect(ui->m_ActionLoadTIFFImage, SIGNAL(triggered()), this, SLOT(doLoadTIFFImage())); connect(ui->m_ActionLoadCBFImage, SIGNAL(triggered()), this, SLOT(doLoadCBFImage())); connect(ui->m_ActionTestHDF, SIGNAL(triggered()), this, SLOT(doTestHDF5Library())); connect(ui->m_ActionTestHDFSlab, SIGNAL(triggered()), this, SLOT(doTestHDF5SlabOutput())); connect(ui->m_ActionTestNexus, SIGNAL(triggered()), this, SLOT(doTestNexusLibrary())); connect(ui->m_ActionTestCBF, SIGNAL(triggered()), this, SLOT(doTestCBFLibrary())); ui->m_FileMenu->addAction(tr("QCEPLIB Version %1").arg(STR(QCEPLIB_VERSION))); ui->m_FileMenu->addAction(tr("CBF Version %1").arg(STR(QCEPLIB_CBF_VERSION))); ui->m_FileMenu->addAction(tr("HDF5 Version %1").arg(STR(QCEPLIB_HDF5_VERSION))); ui->m_FileMenu->addAction(tr("MAR345 Version %1").arg(STR(QCEPLIB_MAR345_VERSION))); ui->m_FileMenu->addAction(tr("NeXus Version %1").arg(STR(QCEPLIB_NEXUS_VERSION))); ui->m_FileMenu->addAction(tr("QWT Version %1").arg(STR(QCEPLIB_QWT_VERSION))); ui->m_FileMenu->addAction(tr("SpecServer Version %1").arg(STR(QCEPLIB_SPECSERVER_VERSION))); ui->m_FileMenu->addAction(tr("TIFF Version %1").arg(STR(QCEPLIB_TIFF_VERSION))); }
/** loads image from the given path and shows it */ Detector::Status Detector::loadImage(const string path) { imageSrc = path; return doLoadImage(imageSrc, image, title); }