Commit 8cc6196e authored by Pierre Lassalle's avatar Pierre Lassalle

GRM Library

parent 9fd5b912
......@@ -41,6 +41,7 @@ int main(int argc, char **argv)
seg_.SetInput(vm["input"].as<std::string>());
seg_.SetOutputRGB(vm["output_rgb"].as<std::string>());
seg_.SetParameters(params);
seg_.SetNumberOfIterations(vm["iter"].as<unsigned int>());
seg_.InitFromImage();
seg_.Segmentation();
......@@ -61,8 +62,11 @@ bool init_args(int argc, char ** argv, po::options_description& desc, po::variab
("cw", po::value<float>(), "set the spectral weight (mandatory)")
("sw", po::value<float>(), "set the shape weight (mandatory)")
("sp", po::value<float>(), "set the scale parameter (mandatory)")
("iter", po::value<unsigned int>(), "set the number of iterations using LMBF (optional)")
("bf", po::value<int>(), "activate the Best Fitting Heuristic (optional)");
("iter", po::value<unsigned int>(), "set the number of iterations using LMBF\
(optional [value by default (70)])")
("bf", po::value<int>(), "activate the Best Fitting Heuristic \
[1: activated 0: desactivated] \
(optional [activated by default])");
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);
......
#=========================================================================
# Program: Generic Region Merging Library (GRM)
# Language: C++
# author: Lassalle Pierre
# Copyright (c) Centre National d'Etudes Spatiales. All rights reserved
# See grmlib-copyright.txt for details.
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notices for more information.
#=========================================================================
add_executable(EuclideanDistanceSegmentation EuclideanDistanceSegmentation.cxx)
target_link_libraries(EuclideanDistanceSegmentation
GRM
boost_program_options)
add_executable(FLSASegmentation FLSASegmentation.cxx)
target_link_libraries(FLSASegmentation
GRM
boost_program_options)
add_executable(BaatzSegmentation BaatzSegmentation.cxx)
target_link_libraries(BaatzSegmentation
GRM
boost_program_options)
......@@ -41,6 +41,7 @@ int main(int argc, char **argv)
seg_.SetInput(vm["input"].as<std::string>());
seg_.SetOutputRGB(vm["output_rgb"].as<std::string>());
seg_.SetParameters(params);
seg_.SetNumberOfIterations(vm["iter"].as<unsigned int>());
seg_.InitFromImage();
seg_.Segmentation();
......
PROJECT(GRM)
#=========================================================================
# Program: Generic Region Merging Library (GRM)
# Language: C++
# author: Lassalle Pierre
# Copyright (c) Centre National d'Etudes Spatiales. All rights reserved
# See grmlib-copyright.txt for details.
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notices for more information.
#=========================================================================
project(GRM)
cmake_minimum_required(VERSION 2.8)
FIND_PACKAGE(OTB)
find_package(OTB)
IF(OTB_FOUND)
INCLUDE(${OTB_USE_FILE})
include(${OTB_USE_FILE})
ELSE(OTB_FOUND)
MESSAGE(FATAL_ERROR
message(FATAL_ERROR
"Cannot build OTB project without OTB. Please set OTB_DIR.")
ENDIF(OTB_FOUND)
......@@ -25,67 +42,9 @@ else()
message(WARNING "You are using an unsupported compiler! Compilation has only been tested with Clang and GCC.")
endif()
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fpermissive")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
file(
GLOB_RECURSE
HEADERS
"src/*.h"
)
file(
GLOB_RECURSE
TEMPLATES
"src/*.txx"
)
file(
GLOB_RECURSE
SOURCES
"src/*.cxx"
)
set(PROJ_INCLUDE_DIRS "")
foreach(_headerFile ${HEADERS})
get_filename_component(_dir ${_headerFile} PATH)
list(APPEND PROJ_INCLUDE_DIRS ${_dir})
endforeach()
foreach(_templateFile ${TEMPLATES})
get_filename_component(_dir ${_templateFile} PATH)
list(APPEND PROJ_INCLUDE_DIRS ${_dir})
endforeach()
list(REMOVE_DUPLICATES PROJ_INCLUDE_DIRS)
include_directories(${PROJ_INCLUDE_DIRS})
ADD_EXECUTABLE(
EuclideanDistanceSegmentation
apps/EuclideanDistanceSegmentation.cxx
${SOURCES}
)
TARGET_LINK_LIBRARIES(EuclideanDistanceSegmentation OTBCommon OTBIO boost_program_options)
ADD_EXECUTABLE(
FLSASegmentation
apps/FLSASegmentation.cxx
${SOURCES}
)
TARGET_LINK_LIBRARIES(FLSASegmentation OTBCommon OTBIO boost_program_options)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fpermissive")
ADD_EXECUTABLE(
BaatzSegmentation
apps/BaatzSegmentation.cxx
${SOURCES}
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Library)
TARGET_LINK_LIBRARIES(BaatzSegmentation OTBCommon OTBIO boost_program_options)
add_subdirectory(Library)
add_subdirectory(Applications)
#=========================================================================
# Program: Generic Region Merging Library (GRM)
# Language: C++
# author: Lassalle Pierre
# Copyright (c) Centre National d'Etudes Spatiales. All rights reserved
# See grmlib-copyright.txt for details.
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notices for more information.
#=========================================================================
file(GLOB SRC "*.cxx")
add_library(GRM ${SRC})
target_link_libraries(GRM OTBCommon OTBIO)
/*=========================================================================
Program: Shape Encoder library
Program: Shape Encoder librarie of OBIA (Object Based Image Analysis)
Language: C++
author: Lassalle Pierre
......
/*=========================================================================
Program: Shape Encoder library
Program: Shape Encoder librarie of OBIA (Object Based Image Analysis)
Language: C++
author: Lassalle Pierre
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment