diff --git a/Documentation/Cookbook/rst/recipes/pbclassif.rst b/Documentation/Cookbook/rst/recipes/pbclassif.rst index 8de90bce37a3cee246b18c9664f035268b394947..9eaccd318a2ad4b78c7b622f1f6fc82fdcd54222 100644 --- a/Documentation/Cookbook/rst/recipes/pbclassif.rst +++ b/Documentation/Cookbook/rst/recipes/pbclassif.rst @@ -4,10 +4,10 @@ Classification Pixel based classification -------------------------- -Orfeo ToolBox ships with a set of application to perform supervised -pixel-based image classification. This framework allows to learn from -multiple images, and using several machine learning method such as -SVM, Bayes, KNN, Random Forests, Artificial Neural Network, and +Orfeo ToolBox ships with a set of application to perform supervised or +unsupervised pixel-based image classification. This framework allows +to learn from multiple images, and using several machine learning method +such as SVM, Bayes, KNN, Random Forests, Artificial Neural Network, and others...(see application help of ``TrainImagesClassifier`` and ``TrainVectorClassifier`` for further details about all the available classifiers). Here is an overview of the complete workflow: @@ -347,8 +347,9 @@ using the ``TrainVectorClassifier`` application. -feat band_0 band_1 band_2 band_3 band_4 band_5 band_6 The ``-classifier`` parameter allows to choose which machine learning -model algorithm to train. Please refer to the -``TrainVectorClassifier`` application reference documentation. +model algorithm to train. You have the possibility to do the unsupervised +classification,for it, you must to choose the Shark kmeans classifier. +Please refer to the ``TrainVectorClassifier`` application reference documentation. In case of multiple samples files, you can add them to the ``-io.vd`` parameter (see `Working with several images`_ section). @@ -409,6 +410,11 @@ class too, based on the `ConfusionMatrixCalculator <http://www.orfeo-toolbox.org/doxygen-current/classotb_1_1ConfusionMatrixCalculator.html>`_ class. +If you have made an unsupervised classification, it must be specified +to the ``ConputeConfusionMatrix`` application. In this case, a contingency table +have to be create rather than a confusion matrix. For further details, +see ``format`` parameter in the application help of *ConputeConfusionMatrix*. + :: otbcli_ComputeConfusionMatrix -in labeled_image.tif diff --git a/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx b/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx index c06cdd83acf3bd09fd2cd55cedf2114258e950a2..968ec2a5fff7a52fb1aa9292a7b85aaf9a4728c6 100644 --- a/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx +++ b/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx @@ -1205,7 +1205,23 @@ void GDALImageIO::InternalReadImageInformation() if ((GDALGetRasterColorInterpretation(hBand) == GCI_PaletteIndex) && (hTable = GDALGetRasterColorTable(hBand)) != ITK_NULLPTR) { - m_IsIndexed = true; + + // Mantis: 1049 : OTB does not handle tif with NBITS=1 properly + // When a palette is available and pixel type is Byte, the image is + // automatically read as a color image (using the palette). Perhaps this + // behaviour should be restricted. Comment color table interpretation in + // gdalimageio + + // FIXME: Better support of color table in OTB + // - disable palette conversion in GDALImageIO (the comments in this part + // of the code are rather careful) + // - GDALImageIO should report the palette to ImageFileReader (as a metadata ? + // a kind of LUT ?). + // - ImageFileReader should use a kind of adapter filter to convert the mono + // image into color. + + // Do not set indexed image attribute to true + //m_IsIndexed = true; unsigned int ColorEntryCount = GDALGetColorEntryCount(hTable); diff --git a/Modules/IO/ImageIO/test/CMakeLists.txt b/Modules/IO/ImageIO/test/CMakeLists.txt index 5f720d46cb8607683bb9794d94c1943a10efeff8..d8374f8955993381a7db0634300990f485c57964 100644 --- a/Modules/IO/ImageIO/test/CMakeLists.txt +++ b/Modules/IO/ImageIO/test/CMakeLists.txt @@ -790,7 +790,7 @@ set_property(TEST ioTvImageFileReaderFloatHDR2LUM PROPERTY DEPENDS ioTvImageFile otb_add_test(NAME ioTvCheckNbBandsPNGIndexee COMMAND otbImageIOTestDriver otbPNGIndexedNbBandsTest ${INPUTDATA}/sbuv_indexee.png - 4 ) + 1 ) otb_add_test(NAME ioTvImageFileReaderENVI2PNG COMMAND otbImageIOTestDriver --compare-image ${EPSILON_9} ${INPUTDATA}/cthead1.png diff --git a/Modules/Remote/otb-bv.remote.cmake b/Modules/Remote/otb-bv.remote.cmake index 7249a0443e46dc7e04d0c2fb0aeaa745133f3e5a..4816ae226460fae6d54424daa86edad2e8888ddd 100644 --- a/Modules/Remote/otb-bv.remote.cmake +++ b/Modules/Remote/otb-bv.remote.cmake @@ -25,5 +25,5 @@ A more detailed description can be found on the project website: http://tully.ups-tlse.fr/jordi/otb-bv " GIT_REPOSITORY http://tully.ups-tlse.fr/jordi/otb-bv.git - GIT_TAG d13a3b3febe61c3c67777eac8261e07a6257a519 + GIT_TAG master ) diff --git a/Modules/Remote/phenotb.remote.cmake b/Modules/Remote/phenotb.remote.cmake index 4ffba060cf56583604e568cfbe92664b85d0ecff..d76b4f1cc1b30d88f22aab7c036e413eeaf4c068 100644 --- a/Modules/Remote/phenotb.remote.cmake +++ b/Modules/Remote/phenotb.remote.cmake @@ -27,5 +27,5 @@ A more detailed description can be found on the project website: http://tully.ups-tlse.fr/jordi/phenotb " GIT_REPOSITORY http://tully.ups-tlse.fr/jordi/phenotb.git - GIT_TAG 17d69b1bc1f23041dafe265e320b46ffb20229b6 + GIT_TAG master ) diff --git a/Modules/Remote/temporal-gapfilling.remote.cmake b/Modules/Remote/temporal-gapfilling.remote.cmake index 0ef5cd29ba0af30cda3e5de29d57efe219c8608b..5570ceee08dc704ed1ea8e5897db93d88e03d711 100644 --- a/Modules/Remote/temporal-gapfilling.remote.cmake +++ b/Modules/Remote/temporal-gapfilling.remote.cmake @@ -26,5 +26,5 @@ A more detailed description can be found on the project website: http://tully.ups-tlse.fr/jordi/temporalgapfilling " GIT_REPOSITORY http://tully.ups-tlse.fr/jordi/temporalgapfilling.git - GIT_TAG 14c56cb73250861d8694effeba934cebde09424c + GIT_TAG master ) diff --git a/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx b/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx index fada47696774b0d1bc6faaef8213a0abf146808a..84f7085b12557fd24f2d79a448ea5799071c3294 100644 --- a/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx +++ b/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx @@ -2515,8 +2515,8 @@ MainWindow text = tr( "(%1 %2 ; %3 %4 ; %5)" ) - .arg( wgs84[ 0 ]>=0.0 ? "N" : "S" ).arg( fabs( wgs84[ 1 ] ) ) - .arg( wgs84[ 1 ]>=0.0 ? "E" : "W" ).arg( fabs( wgs84[ 0 ] ) ) + .arg( wgs84[ 1 ]>=0.0 ? "N" : "S" ).arg( fabs( wgs84[ 1 ] ) ) + .arg( wgs84[ 0 ]>=0.0 ? "E" : "W" ).arg( fabs( wgs84[ 0 ] ) ) .arg( alt ); } diff --git a/Modules/Visualization/MonteverdiGui/include/mvdStatusBarWidget.h b/Modules/Visualization/MonteverdiGui/include/mvdStatusBarWidget.h index 714a100883da50fc0dad696e9b29a8ea4739e8b7..6ff51de45d94a3a60c3d4a89471e3d4d28f6ccd1 100644 --- a/Modules/Visualization/MonteverdiGui/include/mvdStatusBarWidget.h +++ b/Modules/Visualization/MonteverdiGui/include/mvdStatusBarWidget.h @@ -161,6 +161,11 @@ private: */ Ui::StatusBarWidget * m_UI; + /** + * \brief Change the scale when scaleLineEdit is pressed or editing is finished with change. + */ + void ChangeScale(); + /*-[ PRIVATE SLOTS SECTION ]-----------------------------------------------*/ // @@ -175,6 +180,9 @@ private slots: /** */ void on_pixelIndexLineEdit_returnPressed(); + /** + */ + void on_scaleLineEdit_returnPressed(); }; } // end namespace 'mvd' diff --git a/Modules/Visualization/MonteverdiGui/src/mvdStatusBarWidget.cxx b/Modules/Visualization/MonteverdiGui/src/mvdStatusBarWidget.cxx index 358bc123cf9450e7ceb5fa881fc5317342a6dae1..6091f79e077190b7a0d00e963f3643b6bd0eb11e 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdStatusBarWidget.cxx +++ b/Modules/Visualization/MonteverdiGui/src/mvdStatusBarWidget.cxx @@ -217,9 +217,26 @@ StatusBarWidget } /*****************************************************************************/ +void +StatusBarWidget +::on_scaleLineEdit_returnPressed() +{ + ChangeScale(); +} + void StatusBarWidget ::on_scaleLineEdit_editingFinished() +{ + if(m_UI->scaleLineEdit->isModified()) + { + ChangeScale(); + } +} + +void +StatusBarWidget +::ChangeScale() { // // Cancel if scale text is empty. diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperInputImageParameter.txx b/Modules/Wrappers/ApplicationEngine/include/otbWrapperInputImageParameter.txx index b60be0d0230b40ad01653b60fbbbe753e411d282..f8aa185cedefc55657c3cbc98c2fa6abdf78f72b 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperInputImageParameter.txx +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperInputImageParameter.txx @@ -178,7 +178,7 @@ template <class TInputImage, class TOutputImage> TOutputImage* InputImageParameter::CastImage() { - itkExceptionMacro("Cast from "<<typeid(TInputImage).name()<<" to "<<typeid(TInputImage).name()<<" not authorized."); + itkExceptionMacro("Cast from "<<typeid(TInputImage).name()<<" to "<<typeid(TOutputImage).name()<<" not authorized."); }