diff --git a/app/Algorithms/ClassAnalysis.cpp b/app/Algorithms/ClassAnalysis.cpp index 1e1b1510db8a8ef2e19f57e1c5f53df3b8c680eb..1ce80f6bdad6e441d1814ae04616760ca86c4041 100644 --- a/app/Algorithms/ClassAnalysis.cpp +++ b/app/Algorithms/ClassAnalysis.cpp @@ -403,24 +403,26 @@ string ClassAnalysis::print_file_info( FILE *f ) { } else { for( counter=0; counter< num_classes; counter++ ) { - r = fscanf( f, "%lf", &moy1 ); - checkFscanfResult(r); + r = fscanf( f, "%lf", &moy1 ); + checkFscanfResult(r); r = fscanf( f, "%lf", &var1 ); checkFscanfResult(r); + checkFscanfResult(r); r = fscanf( f, "%lf", &moy2 ); checkFscanfResult(r); r = fscanf( f, "%lf", &var2 ); checkFscanfResult(r); - sprintf( buffer, "---- Class %d:\n", (counter+1) ); + sprintf( buffer, "---- Class %d:\n", (counter+1) ); returnval = returnval + buffer; sprintf( buffer, " Mean of means: %f\n", moy1 ); returnval = returnval + buffer; - //sprintf( buffer, " Stdev of means: %f\n", var1 ); - //returnval = returnval + buffer; + sprintf( buffer, " Variance of means: %f\n", var1 ); + returnval = returnval + buffer; sprintf( buffer, " Mean of stdevs: %f\n", moy2 ); returnval = returnval + buffer; - //sprintf( buffer, " Stdev of stdevs: %f\n", var2 ); - //returnval = returnval + buffer; + sprintf( buffer, " Variance of stdevs: %f\n", var2 ); + returnval = returnval + buffer; + returnval = returnval + "\n"; } } diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 47c56a629d87e4aad116b50b1656ac86f3d1ac78..58b224edd442040d287aade3801141968e6b4293 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -17,6 +17,8 @@ set(imageinsa_SOURCES Algorithms/Pyramid.cpp Algorithms/Pyramid.cpp Algorithms/Pyramid.h + Operations/AbsoluteConvertOp.cpp + Operations/AbsoluteConvertOp.h Operations/BFlitOp.cpp Operations/BFlitOp.h Operations/CenterOp.cpp @@ -97,6 +99,7 @@ set(imageinsa_SOURCES Operations/NoiseOp.h Operations/PointOp.cpp Operations/PointOp.h + Operations/MyQLineEdit.h Operations/PseudoColorDialog.cpp Operations/PseudoColorDialog.h Operations/PseudoColorOp.cpp diff --git a/app/Operations/AbsoluteConvertOp.cpp b/app/Operations/AbsoluteConvertOp.cpp new file mode 100644 index 0000000000000000000000000000000000000000..eb6233c75b7bc211efeed94b5050ac2d9b52e568 --- /dev/null +++ b/app/Operations/AbsoluteConvertOp.cpp @@ -0,0 +1,54 @@ +/* + * Copyright 2011-2012 INSA Rennes + * + * This file is part of ImageINSA. + * + * ImageINSA is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ImageINSA is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with ImageINSA. If not, see <http://www.gnu.org/licenses/>. +*/ + + +#include "AbsoluteConvertOp.h" +#include "../Tools.h" +#include <QApplication> +#include <QObject> +#include "Operation.h" +#include "Image.h" +#include <Converter.h> +#include <QLabel> +#include <QStringList> + +using namespace imagein; + +AbsoluteConvertOp::AbsoluteConvertOp() : DoubleOperation(qApp->translate("Operations", "Convert to Absolute").toStdString()) +{ +} + +bool AbsoluteConvertOp::needCurrentImg() const{ + return true; +} + +void AbsoluteConvertOp::operator()(const imagein::Image_t<double>* from, const std::map<const imagein::Image_t<double>*, std::string>&){ + + ImageDouble* resImg = new ImageDouble(from->getWidth(), from->getHeight(), from->getNbChannels()); + + for(unsigned int i = 0; i < from->getWidth(); i++){ + for(unsigned int j = 0; j < from->getHeight(); j++){ + for(unsigned int k = 0; k < from->getNbChannels(); k++){ + double newPixel = fabs(from->getPixel(i, j, k)); + resImg->setPixel(i, j, k, newPixel ); + } + } + } + outDoubleImage(resImg, "Absolute", false, false, false, false); +} diff --git a/app/Operations/AbsoluteConvertOp.h b/app/Operations/AbsoluteConvertOp.h new file mode 100644 index 0000000000000000000000000000000000000000..19f6f5b1f13d98920bfcd34a919cbc26818a7dd6 --- /dev/null +++ b/app/Operations/AbsoluteConvertOp.h @@ -0,0 +1,19 @@ +#ifndef ABSOLUTECONVERTOP_H +#define ABSOLUTECONVERTOP_H + +#include <QObject> +#include "Operation.h" + +class AbsoluteConvertOp : public DoubleOperation +{ +public: + AbsoluteConvertOp(); + + bool needCurrentImg() const; + + void operator()(const imagein::Image_t<double>*, const std::map<const imagein::Image_t<double>*, std::string>&); +}; + + +#endif // ABSOLUTECONVERTOP_H + diff --git a/app/Operations/ClassResultOp.cpp b/app/Operations/ClassResultOp.cpp index cb3767b5483128e39642f3305cb36d2bb3a5cf71..342ac75e9604b19e4232a04316cd52c88efd2877 100644 --- a/app/Operations/ClassResultOp.cpp +++ b/app/Operations/ClassResultOp.cpp @@ -79,7 +79,6 @@ void ClassResultOp::operator()(const imagein::Image* img, const std::map<const i // int param2 = 8; /*The input parameters are not used*/ int param1 = borderBox->value(); - /*int paramBorderBox = borderBox->value();*/ int param2 = innerBox->value(); vector<Rectangle> selection = zoneSelector->getSelections(); int K = selection.size(); diff --git a/app/Operations/ColorDialog.cpp b/app/Operations/ColorDialog.cpp index ad90393617eec92c1bbcbffa7ee283b56ac3e828..eaab7f3631f0a0e7236e1769587bb29144068114 100644 --- a/app/Operations/ColorDialog.cpp +++ b/app/Operations/ColorDialog.cpp @@ -27,6 +27,7 @@ ColorDialog::ColorDialog(QWidget *parent) : ui->setupUi(this); ui->hsvWidget->setVisible(false); this->adjustSize(); + connect(ui->hintButton,SIGNAL(clicked()),this,SLOT(getHint())); } ColorDialog::~ColorDialog() @@ -57,3 +58,14 @@ unsigned int ColorDialog::getWidth() const { unsigned int ColorDialog::getHeight() const { return ui->heightBox->value(); } + +void ColorDialog::getHint() { + QDialog* hint = new QDialog(QApplication::activeWindow()); + hint->setWindowTitle(QString(qApp->translate("ColorDialog", "A small tip for Qt HSV Color Model"))); + hint->setLayout(new QVBoxLayout); + QLabel* pic = new QLabel(hint); + pic->setPixmap(QPixmap(":/images/qcolor-hsv.png")); + hint->resize(1180,360); + pic->resize(hint->size()); + hint->show(); +} diff --git a/app/Operations/ColorDialog.h b/app/Operations/ColorDialog.h index c71776b7790773d0843190842db4a90e1a198894..b04e0cb51259b26918819c2f52684b5c3749a9f1 100644 --- a/app/Operations/ColorDialog.h +++ b/app/Operations/ColorDialog.h @@ -21,6 +21,8 @@ #define COLORDIALOG_H #include <QDialog> +#include <QDebug> +#include <QPixmap> namespace Ui { class ColorDialog; @@ -37,6 +39,9 @@ public: unsigned int getWidth() const; unsigned int getHeight() const; +public slots: + void getHint(); + private: Ui::ColorDialog *ui; }; diff --git a/app/Operations/ColorDialog.ui b/app/Operations/ColorDialog.ui index 27bdb6344149ec007258a396aaf7a39567ac6296..959dc506ec3ba892bb6ea48676579a116f6dd017 100644 --- a/app/Operations/ColorDialog.ui +++ b/app/Operations/ColorDialog.ui @@ -32,6 +32,9 @@ <property name="maximum"> <number>65536</number> </property> + <property name="value"> + <number>512</number> + </property> </widget> </item> <item row="1" column="0"> @@ -46,6 +49,9 @@ <property name="maximum"> <number>65536</number> </property> + <property name="value"> + <number>512</number> + </property> </widget> </item> </layout> @@ -155,24 +161,31 @@ </property> </widget> </item> - <item row="3" column="0"> + <item row="0" column="0"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>Hue : </string> + </property> + </widget> + </item> + <item row="2" column="0"> <widget class="QLabel" name="label_6"> <property name="text"> <string>Value : </string> </property> </widget> </item> - <item row="3" column="1"> + <item row="2" column="1"> <widget class="QSpinBox" name="valBox"> <property name="maximum"> <number>255</number> </property> </widget> </item> - <item row="0" column="0"> - <widget class="QLabel" name="label_4"> + <item row="6" column="1"> + <widget class="QPushButton" name="hintButton"> <property name="text"> - <string>Hue : </string> + <string>Get a hint</string> </property> </widget> </item> diff --git a/app/Operations/ColorimetryOp.h b/app/Operations/ColorimetryOp.h index 1e2206cc186846ccc13ae6db1b125bc0291f4b46..33b104d7243bea91adc4474a2b78326ddf1d95d5 100644 --- a/app/Operations/ColorimetryOp.h +++ b/app/Operations/ColorimetryOp.h @@ -30,6 +30,7 @@ public: void operator()(const imagein::Image*, const std::map<const imagein::Image*, std::string>&); bool needCurrentImg() const; + }; #endif // COLORIMETRYOP_H diff --git a/app/Operations/MeanSquaredErrorOp.cpp b/app/Operations/MeanSquaredErrorOp.cpp index 713dd29dda8c48c7be9a571440b87ee4a1d3a84f..85f8c9822fe2c5f95be71509e790bb351721f046 100644 --- a/app/Operations/MeanSquaredErrorOp.cpp +++ b/app/Operations/MeanSquaredErrorOp.cpp @@ -81,7 +81,9 @@ void MeanSquaredErrorOp::operator()(const imagein::Image* image, const std::map< mse = mse / static_cast<double>(maxChannel * maxWidth * maxHeight); me = me / static_cast<double>(maxChannel * maxWidth * maxHeight); - QString text = qApp->translate("MeanSquareErrorOp", "Mean squarred error : %1 (mean error : %2)"); +// QString text = qApp->translate("MeanSquareErrorOp", "Mean squarred error : %1 (mean error : %2)"); + /*Change the name to match the calculation performed*/ + QString text = qApp->translate("MeanSquareErrorOp", "Mean squarred error : %1 (mean absolute error : %2)"); text = text.arg(mse, 0, 'f', 2); text = text.arg(me, 0, 'f', 2); diff --git a/app/Operations/MyQLineEdit.h b/app/Operations/MyQLineEdit.h new file mode 100644 index 0000000000000000000000000000000000000000..4d1c2a62702c47e3e37bf531f78399c1f3071a39 --- /dev/null +++ b/app/Operations/MyQLineEdit.h @@ -0,0 +1,64 @@ +/* + * Copyright 2011-2012 INSA Rennes + * + * This file is part of ImageINSA. + * + * ImageINSA is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ImageINSA is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with ImageINSA. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef MYQLINEEDIT_H +#define MYQLINEEDIT_H + +#include <QLineEdit> +#include <QRegExp> +#include <QRegExpValidator> +#include <QIntValidator> +#include <QDoubleValidator> + +class MyQLineEdit : public QLineEdit { + + Q_OBJECT + + public: + MyQLineEdit(QWidget *parent = nullptr) : QLineEdit(parent){}; + MyQLineEdit(const QString &contents, QWidget *parent = nullptr) : QLineEdit(contents, parent){}; + + public slots: + void updateValidator(const QString &text){ + QRegExp regLogicalExp("^[1]d*|0$"); + QRegExp regShiftExp("^[1-7]d*|0$"); + QRegExpValidator* logicalValidator = new QRegExpValidator(regLogicalExp,0); + QRegExpValidator* shiftValidator = new QRegExpValidator(regShiftExp,0); + QIntValidator* intValidator = new QIntValidator(); + QDoubleValidator* doubleValidator = new QDoubleValidator(); + + if(text.contains("NOT")){ + this->setEnabled(false); + }else{ + this->setEnabled(true); + } + + if(text.contains("logical")){ + this->setValidator(logicalValidator); + }else if(text.contains("<<") || text.contains(">>")){ + this->setValidator(shiftValidator); + }else if(text.contains("bit-wise")){ + this->setValidator(intValidator); + }else{ + this->setValidator(doubleValidator); + } + } +}; + +#endif // MYQLINEEDIT_H diff --git a/app/Operations/PointOp.cpp b/app/Operations/PointOp.cpp index c5cb3954b6c871f50b4e7a2f22509ce757ac7899..8681bd4821b0334e7332e2ee196d5ecaf55256b0 100644 --- a/app/Operations/PointOp.cpp +++ b/app/Operations/PointOp.cpp @@ -28,13 +28,14 @@ #include <QComboBox> #include <QCheckBox> #include <QGroupBox> +#include <QDebug> #include "PointOp.h" #include <Widgets/ImageListBox.h> #include <Widgets/ImageWidgets/StandardImageWindow.h> #include <Widgets/ImageWidgets/DoubleImageWindow.h> #include <Converter.h> - +#include "MyQLineEdit.h" #include "../Tools.h" using namespace std; @@ -42,7 +43,7 @@ using namespace imagein; using namespace genericinterface; PointOp::PointOp() : GenericOperation(qApp->translate("Operations", "Pixel operations").toStdString()) { - + } PointOp::PixelOp* PointOp::PixelOp::fromString(QString op, QString expr) { @@ -50,14 +51,17 @@ PointOp::PixelOp* PointOp::PixelOp::fromString(QString op, QString expr) { if(op=="-") return new PixAdd(-expr.toInt(0,0)); if(op=="*") return new PixMul(expr.toDouble()); if(op=="/") return new PixMul(1/expr.toDouble()); + if(op=="& (bit-wise AND)") return new PixBitwiseAnd(expr.toUInt(0,0)); if(op=="&& (logical AND)") return new PixLogicalAnd(expr.toUInt(0,0)); + if(op=="! (logical NOT)") return new PixLogicalNot(expr.toUInt(0,0)); + if(op=="| (bit-wise OR)") return new PixBitwiseOr(expr.toUInt(0,0)); if(op=="|| (logical OR)") return new PixLogicalOr(expr.toUInt(0,0)); + if(op=="^ (bit-wise XOR)") return new PixBitwiseXor(expr.toUInt(0,0)); if(op=="^^ (logical XOR)") return new PixLogicalXor(expr.toUInt(0,0)); - /*The operator of shift operations is considered as a double to simplify the structure*/ -// if(op=="<<") return new PixLshift(expr.toUInt(0,0)); -// if(op==">>") return new PixRshift(expr.toUInt(0,0)); + if(op=="<<") return new PixLshift(expr.toUInt(0,0)); + if(op==">>") return new PixRshift(expr.toUInt(0,0)); if(op=="") return new PixIdent(); - std::cout << "Unknown operator '" << op.toStdString() << "' !" << std::endl; + std::cout << "Unknown operator '" << op.toStdString() << "' ! PixelOp" << std::endl; return new PixIdent(); } PointOp::DoublePixelOp* PointOp::DoublePixelOp::fromString(QString op, QString expr) { @@ -65,13 +69,12 @@ PointOp::DoublePixelOp* PointOp::DoublePixelOp::fromString(QString op, QString e if(op=="-") return new DoublePixAdd(-expr.toDouble()); if(op=="*") return new DoublePixMul(expr.toDouble()); if(op=="/") return new DoublePixMul(1/expr.toDouble()); - if(op=="&& (logical AND)") return new DoublePixLogicalAnd(expr.toDouble()); - if(op=="|| (logical OR)") return new DoublePixLogicalOr(expr.toDouble()); - if(op=="^^ (logical XOR)") return new DoublePixLogicalXor(expr.toDouble()); - if(op=="<<") return new PixLshift(expr.toDouble()); - if(op==">>") return new PixRshift(expr.toDouble()); + if(op=="&& (logical AND)") return new DoublePixLogicalAnd(expr.toUInt()); + if(op=="! (logical NOT)") return new DoublePixLogicalNot(expr.toUInt()); + if(op=="|| (logical OR)") return new DoublePixLogicalOr(expr.toUInt()); + if(op=="^^ (logical XOR)") return new DoublePixLogicalXor(expr.toUInt()); if(op=="") return new DoublePixIdent(); - std::cout << "Unknown operator '" << op.toStdString() << "' !" << std::endl; + std::cout << "Unknown operator '" << op.toStdString() << "' ! DoublePixelOp" << std::endl; return new DoublePixIdent(); } @@ -80,12 +83,14 @@ PointOp::ImageOp* PointOp::ImageOp::fromString(QString op) { if(op=="-") return new ImgSub(); if(op=="*") return new ImgMul(); if(op=="/") return new ImgDiv(); - if(op=="& (bit-wise AND)") return new ImgBitAnd(); - if(op=="! (bit-wise NOT)") return new ImgBitNot(); - if(op=="| (bit-wise OR)") return new ImgBitOr(); - if(op=="^ (bit-wise XOR)") return new ImgBitXor(); + if(op=="& (bit-wise AND)") return new ImgBitwiseAnd(); + if(op=="&& (logical AND)") return new ImgLogicalAnd(); + if(op=="| (bit-wise OR)") return new ImgBitwiseOr(); + if(op=="|| (logical OR)") return new ImgLogicalOr(); + if(op=="^ (bit-wise XOR)") return new ImgBitwiseXor(); + if(op=="^^ (logical XOR)") return new ImgLogicalXor(); if(op=="") return new ImgIdent(); - std::cout << "Unknown operator '" << op.toStdString() << "' !" << std::endl; + std::cout << "Unknown operator '" << op.toStdString() << "' ! ImageOp" << std::endl; return new ImgIdent(); } @@ -94,19 +99,22 @@ PointOp::DoubleImageOp* PointOp::DoubleImageOp::fromString(QString op) { if(op=="-") return new DoubleImgSub(); if(op=="*") return new DoubleImgMul(); if(op=="/") return new DoubleImgDiv(); - if(op=="! (bit-wise NOT)") return new DoubleImgBitNot(); + if(op=="&& (logical AND)") return new DoubleImgLogicalAnd(); + if(op=="|| (logical OR)") return new DoubleImgLogicalOr(); + if(op=="^^ (logical XOR)") return new DoubleImgLogicalXor(); if(op=="") return new DoubleImgIdent(); - std::cout << "Unknown operator '" << op.toStdString() << "' !" << std::endl; + std::cout << "Unknown operator '" << op.toStdString() << "' ! DoubleImageOp" << std::endl; return new DoubleImgIdent(); } void PointOp::operator()(const ImageWindow* currentWnd, const vector<const ImageWindow*>& wndList) { - QStringList pixOperators, imgOperators, pixDoubleOperators; + QStringList pixOperators, pixDoubleOperators, imgOperators, imgDoubleOperators; - pixOperators << "" << "+" << "-" << "*" << "/" << "&& (logical AND)" << "|| (logical OR)" << "^^ (logical XOR)" << "<<" << ">>"; - pixDoubleOperators << "" << "+" << "-" << "*" << "/"; - imgOperators << "" << "+" << "-" << "*" << "/" << "& (bit-wise AND)" << "! (bit-wise NOT)" << "| (bit-wise OR)" << "^ (bit-wise XOR)"; + pixOperators << "" << "+" << "-" << "*" << "/" << "& (bit-wise AND)" << "&& (logical AND)" << "! (logical NOT)" << "| (bit-wise OR)" << "|| (logical OR)" << "^ (bit-wise XOR)" << "^^ (logical XOR)" << "<<" << ">>"; + pixDoubleOperators << "" << "+" << "-" << "*" << "/" << "&& (logical AND)" << "! (logical NOT)" << "|| (logical OR)" << "^^ (logical XOR)"; + imgOperators << "" << "+" << "-" << "*" << "/" << "& (bit-wise AND)" << "&& (logical AND)" << "| (bit-wise OR)" << "|| (logical OR)" << "^ (bit-wise XOR)" << "^^ (logical XOR)"; + imgDoubleOperators << "" << "+" << "-" << "*" << "/" << "&& (logical AND)" << "|| (logical OR)" << "^^ (logical XOR)"; QString currentImgName = currentWnd->windowTitle(); map<const Image*,string> stdImgList; @@ -122,7 +130,6 @@ void PointOp::operator()(const ImageWindow* currentWnd, const vector<const Image } } - QDialog* dialog = new QDialog(); dialog->setWindowTitle(qApp->translate("Operations", "Parameters")); dialog->setMinimumWidth(180); @@ -191,24 +198,32 @@ void PointOp::operator()(const ImageWindow* currentWnd, const vector<const Image QHBoxLayout** valueLayouts = new QHBoxLayout*[nChannel+1]; QComboBox** pixOperatorBoxes = new QComboBox*[nChannel+1]; QComboBox** imgOperatorBoxes = new QComboBox*[nChannel+1]; - QLineEdit** exprEdits = new QLineEdit*[nChannel+1]; + MyQLineEdit** exprEdits = new MyQLineEdit*[nChannel+1]; MixImageListBox** imageBoxes = new MixImageListBox*[nChannel+1]; QWidget* pixelWidget = new QWidget(dialog); + QWidget* imgWidget = new QWidget(dialog); valueLayouts[0] = new QHBoxLayout(); pixOperatorBoxes[0] = new QComboBox(pixelWidget); pixOperatorBoxes[0]->setWhatsThis(qApp->translate("PointOp", "Supported operations list which takes a value as operand: \n The input operand will be rounded down for shift operations")); - imgOperatorBoxes[0] = new QComboBox(pixelWidget); + imgOperatorBoxes[0] = new QComboBox(imgWidget); imgOperatorBoxes[0]->setWhatsThis(qApp->translate("PointOp", "Supported operations list whick takes an image as operand: \n The bit-wise NOT operation will automatically ignore the second image")); + if(currentWnd->isStandard()){ pixOperatorBoxes[0]->addItems(pixOperators); - } - if(currentWnd->isDouble()){ + imgOperatorBoxes[0]->addItems(imgOperators); + }else{ pixOperatorBoxes[0]->addItems(pixDoubleOperators); + imgOperatorBoxes[0]->addItems(imgDoubleOperators); } - imgOperatorBoxes[0]->addItems(imgOperators); - exprEdits[0] = new QLineEdit(pixelWidget); + + exprEdits[0] = new MyQLineEdit(pixelWidget); exprEdits[0]->setFixedWidth(64); +/*************************************************************/ +/*Overwrite QLineEdit class, send signals according to the change of combobox content to determine the corresponding supported input data type*/ + QObject::connect(pixOperatorBoxes[0], SIGNAL(currentTextChanged(QString)), exprEdits[0], SLOT(updateValidator(QString))); + QObject::connect(imgOperatorBoxes[0], SIGNAL(currentTextChanged(QString)), exprEdits[0], SLOT(updateValidator(QString))); +/*************************************************************/ imageBoxes[0] = new MixImageListBox(pixelWidget, currentImgName.toStdString(), stdImgList, dblImgList); valueLayouts[0]->addWidget(new QLabel(currentImgName, pixelWidget)); valueLayouts[0]->addWidget(pixOperatorBoxes[0]); @@ -228,14 +243,15 @@ void PointOp::operator()(const ImageWindow* currentWnd, const vector<const Image imgOperatorBoxes[i] = new QComboBox(colorWidget); if(currentWnd->isStandard()){ pixOperatorBoxes[i]->addItems(pixOperators); - } - if(currentWnd->isDouble()){ + imgOperatorBoxes[i]->addItems(imgOperators); + }else{ pixOperatorBoxes[i]->addItems(pixDoubleOperators); + imgOperatorBoxes[i]->addItems(imgDoubleOperators); } - - imgOperatorBoxes[i]->addItems(imgOperators); - exprEdits[i] = new QLineEdit(colorWidget); + exprEdits[i] = new MyQLineEdit(colorWidget); exprEdits[i]->setFixedWidth(64); + QObject::connect(pixOperatorBoxes[i], SIGNAL(currentTextChanged(QString)), exprEdits[i], SLOT(updateValidator(QString))); + QObject::connect(imgOperatorBoxes[i], SIGNAL(currentTextChanged(QString)), exprEdits[i], SLOT(updateValidator(QString))); imageBoxes[i] = new MixImageListBox(colorWidget, currentImgName.toStdString(), stdImgList, dblImgList); valueLayouts[i]->addWidget(new QLabel(currentImgName+"::"+Tools::colorName(i-1, nChannel), colorWidget)); valueLayouts[i]->addWidget(pixOperatorBoxes[i]); @@ -292,109 +308,125 @@ void PointOp::operator()(const ImageWindow* currentWnd, const vector<const Image unsigned int maxWidth = image->getWidth(); unsigned int maxHeight = image->getHeight(); - - Image_t<double>* resImg; + Image_t<double>* resDoubleImg; + Image* resImg; if(valueButton->isChecked()) { - DoublePixelOp** pixelOps = new DoublePixelOp*[nChannel]; + PixelOp** pixelOps = new PixelOp*[nChannel]; + DoublePixelOp** doublePixelOps = new DoublePixelOp*[nChannel]; if(!colorBox->isChecked()) { QString expr = exprEdits[0]->text(); - DoublePixelOp* pixelOp = DoublePixelOp::fromString(pixOperatorBoxes[0]->currentText(), expr); - for(int i=0; i<nChannel; ++i) pixelOps[i] = pixelOp; + PixelOp* pixelOp = PixelOp::fromString(pixOperatorBoxes[0]->currentText(), expr); + DoublePixelOp* doublePixelOp = DoublePixelOp::fromString(pixOperatorBoxes[0]->currentText(), expr); + for(int i=0; i<nChannel; ++i){ + pixelOps[i] = pixelOp; + doublePixelOps[i] = doublePixelOp; + } } else { for(int i=0; i<nChannel; ++i) { QString expr = exprEdits[i+1]->text(); - pixelOps[i] = DoublePixelOp::fromString(pixOperatorBoxes[i+1]->currentText(), expr); + pixelOps[i] = PixelOp::fromString(imgOperatorBoxes[i+1]->currentText(), expr); + doublePixelOps[i] = DoublePixelOp::fromString(imgOperatorBoxes[i+1]->currentText(), expr); } } - resImg = new Image_t<double>(image->getWidth(), image->getHeight(), nChannel); + resImg = new Image(image->getWidth(), image->getHeight(), nChannel); + resDoubleImg = new Image_t<double>(image->getWidth(), image->getHeight(), nChannel); for(int c = 0; c < nChannel; ++c) { for(unsigned int j = 0; j < image->getHeight(); ++j) { for(unsigned int i = 0; i < image->getWidth(); ++i) { - double value = image->getPixel(i, j, c); - value = pixelOps[c]->operator()(value); - resImg->setPixel(i, j, c, value); + if(dblResult){ + double value1 = image->getPixel(i, j, c); + double value2 = doublePixelOps[c]->operator()(value1); + resDoubleImg->setPixel(i, j, c, value2); + }else{ + int value1 = image->getPixel(i, j, c); + int value2 = pixelOps[c]->operator()(value1); + resImg->setPixel(i, j, c, value2); + } } } } } else { - DoubleImageOp** imageOps = new DoubleImageOp*[nChannel]; /*The double image process exist already, but cases of standard images is ignored*/ - ImageOp** imageOpsStd = new ImageOp*[nChannel]; + ImageOp** stdImageOps = new ImageOp*[nChannel]; + DoubleImageOp** dblImageOps = new DoubleImageOp*[nChannel]; + bool isDblImg[nChannel]; const Image_t<double>* dblImageImgs[nChannel]; const Image* stdImageImgs[nChannel]; if(!colorBox->isChecked()) { - DoubleImageOp* imageOp = DoubleImageOp::fromString(imgOperatorBoxes[0]->currentText()); - for(int i=0; i<nChannel; ++i) imageOps[i] = imageOp; + DoubleImageOp* dblImageOp = DoubleImageOp::fromString(imgOperatorBoxes[0]->currentText()); + ImageOp* stdImageOp = ImageOp::fromString(imgOperatorBoxes[0]->currentText()); + for(int i=0; i<nChannel; ++i){ + stdImageOps[i] = stdImageOp; + dblImageOps[i] = dblImageOp; + } if(imageBoxes[0]->currentType() == MixImageListBox::DBLIMG) { - const Image_t<double>* imageImg = imageBoxes[0]->getDblImage(imageBoxes[0]->currentText().toStdString()); + const Image_t<double>* dblImg = imageBoxes[0]->getDblImage(imageBoxes[0]->currentText().toStdString()); for(int i=0; i<nChannel; ++i) { - dblImageImgs[i] = imageImg; + dblImageImgs[i] = dblImg; isDblImg[i] = true; } - maxWidth = min(maxWidth, imageImg->getWidth()); - maxHeight = min(maxHeight, imageImg->getHeight()); + maxWidth = min(maxWidth, dblImg->getWidth()); + maxHeight = min(maxHeight, dblImg->getHeight()); } else { - const Image* imageImg = imageBoxes[0]->getStdImage(imageBoxes[0]->currentText().toStdString()); - ImageOp* imageOpStd = ImageOp::fromString(imgOperatorBoxes[0]->currentText()); + const Image* stdImg = imageBoxes[0]->getStdImage(imageBoxes[0]->currentText().toStdString()); for(int i=0; i<nChannel; ++i) { - imageOpsStd[i] = imageOpStd; - stdImageImgs[i] = imageImg; + stdImageImgs[i] = stdImg; isDblImg[i] = false; } - maxWidth = min(maxWidth, imageImg->getWidth()); - maxHeight = min(maxHeight, imageImg->getHeight()); + maxWidth = min(maxWidth, stdImg->getWidth()); + maxHeight = min(maxHeight, stdImg->getHeight()); } - } else { for(int i=0; i<nChannel; ++i) { - imageOps[i] = DoubleImageOp::fromString(imgOperatorBoxes[i+1]->currentText()); + stdImageOps[i] = ImageOp::fromString(imgOperatorBoxes[i+1]->currentText()); + dblImageOps[i] = DoubleImageOp::fromString(imgOperatorBoxes[i+1]->currentText()); if(imageBoxes[i+1]->currentType() == MixImageListBox::DBLIMG) { - const Image_t<double>* imageImg = imageBoxes[i+1]->getDblImage(imageBoxes[i+1]->currentText().toStdString()); + const Image_t<double>* dblImg = imageBoxes[i+1]->getDblImage(imageBoxes[i+1]->currentText().toStdString()); for(int i=0; i<nChannel; ++i) { - dblImageImgs[i] = imageImg; + dblImageImgs[i] = dblImg; isDblImg[i] = true; } - maxWidth = min(maxWidth, imageImg->getWidth()); - maxHeight = min(maxHeight, imageImg->getHeight()); + maxWidth = min(maxWidth, dblImg->getWidth()); + maxHeight = min(maxHeight, dblImg->getHeight()); } else { - const Image* imageImg = imageBoxes[i+1]->getStdImage(imageBoxes[i+1]->currentText().toStdString()); + const Image* stdImg = imageBoxes[i+1]->getStdImage(imageBoxes[i+1]->currentText().toStdString()); for(int i=0; i<nChannel; ++i) { - stdImageImgs[i] = imageImg; + stdImageImgs[i] = stdImg; isDblImg[i] = false; } - maxWidth = min(maxWidth, imageImg->getWidth()); - maxHeight = min(maxHeight, imageImg->getHeight()); + maxWidth = min(maxWidth, stdImg->getWidth()); + maxHeight = min(maxHeight, stdImg->getHeight()); } } } - resImg = new Image_t<double>(maxWidth, maxHeight, nChannel); + + resImg = new Image(maxWidth, maxHeight, nChannel); + resDoubleImg = new Image_t<double>(maxWidth, maxHeight, nChannel); for(int c = 0; c < resImg->getNbChannels(); ++c) { for(unsigned int j = 0; j < resImg->getHeight(); ++j) { for(unsigned int i = 0; i < resImg->getWidth(); ++i) { - double value1 = image->getPixel(i, j, c); - double value2; if(isDblImg[c]) { + double value1 = image->getPixel(i, j, c); const unsigned int channel = (c < dblImageImgs[c]->getNbChannels() ? c : 0); - value2 = dblImageImgs[c]->getPixel(i, j, channel); + double value2 = dblImageImgs[c]->getPixel(i, j, channel); + double resVal = dblImageOps[c]->operator()(value1, value2); + resDoubleImg->setPixel(i, j, c, resVal); } else { + int value1 = image->getPixel(i, j, c); const unsigned int channel = (c < stdImageImgs[c]->getNbChannels() ? c : 0); - value2 = stdImageImgs[c]->getPixel(i, j, channel); + int value2 = stdImageImgs[c]->getPixel(i, j, channel); + int resVal = stdImageOps[c]->operator()(value1, value2); + resImg->setPixel(i, j, c, resVal); } - if(isDblImg[c]){ - value1 = imageOps[c]->operator()(value1, value2); - }else{ - value1 = imageOpsStd[c]->operator()(value1, value2); - } - resImg->setPixel(i, j, c, value1); } } } @@ -402,15 +434,15 @@ void PointOp::operator()(const ImageWindow* currentWnd, const vector<const Image if(dblResult) { if(currentDblWnd) { - this->outDoubleImage(resImg, "", currentDblWnd->isNormalized(), currentDblWnd->isLogScaled()); + this->outDoubleImage(resDoubleImg, "", currentDblWnd->isNormalized(), currentDblWnd->isLogScaled()); } else { - this->outDoubleImage(resImg, "", false, false); + this->outDoubleImage(resDoubleImg, "", false, false); } delete image; } else { - Image * charResImg; + Image* charResImg; bool _scaling = scalingBox->isChecked(); bool _offset = offsetBox->isChecked(); std::string outputMessage = ""; @@ -425,9 +457,8 @@ void PointOp::operator()(const ImageWindow* currentWnd, const vector<const Image charResImg = Converter<Image>::convertAndOffset(*intResImg, &outputMessage); } else{ - charResImg = Converter<Image>::convertAndRound(*resImg); + charResImg = Converter<Image>::convert(*resImg); outputMessage = qApp->translate("Operations","Pas de conversion [min : 0, max : 255]").toStdString(); - } this->outText(outputMessage); this->outText("-------------------------------------------"); diff --git a/app/Operations/PointOp.h b/app/Operations/PointOp.h index c9b2a125aed683e9db3f388ff7a387bd1f531161..5621ddc999d4e58a31ed99f4d2a59e6520c5a67e 100644 --- a/app/Operations/PointOp.h +++ b/app/Operations/PointOp.h @@ -24,6 +24,7 @@ #include <map> #include <limits> #include <QCoreApplication> + #include "Operation.h" #include "Image.h" @@ -50,6 +51,9 @@ class PointOp : public GenericOperation { return static_cast<depth_t>(value); } +/*---------------------------------------------------------------------- + Pixel Operation Templates +----------------------------------------------------------------------*/ struct PixelOp { virtual depth_t operator()(depth_t pixel) { return normalize(this->op(pixel)); @@ -66,7 +70,9 @@ class PointOp : public GenericOperation { static DoublePixelOp* fromString(QString op, QString expr); double value; }; - +/*---------------------------------------------------------------------- + Pixel Identical Operation +----------------------------------------------------------------------*/ struct PixIdent : PixelOp { intmax_t op(depth_t pixel) { return pixel; } }; @@ -81,8 +87,12 @@ class PointOp : public GenericOperation { T value; }; - struct PixAdd : PixOp_t<int> { - PixAdd(int value_) : PixOp_t<int>(value_) {} +/*---------------------------------------------------------------------- + Pixel Arithmetic Operations +----------------------------------------------------------------------*/ + /*Subtraction and division are based on addition and multiplication, by processing the operand.*/ + struct PixAdd : PixOp_t<depth_t> { + PixAdd(double value_) : PixOp_t<depth_t>(value_) {} intmax_t op(depth_t pixel) { return pixel + value; } }; @@ -91,9 +101,11 @@ class PointOp : public GenericOperation { double op(double pixel) { return pixel + value; } }; - struct PixMul : PixOp_t<double> { - PixMul(double value_) : PixOp_t<double>(value_) {} - intmax_t op(depth_t pixel) { return pixel * value + 0.5; } + /*WHY + 0.5 ????? */ + struct PixMul : PixOp_t<depth_t> { + PixMul(double value_) : PixOp_t<depth_t>(value_) {} +// intmax_t op(depth_t pixel) { return pixel * value + 0.5; } + intmax_t op(depth_t pixel) { return pixel * value ; } }; struct DoublePixMul : DoublePixelOp { @@ -101,66 +113,81 @@ class PointOp : public GenericOperation { double op(double pixel) { return pixel * value; } }; - struct PixLogicalAnd : PixOp_t<depth_t> { - PixLogicalAnd(depth_t value_) : PixOp_t<depth_t>(value_) {} - intmax_t op(depth_t pixel) { return pixel && value; } +/*---------------------------------------------------------------------- + Pixel AND +----------------------------------------------------------------------*/ + struct PixBitwiseAnd : PixOp_t<depth_t> { + PixBitwiseAnd(depth_t value_) : PixOp_t<depth_t>(value_) {} + intmax_t op(depth_t pixel) { return pixel & value; } }; - /*Return zero if the operands have zero*/ + /*Return zero only if any of operands is zero*/ + struct PixLogicalAnd : PixOp_t<depth_t> { + PixLogicalAnd(int value_) : PixOp_t<depth_t>(value_) {} + intmax_t op(depth_t pixel) { return (pixel==0 or value==0) ? 0 : pixel; } + }; struct DoublePixLogicalAnd : DoublePixelOp { - DoublePixLogicalAnd(double value_) : DoublePixelOp(value_) {} + DoublePixLogicalAnd(int value_) : DoublePixelOp(value_) {} double op(double pixel) { return (pixel==0 or value==0) ? 0 : pixel; } }; - - /*There's no not logic for double value*/ - struct PixNot : PixOp_t<depth_t> { - PixNot(depth_t value_) : PixOp_t<depth_t>(value_) {} +/*---------------------------------------------------------------------- + Pixel NOT +----------------------------------------------------------------------*/ + /*Logical flipping takes the complementary value to 255*/ + struct PixLogicalNot : PixOp_t<depth_t> { + PixLogicalNot(depth_t value_) : PixOp_t<depth_t>(value_) {} intmax_t op(depth_t pixel) { return 255 - pixel; } }; - + struct DoublePixLogicalNot : DoublePixelOp { + DoublePixLogicalNot(double value_) : DoublePixelOp(value_) {} + double op(double pixel) { return 255. - pixel; } + }; +/*---------------------------------------------------------------------- + Pixel OR +----------------------------------------------------------------------*/ + struct PixBitwiseOr : PixOp_t<depth_t> { + PixBitwiseOr(depth_t value_) : PixOp_t<depth_t>(value_) {} + intmax_t op(depth_t pixel) { return pixel | value; } + }; + /*Return zero only if the operands are both zero*/ struct PixLogicalOr : PixOp_t<depth_t> { PixLogicalOr(depth_t value_) : PixOp_t<depth_t>(value_) {} - intmax_t op(depth_t pixel) { return pixel || value; } + intmax_t op(depth_t pixel) { return (pixel==0 and value==0) ? 0 : pixel; } }; - - /*Return zero only if the operands are both zero*/ struct DoublePixLogicalOr : DoublePixelOp { - DoublePixLogicalOr(double value_) : DoublePixelOp(value_) {} + DoublePixLogicalOr(int value_) : DoublePixelOp(value_) {} double op(double pixel) { return (pixel==0 and value==0) ? 0 : pixel; } }; - +/*---------------------------------------------------------------------- + Pixel XOR +----------------------------------------------------------------------*/ + struct PixBitwiseXor : PixOp_t<depth_t> { + PixBitwiseXor(depth_t value_) : PixOp_t<depth_t>(value_) {} + intmax_t op(depth_t pixel) { return pixel ^ value; } + }; + /*Return zero only if the operands have the same value*/ struct PixLogicalXor : PixOp_t<depth_t> { PixLogicalXor(depth_t value_) : PixOp_t<depth_t>(value_) {} intmax_t op(depth_t pixel) { return (pixel==value) ? 0 : pixel; } }; - - /*Return zero only if the operands have the same value*/ struct DoublePixLogicalXor : DoublePixelOp { - DoublePixLogicalXor(double value_) : DoublePixelOp(value_) {} + DoublePixLogicalXor(int value_) : DoublePixelOp(value_) {} double op(double pixel) { return (pixel==value) ? 0 : pixel; } }; - -// struct PixLshift : PixOp_t<depth_t> { -// PixLshift(depth_t value_) : PixOp_t<depth_t>(value_) {} -// intmax_t op(depth_t pixel) { return pixel << value; } -// }; - -// struct PixRshift : PixOp_t<depth_t> { -// PixRshift(depth_t value_) : PixOp_t<depth_t>(value_) {} -// intmax_t op(depth_t pixel) { return (int)pixel >> (int)value; } -// }; - - struct PixLshift : DoublePixelOp { - PixLshift(depth_t value_) : DoublePixelOp(value_) {} - double op(double pixel) { return (int)pixel << (int)value; } +/*---------------------------------------------------------------------- + Pixel Shifting +----------------------------------------------------------------------*/ + struct PixLshift : PixOp_t<depth_t> { + PixLshift(depth_t value_) : PixOp_t<depth_t>(value_) {} + intmax_t op(depth_t pixel) { return pixel << value; } }; - - struct PixRshift : DoublePixelOp { - PixRshift(depth_t value_) : DoublePixelOp(value_) {} - double op(double pixel) { return (int)pixel >> (int)value; } + struct PixRshift : PixOp_t<depth_t> { + PixRshift(depth_t value_) : PixOp_t<depth_t>(value_) {} + intmax_t op(depth_t pixel) { return pixel >> value; } }; - - +/*---------------------------------------------------------------------- + Image Operation Templates +----------------------------------------------------------------------*/ struct ImageOp { virtual depth_t operator()(depth_t pixel1, depth_t pixel2) { return normalize(this->op(pixel1, pixel2)); @@ -176,14 +203,18 @@ class PointOp : public GenericOperation { virtual double op(double pixel1, double pixel2) = 0; static DoubleImageOp* fromString(QString op); }; - +/*---------------------------------------------------------------------- + Image Identical Operations +----------------------------------------------------------------------*/ struct ImgIdent : ImageOp { intmax_t op(depth_t pix1, depth_t pix2) { return pix1; } }; struct DoubleImgIdent : DoubleImageOp { double op(double pix1, double pix2) { return pix1; } }; - +/*---------------------------------------------------------------------- + Image Arithmetic Operations +----------------------------------------------------------------------*/ struct ImgAdd : ImageOp { intmax_t op(depth_t pix1, depth_t pix2) { return pix1 + pix2; } }; @@ -212,42 +243,48 @@ class PointOp : public GenericOperation { struct DoubleImgDiv : DoubleImageOp { double op(double pix1, double pix2) { return pix1 / pix2; } }; - - struct ImgBitAnd : ImageOp { +/*---------------------------------------------------------------------- + Image AND +----------------------------------------------------------------------*/ + struct ImgBitwiseAnd : ImageOp { intmax_t op(depth_t pix1, depth_t pix2) { return pix1 & pix2; } }; - struct DoubleImgBitAnd : DoubleImageOp { - double op(double pix1, double pix2) { return (pix1==0 or pix2==0) ? 0 : pix1;} + struct ImgLogicalAnd : ImageOp { + intmax_t op(depth_t pix1, depth_t pix2) { return (pix1==0 || pix2==0) ? 255 : pix1; } }; - /*To keep the symmetry of the interface, BitNot was categorized as an image operation - But for the negation operation, the second operand is unnecessary*/ - struct ImgBitNot : ImageOp { - intmax_t op(depth_t pix1, depth_t pix2) { return 255 - pix1; } + struct DoubleImgLogicalAnd : DoubleImageOp { + double op(double pix1, double pix2) { return (pix1==0 || pix2==0) ? 255 : pix1; } + }; +/*---------------------------------------------------------------------- + Image OR +----------------------------------------------------------------------*/ + struct ImgBitwiseOr : ImageOp { + intmax_t op(depth_t pix1, depth_t pix2) { return pix1 | pix2; } }; - /*DoubleImgBitNot is defined to reconcile two operators in different types*/ - struct DoubleImgBitNot : DoubleImageOp { - double op(double pix1, double pix2) { return 255 - pix1; } + struct ImgLogicalOr : ImageOp { + intmax_t op(depth_t pix1, depth_t pix2) { return (pix1==0 && pix2==0) ? 255 : pix1; } }; - struct ImgBitOr : ImageOp { - intmax_t op(depth_t pix1, depth_t pix2) { return pix1 | pix2; } + struct DoubleImgLogicalOr : DoubleImageOp { + double op(double pix1, double pix2) { return (pix1==0 && pix2==0) ? 255 : pix1; } }; - - struct DoubleImgBitOr : DoubleImageOp { - double op(double pix1, double pix2) { return (pix1==0 and pix2==0) ? 0 : pix1;} +/*---------------------------------------------------------------------- + Image XOR +----------------------------------------------------------------------*/ + struct ImgBitwiseXor : ImageOp { + intmax_t op(depth_t pix1, depth_t pix2) { return pix1 ^ pix2; } }; - struct ImgBitXor : ImageOp { - intmax_t op(depth_t pix1, depth_t pix2) { return pix1 ^ pix2; } + struct ImgLogicalXor : ImageOp { + intmax_t op(depth_t pix1, depth_t pix2) { return (pix1==pix2) ? 255 : pix1; } }; - struct DoubleImgBitXor : DoubleImageOp { - double op(double pix1, double pix2) { return (pix1 == pix2) ? 0 : pix1; } + struct DoubleImgLogicalXor : DoubleImageOp { + double op(double pix1, double pix2) { return (pix1==pix2) ? 255 : pix1; } }; - }; #endif //!PointOp_H diff --git a/app/Operations/SinusSynthesisOp.cpp b/app/Operations/SinusSynthesisOp.cpp index 7fead0584c6752eb143764a18f932c945648e476..5d250ae7db523ea3dc65ffb3fe6daba6b77e92b3 100644 --- a/app/Operations/SinusSynthesisOp.cpp +++ b/app/Operations/SinusSynthesisOp.cpp @@ -73,6 +73,8 @@ void SinusSynthesisOp::operator()(const imagein::Image*, const std::map<const im colorBox->addItem(qApp->translate("SinusSynthesisOp", "2 (Black and white)")); layout->insertRow(0, radioGroup); layout->insertRow(1, qApp->translate("SinusSynthesisOp", "Image size (width=height) : "), sizeBox); + /*Set the default initial size to 512*512 */ + sizeBox->setValue(512); layout->insertRow(2, qApp->translate("SinusSynthesisOp", "Signal period (pixel) : "), periodBox); QLabel* orientationLabel = new QLabel(qApp->translate("SinusSynthesisOp", "Orientation (°): ")); layout->insertRow(3, orientationLabel, angleBox); diff --git a/app/Operations/SplitHsvOp.cpp b/app/Operations/SplitHsvOp.cpp index 28e2dd23737fd187884beec37be2dc3bb5120f03..3a3b41d90be5651e4b5c468ad1fc87a45a158176 100644 --- a/app/Operations/SplitHsvOp.cpp +++ b/app/Operations/SplitHsvOp.cpp @@ -56,14 +56,12 @@ void SplitHsvOp:: operator()(const imagein::Image* image, const std::map<const i resImgH->setPixelAt(i,j,color.hue()); resImgS->setPixelAt(i,j,color.saturation()); resImgV->setPixelAt(i,j,color.value()); - } } this->outDoubleImage(resImgH, "Hue",false,false); this->outDoubleImage(resImgS, "Saturation",false,false); this->outDoubleImage(resImgV, "Value",false,false); - } diff --git a/app/img/qcolor-hsv.png b/app/img/qcolor-hsv.png new file mode 100644 index 0000000000000000000000000000000000000000..83494ad6d9ca5575711fb3cabf5b1a288975d851 Binary files /dev/null and b/app/img/qcolor-hsv.png differ diff --git a/app/main.cpp b/app/main.cpp index 452b8be45ce35f1ba7b899a9185410e74d3233fb..0db6b27dbc70aca24a394e2c7979926a8bd0cea7 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -30,6 +30,7 @@ #include "Services/PluginManager.h" #include "Services/ImageINSAService.h" +#include "Operations/AbsoluteConvertOp.h" #include "Operations/PointOp.h" #include "Operations/ThresholdOp.h" #include "Operations/TranslateOp.h" @@ -136,6 +137,7 @@ int main(int argc, char** argv) image->addOperation(new SeparatorOp()); //Mask and crops here image->addOperation(new SeparatorOp()); + image->addOperation(new AbsoluteConvertOp()); image->addOperation(new UCharConvertOp()); image->addOperation(new SeparatorOp()); image->addOperation(new ScalingOp()); diff --git a/core/Operation.h b/core/Operation.h index 46fb89fe5ff519625ebe389f55e05cd6ff003975..6084bbd75998124f443df212b6b271d2ace7b552 100644 --- a/core/Operation.h +++ b/core/Operation.h @@ -126,7 +126,7 @@ void outDoubleImage(imagein::ImageDouble* img, std::string title = "", bool norm /** - * @brief %Output some text to th user interface. + * @brief %Output some text to the user interface. * * @param std::string The text to output, may contain multiple lines. */ diff --git a/lib/detiq-t b/lib/detiq-t index 3a99904c0770a286941c6158e2a44cf1e1ceceb6..b918c357c0daaab2c179a99802732d7ce0804437 160000 --- a/lib/detiq-t +++ b/lib/detiq-t @@ -1 +1 @@ -Subproject commit 3a99904c0770a286941c6158e2a44cf1e1ceceb6 +Subproject commit b918c357c0daaab2c179a99802732d7ce0804437