Commit 1b4175e3 authored by Edwin Carlinet's avatar Edwin Carlinet

Merge branch 'dev' into 'master'

Freeze 0.0.1 version in master branch

See merge request !96
parents 0c188180 18c9e684
Pipeline #18243 passed with stages
in 5 minutes and 23 seconds
# We'll use defaults from the LLVM style, but with 4 columns indentation.
BasedOnStyle: LLVM
IndentWidth: 2
---
Language: Cpp
# Force pointers to the type for C++.
DerivePointerAlignment: false
PointerAlignment: Left
# 120 cols
ColumnLimit: 120
Cpp11BracedListStyle: true
# break brace style
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
NamespaceIndentation: All
FixNamespaceComments: true
IndentWrappedFunctionNames: true
AllowShortFunctionsOnASingleLine: Inline
AlwaysBreakTemplateDeclarations: true
# For loop
ForEachMacros: ['mln_forall', 'mln_foreach']
/build
/doc
\ No newline at end of file
/build*
/cmake-build-*
/doc/build
/doc/html
/doc/doxyxml
/doc/source/images/*.png
.vscode
.vs
.idea
*.pyc
compile_commands.json
\ No newline at end of file
stages:
- build
- test
- deploy
image: carlinet/buildimage
.job-build-linux-base: &distcheck-linux-base
stage: test
script:
- mkdir build && cd build
- cmake .. -DCMAKE_BUILD_TYPE=$PYLENE_CONFIGURATION -DPYLENE_BUILD_BENCHMARKS=OFF
- cmake --build . --target check
distcheck-linux-gcc-release:
<<: *distcheck-linux-base
variables:
PYLENE_CONFIGURATION: "Release"
CXX: "g++"
CC: "gcc"
distcheck-linux-clang-release:
<<: *distcheck-linux-base
variables:
PYLENE_CONFIGURATION: "Release"
CXX: "clang++"
CC: "clang"
distcheck-linux-gcc-debug:
<<: *distcheck-linux-base
variables:
PYLENE_CONFIGURATION: "Debug"
CXX: "g++"
CC: "gcc"
distcheck-linux-clang-debug:
<<: *distcheck-linux-base
variables:
PYLENE_CONFIGURATION: "Debug"
CXX: "clang++"
CC: "clang"
build-doc-images:
stage: build
script:
- mkdir build && cd build
- cmake .. -DCMAKE_BUILD_TYPE=Release -DPYLENE_BUILD_BENCHMARKS=OFF
- cmake --build . --target build-images
artifacts:
paths:
- doc/source/images
expire_in: 2 days
#################
# Documentation #
#################
.documentation-base: &documentation-base
stage: test
script:
- cd doc
- doxygen
- sphinx-build -b html source ../public
artifacts:
name: "documentation"
expire_in: 2 days
paths:
- public/
# Generate doc only
documentation:
<<: *documentation-base
except:
- dev
# Deploy
pages:
<<: *documentation-base
only:
- dev
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.8.2)
project(MILENA)
include(FindBoost)
# Add FindTBB directory to CMake's module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
find_package(Boost 1.42 COMPONENTS unit_test_framework REQUIRED)
find_package(Boost 1.42 COMPONENTS program_options REQUIRED)
find_package(FreeImage REQUIRED)
find_package(TBB)
find_package(Qt4)
if(Boost_FOUND)
message(STATUS, "Boost trouvé ${Boost_INCLUDE_DIRS}")
include_directories(${Boost_INCLUDE_DIRS})
# CONFIGURATION OPTIONS
set(MLN_USE_TBB YES CACHE BOOL "Set to NO to disable use of TBB and parallelization")
option(PYLENE_BUILD_BENCHMARKS "Require Google Benchmark library. Set to YES to enable the compilation of benchmarks." YES)
# Proper project creation
set(MLN_INCLUDE_DIR "${PROJECT_SOURCE_DIR}")
if(MSVC OR APPLE)
#dummy static project not linked anywere needed so that a vcxproj is generated with the sources in the solution
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
file(GLOB_RECURSE MLN_SOURCES "${MLN_INCLUDE_DIR}/*.hpp")
add_library(Mln_srcs EXCLUDE_FROM_ALL STATIC ${MLN_SOURCES})
set_target_properties(Mln_srcs PROPERTIES LINKER_LANGUAGE CXX)
# target_compile_features(Mln_srcs PUBLIC cxx_std_14)
target_include_directories(Mln_srcs PUBLIC ${MLN_INCLUDE_DIR})
source_group(TREE ${MLN_INCLUDE_DIR} FILES ${MLN_SOURCES})
endif()
add_library(Mln INTERFACE)
target_include_directories(Mln INTERFACE ${MLN_INCLUDE_DIR})
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
include_directories(${FreeImage_INCLUDE_DIRS})
link_directories(${FreeImage_LIBRARY_DIR})
link_directories(${Boost_LIBRARY_DIRS})
if (TBB_FOUND AND MLN_USE_TBB)
include_directories(${TBB_INCLUDE_DIRS})
link_directories(${TBB_LIBRARY_DIRS})
link_libraries(${TBB_LIBRARIES})
else()
message(FATAL_ERROR, "Boost pas trouvé")
set(MLN_USE_TBB OFF)
add_definitions(-DMLN_NO_TBB)
endif()
if (UNIX AND NOT APPLE)
link_libraries(rt)
endif()
# Compiler configurations
target_compile_features(Mln INTERFACE cxx_std_17)
if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
add_compile_options("-Wextra" "-Wall" "-Werror")
endif()
#### MSVC Compiler Configuration
if (MSVC)
## This hack is for Ninja generator from VS CODE
string(REGEX REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
##
# add source directory to find mln path
include_directories("${PROJECT_SOURCE_DIR}")
add_compile_options("/wd4458" # masque le membre de classe
"/wd4456" # masque la déclaration locale précédente
"/wd5030" # l'attribut 'noinline' n'est pas reconnu
"/wd4457" # la déclaration de '?' masque le paramètre de fonction
)
set(CMAKE_CXX_FLAGS "-W -Wextra -Wall -std=c++0x")
set(CMAKE_CXX_FLAGS_DEBUG "-W -Wextra -Wall -g -ggdb")
set(CMAKE_CXX_FLAGS_RELEASE "-W -Wextra -Wall -O3 -DNDEBUG")
add_compile_options("/WX" "/W4" "/wd4244" "/wd4127" "/permissive-")
add_compile_definitions(_SCL_SECURE_NO_WARNINGS)
add_compile_definitions(_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
add_compile_definitions(_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS)
endif(MSVC)
#
# default buidling type
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release")
endif()
# Testing
ENABLE_TESTING()
SUBDIRS(tests)
#### Configuration of the Compiler ###
# set BOOST to use variadic macros
add_definitions(-D BOOST_PP_VARIADICS=1)
# Subdirectories
add_subdirectory(doc EXCLUDE_FROM_ALL)
add_subdirectory(tests EXCLUDE_FROM_ALL)
if (PYLENE_BUILD_BENCHMARKS)
add_subdirectory(bench EXCLUDE_FROM_ALL)
endif()
add_subdirectory(apps EXCLUDE_FROM_ALL)
add_subdirectory(cli EXCLUDE_FROM_ALL)
set(CPACK_SOURCE_GENERATOR "TBZ2")
set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR}/;/\\\\.git/;.*~;#.*#")
INCLUDE(CPack)
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
include(CMakeForceCompiler)
set(CMAKE_CROSSCOMPILING TRUE)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR "i386")
set(CMAKE_FIND_ROOT_PATH "/usr/lib32")
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY "ONLY")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
set(ENV{TBB_ARCH_PLATFORM} "ia32")
\ No newline at end of file
# What is Pylene ?
Pylene is a fork of [Milena](http://www.lrde.epita.fr/olena), an image processing
library targeting genericity and efficiency. Pylene is a modernized version of
Milena with the following objectives:
* Simplicity: both python bindings and simple C++ syntax
* Efficiency: write algorithms in a simple way and run them as if they were written in C. We follow one guideline: zero-cost abstraction.
* Genericity: write algorithms that are able to run on many kind of images with, yet, zero-cost abstraction.
* Interopability: run pylene algorithms on image coming from external libraries (even on your own image type).
# Requirements
Pylene is developed in modern C++. You need a modern C++ compatible compiler:
* GCC 7
* Clang 6
* Microsoft Visual Studio 2017
External dependancies:
[FreeImage](www.freeimage.sourceforge.net) (only for IO)
# Status
* GCC 8.2.0
* Clang 6.0.1
* MSVC 15.8.1
[![pipeline status](https://gitlab.lrde.epita.fr/olena/pylene/badges/dev/pipeline.svg)](https://gitlab.lrde.epita.fr/olena/pylene/commits/dev)
# Documentation
Link to the [C++ Documentation](http://olena.pages.lrde.epita.fr/pylene/)
## Presentations
Other resources (mind the dates, the library probably has changed since then):
* [A Modern C++ Library for Generic and Efficient Image Processing (GTGDMM'18)](https://www.lrde.epita.fr/dload/presentations/2018-06-19-geraud.2018.gtgdmmm.pdf)
project(apps)
add_subdirectory(tests)
add_subdirectory(imview)
add_subdirectory(maxtree_comparison)
add_subdirectory(attributes)
add_subdirectory(simplification)
add_subdirectory(clattice)
add_subdirectory(g2)
add_subdirectory(mumford_shah_on_tree)
add_subdirectory(tosgui)
add_subdirectory(saliency)
add_subdirectory(supervised-gui)
add_subdirectory(hierachical_seg-gui)
link_libraries(${FreeImage_LIBRARIES})
add_executable(MSER-patternspec-cli MSER-patternspec-cli.cpp)
add_executable(meaningfullness-patternspec-cli meaningfullness-patternspec-cli.cpp curvature.cpp)
add_executable(meaningfullness-cli meaningfullness-cli.cpp curvature.cpp)
add_executable(stat stat.cpp)
#include <mln/accu/accumulators/max.hpp>
#include <mln/core/algorithm/accumulate.hpp>
#include <mln/core/image/image2d.hpp>
#include <mln/morpho/algebraic_filter.hpp>
#include <mln/morpho/component_tree/accumulate.hpp>
#include <mln/morpho/component_tree/filtering.hpp>
#include <mln/morpho/component_tree/io.hpp>
#include <mln/morpho/component_tree/reconstruction.hpp>
#include "cMSER.hpp"
#include <apps/tos/topology.hpp>
#include <mln/accu/accumulators/accu_if.hpp>
#include <mln/accu/accumulators/count.hpp>
#include <mln/morpho/datastruct/checktree.hpp>
#include <mln/morpho/extinction.hpp>
int main(int argc, char** argv)
{
if (argc < 9)
{
std::cerr
<< "Usage: " << argv[0] << "tree image.tiff λ ε t₁ t₂ spectra.csv\n"
<< " λ:\t Grain filter before anything else (number of 2F) (consider: 20-50, *20*) \n"
<< " ε:\t The delta level considered when fetching the neighborhood of a node in MSER (consider 5-20, *10*)\n"
<< " t₁:\t Threshold above which node having a MSER value greater that t₁ are removed (consider 0.7-2.0, "
"*1.0*)\n"
<< " t₂:\t Threshold below which node having an extinction value lesser than t₂ are removed (consider 0-t₁, "
"*0.2*).\n";
std::exit(1);